Question: need help with part b The following tables form part of a database held at Kafka University: AcadStaff (staffID, fName, 1Name, address, highestDegree, deptNo) Department

 need help with part b The following tables form part of

need help with part b

The following tables form part of a database held at Kafka University: AcadStaff (staffID, fName, 1Name, address, highestDegree, deptNo) Department (deptNo, deptName, hod staffID) Unit (uCode, unitName, deptNo) Teaches (staffID, uCode, Quarter, work.loadPoints) 1. AcadStaff table contains details of academic staff, and staffID is the primary key. 2. Department table contains department details and deptNo is the primary key. hodstaffIL 3. Unit table contains details of the units offered by each department, and the primary 4. Teaches table contains details of the workload points gained by academic staff on identifies the Head of the Department. Each department has only one head key is uCode (no two departments can offer the same unit) each unit they teach in 2016, and staffID, uCode and Quarter jointly form the composite key (a) (3 marks) Explain what a foreign key is, and how it relates to primary keys. Illustrate your answer with examples from the above tables. (b) (3 marks) Formulate queries in SQL to do the following (i) List details of all academic staff who work in the Computing department but have not gotten a PhD degree.1 (ii) For each academic staff, provide their names (fName, 1Name), the units they teach (unitName) and the total number of workload points they receive from teaching those units. For instance, if teaching a unit in any quarter earns 10 points, and John teaches ISYS100 in two quarters but ISYS200 in only one quarter, it should show 20 points against ISYS100 and 10 points against ISYS200 (iii) Produce a list of the department heads who have a PhD degree and live outside the greater Ryde area. You can identify such department heads by inspecting their address - if the address has the word "Ryde" in it (as in 11 Station Street, West Ryde, NSW 2114), then the head does live in the greater Ryde area

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!