The relational schema shown below is part of a hospital database. The primary keys are highlighted in bold.
Patient (patientNo, patName, patAddr, DOB)
Ward (wardNo, wardName, wardType, noOfBeds)
Contains (patientNo,
wardNo,
admissionDate)
Drug (drugNo, drugName, costPerUnit)
Prescribed (patientNo,
drugNo, unitsPerDay,
startDate, finishDate)
Formulate the following SQL statements:
a) Find the names of all the patients being prescribed ‘Morphine’.
b) What is the total cost of Morphine supplied to a patient called ‘John Smith’?
c) For each ward that admitted more than 10 patients today, list the ward number, ward type and number of beds in each ward.