Specify the sql queries to retrieve a list of all doctors

Assignment Help PL-SQL Programming
Reference no: EM13865680

Question:

Question For this assignment, use the following database schema:

1) Patient-PatientID, Name, DOB

2) Doctor-DoctorID, Name, MedLicenseNumber, Phone

3) Medication-MedicationID, BrandName, GenericName

4) Prescription-PrescriptionID, Date, PatientID, PrescriberID, MedicationID

Specify the SQL queries to retrieve:

1) A list of all doctors.

2) The number of patients that were born before 01/01/1994.

3) The patient information along with the ID of any prescribing doctor for each patient.

4) The prescription information along with patient name, DOB, medication brand name, and prescribing doctor name sorted by most recent date.

5) The most prescribed generic medication name.

For this assignment, use the following database schema:

1) Patient-PatientID, Name, DOB

2) Doctor-DoctorID, Name, MedLicenseNumber, Phone

3) Medication-MedicationID, BrandName, GenericName

4) Prescription-PrescriptionID, Date, PatientID, PrescriberID, MedicationID

1. select p.patient_id, p.patient_name , p.Date_Of_Birth, d.doctor_id from patient p, doctor D,prescription pr where p.patient_id = pr.patient_id , d.doctor_id = pr.prescriber_id;

2. select pr.prescription_id, pr.date, pr.patient_id, pr.prescriber_id,pr.medication_id, p.patient_name , p.Date_Of_Birth, m.brand_name,d.doctor_name from patient p, doctor D,prescription pr,medication m where p.patient_id = pr.patient_id , d.doctor_id = pr.prescriber_id,pr.medication_id = m.medication_id order by pr.date desc;

3. select m.generic_name from medication m , prescription pr where pr.medication_id = m.medication_id and pr.medication_id = (select medication_id from prescription groupby medication_id having count(1) = (select max(y.num) from (select count(1) as num from prescription groupby medication_id ) y);

Reference no: EM13865680

Questions Cloud

Define why was the document published? : why was the document published?
Should local law enforcement be playing a role in the fight : Previously we discussed how the Department of Homeland Security is tasked with addressing issues surrounding terrorism. Local law enforcement plays a part in this as well. Should local law enforcement be playing a role in the fight against terroris..
Do lowes uses differ significantly from the home depots : Which of the two basic reporting approaches for the cash flows from operating activities did Lowes use? Is this the same as what The Home Depot used? What amount of cash did Lowes receive from issuing long- term debt during the year ended January 31,..
Explain how and under what circumstances dodd-frank : client confidentiality rules limited their ability to publicly report their observations With the advent of Dodd-Frank accountants no longer need to choose between doing the right thing and risking the loss of their professional licenses Explain how ..
Specify the sql queries to retrieve a list of all doctors : Specify the SQL queries to retrieve A list of all doctors and the number of patients that were born before 01/01/1994.
Write a paper that presents findings of companys sec filings : Prepare a 6-7 page research paper that presents the findings of your analysis of the company's SEC filings. Your paper should also discuss the following: Roles, responsibilities, and objectives of internal and external auditors.
What is the cartoonist''s opinion on the issue? : What is the cartoonist's opinion on the issue?
Develop a paper design of a system : The purpose of this assignment is to develop a paper design of a system to address an important need.
What is mixed media? : What is mixed media? How did Pop Artists incorporate mixed media into their art?

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Can we offer an example of a query

Can we offer an example of a Query in which we can use a parentheses to affect the order of execution in which the WHERE Clause has both AND and OR Logical Operators?

  Write sql statement which creates stored procedure

Write SQL statement which creates stored procedure with one int input parameter. Stored procedure selects supplierId field and total of all Count field values for each group of supplierId's from Part table.

  Give me a list of all the proposed prices

Give me a list of all the proposed prices for the next year from the l_foods table.  Sort your results by proposed_price.  (Note that proposed price, is price + price_increase.)

  Display account number and balance for all customers

This assessment item is designed to test your understanding of arrays/arraylists, objects, classes, methods, sorting and searching.

  Database in omnymbus

/*Using the STUDENT table in the MISLab1 database in Omnymbus, perform the following tasks: Note the first SELECT is there to label the output, DUAL is a "dummy" table. The second SELECT is the solution.

  Question 1 calculate the tax on an ordercomplete the

question 1. calculate the tax on an ordercomplete the following steps to create a procedure to calculate the tax on an

  When should wildcard characters used in queries

When should wildcard characters used in queries and list the six types of wildcard characters that can be used in Access queries?

  Describe the meaning of keyword exists and not exists

Describe the meaning of the keyword EXISTS. Describe how any and all relate to EXISTS and NOT EXISTS. Write a query which will display names of any customers who are interested in all artists.

  Write a query to display the name

Write a Query to display the name, department_id of the employee that earns the highest salary in the Employees table.

  Write a query that will list the part number

Write a query that will list the part number, part description, and on-hand value (units on hand * unit price) for each part in item class AP. Give the expression an alias of "On Hand Value".

  A duplicate eliminating projection

Consider the following SQL query over tables R(A), S(A), and T (A). Note that "Select Distinct" in SQL represents a duplicate-eliminating projection.

  Write queries in sql and relational algebra

Write given queries in SQL and relational algebra: Determine cities from which one can fly to Toronto with one change of planes, and using same type of the aircraft for both legs of trip.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd