Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The relational schema shown below is part of a hospital database. The primary keys are underlined. Formulate SQL statements to solve parts i -
The relational schema shown below is part of a hospital database. The primary keys are underlined. Formulate SQL statements to solve parts i - iv. Patient (patientNo, patName, patAddr, DOB) Ward (wardNo, wardName, wardType, noOfBeds) Contains (patientNo, wardNo, admissionDate) Drug (drugNo, drugName, costPerUnit) Prescribed (patientNo, drugNo, unitsPer Day, startDate, finishDate) 1. List all the patients admitted today. 2. What is the total cost of Morphine supplied to a patient called 'John Smith'? 3. What is the maximum, minimum and average number of beds in a ward? Make appropriate column headings for the results table. 4. For each ward that admitted more than 10 patients today, list the ward number, ward type and number of beds in each ward.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To solve these SQL queries based on the given relational schema you can use SQL statements Below are ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started