Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

-For each table, revise the code to add primary keys and foreign keys constraint

ID: 3733807 • Letter: #

Question

-For each table, revise the code to add primary keys and foreign keys constraints if relevant Implement the following queries in SOL 1. Retrieve the specialty of Dr. Tran Minh 2. Retrieve the first and last name of every dermatologist 3. Retrieve the names of all patients in area code 901 4. Retrieve the names and phone numbers of all patients born in 1970 5. Retrieve the names and DOB of all female patients 6. Retrieve the last name of all patients with are code not equal to 615 7. Retrieve the names of the all medications. 8. Retrieve the names of each medication and their price, order from most expensive to least 9. Retrieve all information on medication prescribed by 32445 10. Retrieve the patient Num for Dr 36221

Explanation / Answer

1.select DOC_SPECIALITY from DOCTOR where DOC_FNAME='Tran' and DOC_LNAME='Minh';

2.select DOC_FNAME,DOC_LNAME from DOCTOR where DOC_SPECIALITY='Dermatology';

3.select PAT_TILTLE,PAT_FNAME,PAT_LNAME from PATIENT where PAR_AREACODE=''901";

4.select PAT_TILTLE,PAT_FNAME,PAT_LNAME,PAT_PHONE from PATIENT where YEAR(PAT_DOB)=1970;

5.select PAT_TILTLE,PAT_FNAME,PAT_LNAME,PAT_DOB from PATIENT where PAT_TITLE ='Mrs.' or PAT_TITLE ='Ms.';

6.select PAT_LNAME from PATIENT where PAR_AREACODE <> ''615";

7.select DRUG_NAME from DRUGS;

8.select DRUG_NAME,DRUG_PRICE from DRUGS order by DRUG_PRICE desc;

9.select * from PRESCRIPTION where DOC_ID='32445';

10.select PAT_NUM from PRESCRIPTION where DOC_ID='36221';