DBMS Exam
DBMS Exam
d) Consider the following business rules and draw a well labelled ERD
i. A patent has a patient number (identifying), a name and address (with house
number, street and district)
ii. Patients are treated in a single ward by the doctors assigned to them
iii. Usually each patient will be assigned a single doctor, but in rare cases they will
have two
(6 marks)
a) In a SELECT query, what is the difference between a where clause and a having
clause? (2 marks)
c) What is the difference between a column constraint and a table constraint (2 marks)
(2 marks)
ii. Write SQL statement to CREATE the above table and insert the data in the
table (4 marks)
iii. Write SQL statement to DELETE all staff whose Fname is Mary (3 marks)
iv. Write SQL statement to create an extra column named S_ Grade (3 marks)