Page 1 of 1

Doctor Name Specialty DSSN DOCTOR Date prescribes M Pre ne PRESCRIPTION M Consist_of Pharmacy Name Address Phone N N Nam

Posted: Sat Nov 27, 2021 2:20 pm
by answerhappygod
Doctor Name Specialty Dssn Doctor Date Prescribes M Pre Ne Prescription M Consist Of Pharmacy Name Address Phone N N Nam 1
Doctor Name Specialty Dssn Doctor Date Prescribes M Pre Ne Prescription M Consist Of Pharmacy Name Address Phone N N Nam 1 (28.84 KiB) Viewed 75 times
It's my SQL.....
Doctor Name Specialty DSSN DOCTOR Date prescribes M Pre ne PRESCRIPTION M Consist_of Pharmacy Name Address Phone N N Name N M DRUG Sells PHARMACY Formula M Price Makes PHARMACEUTICAL COMPANY Phone Compang Name

Doctor (dssn dname, specialty) Prescription( dssn. pre_no, pdate) foreign key (dssn) references to doctor(dssn) Ph_company( pname, phone) Drug (pname, trade_name, formula) foreign key (pname) references to Ph_company(pname) Consist of (dsen, pre_no, pname, trade name) foreign key (dssn, pre_no) references prescription(dssn, pre_no), foreign key (pname, trade_name) references drug(panme, trade_name) Pharmacy (pcy_name, address, phone) Sell (pharmacy name, pname, trade name price) foreign key (pname, trade_name) references drug (pname, trade_name), foreign key (pharmacy_name) references pharmacy (pcy_name)

5) Retrieve number of type of drugs made by 'Pfizer". (Type is distinguished by "trade_name"). 6) Obtain information (pharmacy name, address) of pharmacy that sells “Ibuprofen" with the highest price among all pharmacies. ("Ibuprofen" is a trade name) 7) Retrieve the pharmacies that sell more than 2 types of drugs. List pharmacy name and number of types of drugs sold. (Type is distinguished by "trade_name". However, if two drugs with the same trade name are produced by two different pharmaceutical companies, they are considered as two different types of drugs.)