Question: Section 1 Using SQL , create tables according to the given schema shown in Figure 1 . Figure 1 : doctor ( dssn , dname,
Section
Using SQL create tables according to the given schema shown in Figure
Figure :
doctor dssn dname, specialty prescription dssn preno pdate foreign key dssn references to doctordssn phcompany pname, phone drug pname tradename, formula foreign key pname references to phcompanypname consistof dssn preno pname, tradename foreign key dssn preno references prescriptiondssn preno foreign key pname tradename references drugpanme tradename pharmacy pcyname, address, phone sell pharmacyname, pname, tradename, price foreign key pname tradename references drug pname tradename foreign key pharmacyname references pharmacypcyname
Section
Populate the database. Please check sections for details.
Section
Use SQL to specify the following queries. When you populate the database, insert data such that at least two rows will be display as the result of running each query.
Retrieve the drugs information trade name and formula which are manufactured by company Pfizer Order the result by trade name in descending order.
List drug information Pharmaceutical company name, trade name, formula that has been prescribed by at least one doctor.
Obtain all the prescription drugs trade name, company name and prescription date given by Doctor Kate Elmasri
Retrieve all the drugs tradename, formula sold by WalmartWalmart is pharmacy name
Retrieve number of type of drugs made by PfizerType is distinguished by tradename
Obtain information pharmacy name, address of pharmacy that sells Ibuprofen with the highest price among all pharmacies. Ibuprofen is a trade name
Retrieve the pharmacies that sell more than types of drugs. List pharmacy name and number of types of drugs sold. Type is distinguished by tradename 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.
Section
Specify the statements to drop all the tables. Pay attention to the order of the drop statements in order to drop everything successfully.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
