1.Draw the Relational Database Schema Diagram, then show the Functional Dependency and Referential Integrity for the following Hospital Invoice Database:
ACCOUNT (InvoiceNbr, AccountNbr, InvoiceDate, DueDate, DateAdmitted, DateDischarged)
PATIENT (PatientNbr, PatientName, PatientAddress, City, State, Zip)
PATIENT_CHARGES (InvoiceNbr, ItemCode, Charge)
ITEM (ItemCode, Description)
ADMISION (PatientNbr, DateAdmitted, DateDischarged, Location)
ROOM (Location. Accommodation, Extension)
OCCUPANCY (Location, DateAdmitted, PatientNbr)
PROCEDURE_LOCATION (PatientNbr, Proceduredate, Location)
ACCOUNT_PATIENT (AccountNbr, PatientNbr)
Note: The Relational Schema above is in 3rd Normal Form relations with the Functional Dependencies and Referential Integrity constraints.
2.Consider the following relations:
Customer (CustomerID , CustomerName, CustomerAddress, CustomerCity, CustomerState, CustomerPostalCode)
Order (OrderID, OrderDate, CustomerID)
Product (ProductID, ProductDescription, ProductStandardPrice)
- Write SQL Command to retrieve the customer IDs and names of all customers, along with the order IDs for all the orders they have placed? (2 points)
- Write SQL Command to list customer name, identification number, and order number for all customers listed in the Customer table. Include the customer identification number and name even if there is no order available for that customer? (2 points)
- Write SQL Command to retrieve the name and address of the customer who placed order number 1234? (1 point)
- Write SQL Command to list the details about the product with the highest standard price? (2 points)


0 comments