Question: 4. (a) Explain the following: If an SQL statement includes a GROUP BY clause, the attributes that can be requested in the SELECT clause will

 4. (a) Explain the following: If an SQL statement includes a

4. (a) Explain the following: If an SQL statement includes a GROUP BY clause, the attributes that can be requested in the SELECT clause will be limited. What is the limitation? How to declare referential integrity in the CREATE TA- BLE statement in SQL? (b) The following relations form part of a relational database schema (the relations are self-explanatory): Student (Student_ID, Student_name) Lecturer (Lecturer_ID, Lecturer_Name) Module (Module_ID, Module_Name) Teaches (Lecturer_ID, Module_ID, Year) Enrolled (Student_ID, Module_ID, Year) With reference to this relational schema, write SQL state- ments for the following queries. i. List the names of all students who took Module CM2012 in 2011. [4 ii. List the number of students who were enrolled in CM2012 in 2009 iii. For each lecturer, list his or her name and the number of modules he or she taught in 2009. [4] iv. List the names of all modules that had over 20 students enrolled. [4]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!