SlideShare ist ein Scribd-Unternehmen logo
1 von 3
(a) A relation in 1NF is used to rec ord meetings between tutors
and their tutees: Tutorial Meeting( staffID , staffName, onDate ,
atTime , tuteeID, tuteeName, note) The attributes onDate , a t
Time and note are used to store the date, time and notes for
each tutorial meeting. The primary key is und erlined.
(i) Draw a functional dependency diagram for the relation
Tutorial Meeting . [3 marks]
(ii) Explain why it is not in 2NF. [2 marks]
(iii) Decompose the given relation into relations that are in 2NF
and write the schema for these relations. [2 mark s]
(iv) For each relation in 2NF determine if it is in 3NF and
explain why. [2 marks]
(b) Two tables in a student database are given below: Student(
student ID , name, gender, dob, address, entryYear)
Registration( student ID , mcode , exMark, cwMark) where the
primary keys are underlined and foreign keys are in italic.
(i) Write an SQL statement to list the student IDs and names of
those students who have not yet registered on any modules. [3
marks]
( i i) Write an SQL statement to create a view named betterAtE
xam that list the IDs of those students who on average perform
better in exams than coursework, i.e. a student’s average exam
mark is higher than his/her average coursework mark of all
modules registered by the student. [5 marks]
(i i i) Views may be used to simplify queries. W rite an SQL
statement to display the ID, name and gender of all students
who on average perform better in exams than coursework. You
should make use of the view betterAtExam defined in (ii)
Solution
b)
1)Write an SQL statement to list the student IDs and names of
those students who have not yet registered on any modules.
select student_ID,name from Student where student_ID NOT IN
(select student_ID from Registration)
2)Write an SQL statement to create a view named betterAtE
xam that list the IDs of those students who on average perform
better in exams than coursework, i.e. a student’s average exam
mark is higher than his/her average coursework mark of all
modules registered by the student.
create view betterAtExam
select *from Registration avg(exMark)<avg(cwMark) group by
student_ID
(i i i) Views may be used to simplify queries. W rite an SQL
statement to display the ID, name and gender of all students
who on average perform better in exams than coursework.
select student ID , name, gender from betterAtExam
a)Functional dependency
staffID->staffName
tuteeID->tuteeName
staffID,staffName,tuteeID,tuteeName->onDate,atTime,note
B)Primary key(staffID,tuteeID)
All non-key attributes are fully functional dependent on the
primary key(to satsi fy normal form 2nd)
but staffname is dependebt of staffId
and tutee name depend on tuteeID
so the above relation is not in 2NF
C)Decomposed relations
staffID,staffName Relation-1
tuteeID,tuteeName Relation-2
taffID,tuteeID,onDate,atTime,note Relation-3

Weitere ähnliche Inhalte

Ähnlich wie (a) A relation in 1NF is used to rec ord meetings between tutors and.docx

Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx
Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docxPage 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx
Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx
alfred4lewis58146
 
75629 Topic prevention measures for vulneranbilitiesNumber of.docx
75629 Topic prevention measures for vulneranbilitiesNumber of.docx75629 Topic prevention measures for vulneranbilitiesNumber of.docx
75629 Topic prevention measures for vulneranbilitiesNumber of.docx
sleeperharwell
 

Ähnlich wie (a) A relation in 1NF is used to rec ord meetings between tutors and.docx (20)

Sql xp 01
Sql xp 01Sql xp 01
Sql xp 01
 
Web Technology End semester Examination Questions
Web Technology End semester Examination QuestionsWeb Technology End semester Examination Questions
Web Technology End semester Examination Questions
 
Dbms record
Dbms recordDbms record
Dbms record
 
Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx
Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docxPage 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx
Page 1 of 27 Tony LoCoco ITCO333 – Unit 2 August 2.docx
 
Cis 515 Effective Communication-snaptutorial.com
Cis 515 Effective Communication-snaptutorial.comCis 515 Effective Communication-snaptutorial.com
Cis 515 Effective Communication-snaptutorial.com
 
Model questions-b.sc .csit-6th-sem
Model questions-b.sc .csit-6th-semModel questions-b.sc .csit-6th-sem
Model questions-b.sc .csit-6th-sem
 
CIS 515 Education Organization / snaptutorial.com
CIS 515 Education Organization / snaptutorial.comCIS 515 Education Organization / snaptutorial.com
CIS 515 Education Organization / snaptutorial.com
 
CIS 515 Enhance teaching / snaptutorial.com
CIS 515 Enhance teaching / snaptutorial.com CIS 515 Enhance teaching / snaptutorial.com
CIS 515 Enhance teaching / snaptutorial.com
 
CP Handout#10
CP Handout#10CP Handout#10
CP Handout#10
 
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paperInformatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
Informatics practises 12th CBSE INDIA 2012-2013 MAIN EXAM paper
 
Semester ii
Semester   iiSemester   ii
Semester ii
 
75629 Topic prevention measures for vulneranbilitiesNumber of.docx
75629 Topic prevention measures for vulneranbilitiesNumber of.docx75629 Topic prevention measures for vulneranbilitiesNumber of.docx
75629 Topic prevention measures for vulneranbilitiesNumber of.docx
 
Micro project project co 3i
Micro project project co 3iMicro project project co 3i
Micro project project co 3i
 
structure1.pdf
structure1.pdfstructure1.pdf
structure1.pdf
 
Dbms qsntns
Dbms qsntnsDbms qsntns
Dbms qsntns
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii
 
Neo4j.pptx
Neo4j.pptxNeo4j.pptx
Neo4j.pptx
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUSSE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
 
1z0-419 Oracle Application Development Framework 12c Essentials Test
1z0-419 Oracle Application Development Framework 12c Essentials Test1z0-419 Oracle Application Development Framework 12c Essentials Test
1z0-419 Oracle Application Development Framework 12c Essentials Test
 
Cis 111 Education Redefined - snaptutorial.com
Cis 111     Education Redefined - snaptutorial.comCis 111     Education Redefined - snaptutorial.com
Cis 111 Education Redefined - snaptutorial.com
 

Mehr von ajoy21

Please choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docxPlease choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docx
ajoy21
 
Please answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docxPlease answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docx
ajoy21
 
Please answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docxPlease answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docx
ajoy21
 
Please answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docxPlease answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docx
ajoy21
 

Mehr von ajoy21 (20)

Please complete the assignment listed below.Define and explain, us.docx
Please complete the assignment listed below.Define and explain, us.docxPlease complete the assignment listed below.Define and explain, us.docx
Please complete the assignment listed below.Define and explain, us.docx
 
Please cite sources for each question. Do not use the same sources f.docx
Please cite sources for each question. Do not use the same sources f.docxPlease cite sources for each question. Do not use the same sources f.docx
Please cite sources for each question. Do not use the same sources f.docx
 
Please choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docxPlease choose one of the following questions to answer for this week.docx
Please choose one of the following questions to answer for this week.docx
 
Please check the attachment for my paper.Please add citations to a.docx
Please check the attachment for my paper.Please add citations to a.docxPlease check the attachment for my paper.Please add citations to a.docx
Please check the attachment for my paper.Please add citations to a.docx
 
Please answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docxPlease answer to this discussion post. No less than 150 words. Refer.docx
Please answer to this discussion post. No less than 150 words. Refer.docx
 
Please attach Non-nursing theorist summaries.JigsawExecutive .docx
Please attach Non-nursing theorist summaries.JigsawExecutive .docxPlease attach Non-nursing theorist summaries.JigsawExecutive .docx
Please attach Non-nursing theorist summaries.JigsawExecutive .docx
 
Please answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docxPlease answer the question .There is no work count. PLEASE NUMBER .docx
Please answer the question .There is no work count. PLEASE NUMBER .docx
 
Please answer the following questions. Please cite your references..docx
Please answer the following questions. Please cite your references..docxPlease answer the following questions. Please cite your references..docx
Please answer the following questions. Please cite your references..docx
 
Please answer the following questions.1.      1.  Are you or.docx
Please answer the following questions.1.      1.  Are you or.docxPlease answer the following questions.1.      1.  Are you or.docx
Please answer the following questions.1.      1.  Are you or.docx
 
Please answer the following question with 200-300 words.Q. Discu.docx
Please answer the following question with 200-300 words.Q. Discu.docxPlease answer the following question with 200-300 words.Q. Discu.docx
Please answer the following question with 200-300 words.Q. Discu.docx
 
Please answer the following question Why do you think the US ha.docx
Please answer the following question Why do you think the US ha.docxPlease answer the following question Why do you think the US ha.docx
Please answer the following question Why do you think the US ha.docx
 
Please answer the following questions. Define tunneling in the V.docx
Please answer the following questions. Define tunneling in the V.docxPlease answer the following questions. Define tunneling in the V.docx
Please answer the following questions. Define tunneling in the V.docx
 
Please answer the following questions1. How can you stimulate the.docx
Please answer the following questions1. How can you stimulate the.docxPlease answer the following questions1. How can you stimulate the.docx
Please answer the following questions1. How can you stimulate the.docx
 
Please answer the following questions very deeply and presicely .docx
Please answer the following questions very deeply and presicely .docxPlease answer the following questions very deeply and presicely .docx
Please answer the following questions very deeply and presicely .docx
 
Please answer the following questions in an informal 1 ½ - 2-page es.docx
Please answer the following questions in an informal 1 ½ - 2-page es.docxPlease answer the following questions in an informal 1 ½ - 2-page es.docx
Please answer the following questions in an informal 1 ½ - 2-page es.docx
 
Please answer the following questions in a response of 150 to 200 wo.docx
Please answer the following questions in a response of 150 to 200 wo.docxPlease answer the following questions in a response of 150 to 200 wo.docx
Please answer the following questions in a response of 150 to 200 wo.docx
 
Please answer these questions regarding the (TILA) Truth in Lending .docx
Please answer these questions regarding the (TILA) Truth in Lending .docxPlease answer these questions regarding the (TILA) Truth in Lending .docx
Please answer these questions regarding the (TILA) Truth in Lending .docx
 
Please answer the following question pertaining to psychology. Inc.docx
Please answer the following question pertaining to psychology. Inc.docxPlease answer the following question pertaining to psychology. Inc.docx
Please answer the following question pertaining to psychology. Inc.docx
 
Please answer the following questions in a response of 250 to 300 .docx
Please answer the following questions in a response of 250 to 300 .docxPlease answer the following questions in a response of 250 to 300 .docx
Please answer the following questions in a response of 250 to 300 .docx
 
Please answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docxPlease answer the three questions completly. I have attached the que.docx
Please answer the three questions completly. I have attached the que.docx
 

Kürzlich hochgeladen

Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

(a) A relation in 1NF is used to rec ord meetings between tutors and.docx

  • 1. (a) A relation in 1NF is used to rec ord meetings between tutors and their tutees: Tutorial Meeting( staffID , staffName, onDate , atTime , tuteeID, tuteeName, note) The attributes onDate , a t Time and note are used to store the date, time and notes for each tutorial meeting. The primary key is und erlined. (i) Draw a functional dependency diagram for the relation Tutorial Meeting . [3 marks] (ii) Explain why it is not in 2NF. [2 marks] (iii) Decompose the given relation into relations that are in 2NF and write the schema for these relations. [2 mark s] (iv) For each relation in 2NF determine if it is in 3NF and explain why. [2 marks] (b) Two tables in a student database are given below: Student( student ID , name, gender, dob, address, entryYear) Registration( student ID , mcode , exMark, cwMark) where the primary keys are underlined and foreign keys are in italic. (i) Write an SQL statement to list the student IDs and names of those students who have not yet registered on any modules. [3 marks] ( i i) Write an SQL statement to create a view named betterAtE xam that list the IDs of those students who on average perform better in exams than coursework, i.e. a student’s average exam mark is higher than his/her average coursework mark of all modules registered by the student. [5 marks] (i i i) Views may be used to simplify queries. W rite an SQL statement to display the ID, name and gender of all students who on average perform better in exams than coursework. You should make use of the view betterAtExam defined in (ii) Solution
  • 2. b) 1)Write an SQL statement to list the student IDs and names of those students who have not yet registered on any modules. select student_ID,name from Student where student_ID NOT IN (select student_ID from Registration) 2)Write an SQL statement to create a view named betterAtE xam that list the IDs of those students who on average perform better in exams than coursework, i.e. a student’s average exam mark is higher than his/her average coursework mark of all modules registered by the student. create view betterAtExam select *from Registration avg(exMark)<avg(cwMark) group by student_ID (i i i) Views may be used to simplify queries. W rite an SQL statement to display the ID, name and gender of all students who on average perform better in exams than coursework. select student ID , name, gender from betterAtExam a)Functional dependency staffID->staffName tuteeID->tuteeName staffID,staffName,tuteeID,tuteeName->onDate,atTime,note B)Primary key(staffID,tuteeID) All non-key attributes are fully functional dependent on the primary key(to satsi fy normal form 2nd)
  • 3. but staffname is dependebt of staffId and tutee name depend on tuteeID so the above relation is not in 2NF C)Decomposed relations staffID,staffName Relation-1 tuteeID,tuteeName Relation-2 taffID,tuteeID,onDate,atTime,note Relation-3