Question: Q8. Write an SQL statement to answer the question: 'Compute the total treatment hours by specialists in the sequence of specialist name.' The resulting table


Q8. Write an SQL statement to answer the question: 'Compute the total treatment hours by specialists in the sequence of specialist name.' The resulting table is as follows, sorted by specialist name. (8 marks) Q9. Write an SQL statement to answer the question: 'Are there any bookings not handled by appropriate specialists, i.e. specialist type not matching treatment type?' The resulting table is as follows. (8 marks) Q10. In view of the possible problem as per Q9, suggest a way to prevent such booking. You may consider running query to highlight this or changing the data model to prevent so. Explain your suggestion. (6 marks) Part 3 Answer Q6-Q10 with reference to the SPECIALIST, TREATMENT, and BOOKING tables with which a health care centre assigns specialists to treatments for clients. SPECIALIST Primary Key: SPECIALIST ID TREATMENT Primary Key: TREATMENT_ID BOOKING Primary Key: BOOK ID Foreign Keys: BOOK_SPECIALIST, BOOK_TREATMENT Q6. Does the BOOKING table exhibit referential integrity? Explain your reasons (5 marks) Q7. What is the result of SPECIALIST LEFT OUTER JOIN BOOKING? (8 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
