Doctor (SSN, FirstName, LastName, Specialty, Years0fExperience, PhoneNum) Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN) Medicine(TradeName, UnitPrice, GenericFlag)...


Doctor (SSN, FirstName, LastName, Specialty, Years0fExperience, PhoneNum)<br>Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)<br>Medicine(TradeName, UnitPrice, GenericFlag)<br>Prescription(Id, Date, Doctor_SSN, Patient_SSN)<br>Prescription Medicine(Prescription Id, TradeName, NumofUnits)<br>a. Write a relational algebra expression to list patient's first name, patient's last name,<br>and primary doctor's first name of all patients.<br>b. Write a relational algebra expression to list all the prescriptions given by each doctor.<br>Select TradeName, doctor's first name.<br>c. Write a relational algebra expression to list the first and last name of patients who<br>have no prescriptions written by doctors other than their primary doctors.<br>d. Write SQL statement to retrieve the number of patients that each doctor has written<br>prescriptions for. You must displav the doctor's first name along with the number of<br>prescriptions he/she wrote.<br>e. Write the DDL (SQL) statement to create Prescription_Medicine table. Include all the<br>constraints. Assume the data type for each attribute.<br>

Extracted text: Doctor (SSN, FirstName, LastName, Specialty, Years0fExperience, PhoneNum) Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN) Medicine(TradeName, UnitPrice, GenericFlag) Prescription(Id, Date, Doctor_SSN, Patient_SSN) Prescription Medicine(Prescription Id, TradeName, NumofUnits) a. Write a relational algebra expression to list patient's first name, patient's last name, and primary doctor's first name of all patients. b. Write a relational algebra expression to list all the prescriptions given by each doctor. Select TradeName, doctor's first name. c. Write a relational algebra expression to list the first and last name of patients who have no prescriptions written by doctors other than their primary doctors. d. Write SQL statement to retrieve the number of patients that each doctor has written prescriptions for. You must displav the doctor's first name along with the number of prescriptions he/she wrote. e. Write the DDL (SQL) statement to create Prescription_Medicine table. Include all the constraints. Assume the data type for each attribute.

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here