Answered step by step
Verified Expert Solution
Link Copied!

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

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

5-3 Complete the worksheet.

Answered: 1 week ago

Question

What is a statement of work (SOW)? What purpose does it serve?

Answered: 1 week ago