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

  Select statement that uses the first select statement

Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns.

  Create a plsql block to achieve the following using the hr

create a plsql block to achieve the following using the hr schemaselect the name salary and department of the employee

  Assess emerging cyber security approaches

Write an 18 page (or longer) paper in which you identify and assess emerging cyber security approaches and technologies as well as discuss government efforts to nurture the development of these emerging technologies.

  Show a structured query language query

Show a Structured Query Language (SQL) query, and screenshot your results in a Microsoft Word document. For Part 2, provide explanations and screenshots documenting

  Create tables using sql ddl

Write the SQL DDL to create the database that contains each of the relations shown in the above ERD. You will need to provide - Your DDL code for each table that you create and a screenshot showing each table that is created.

  Create tables with appropriate primary keys and foreign keys

Return the names of all employees whose company is in Baltimore - Return the names of employees of Verizon who are managers.

  Updating column in table after a shopper completes the

after a shopper completes the ordering process a procedure is called to update the following columns in the basket

  What types of users would typically use a dml statement

You must begin by understanding the different types of SQL statements. Adhere to the following deliverables for this Discussion Board.

  Create account, email confirmation, and account activation

Chosen User Identifier for the account - System must ensure the user id is at least 5 characters, and no existing accounts with the same user id- If same user id exists, System must require User to choose another user id

  Write sql statements that will retrieve the data

Write SQL statements that will retrieve the following data from a database, using Subqueries and Joins. Using the Northwind database, write a SQL SELECT statement that will retrieve the data for the following questions

  What does each allow or restrict

Roles and Profiles are used by Oracle to define and control access and privileges of groups of users. Compare and contrast the concepts of role and profile.

  How does the order of joins in an sql statement

How does the order of joins in an SQL statement affect the performance of the join and what can the DBA do to determine the preferred order of joins for an SQL statement that includes the join of at least three tables?

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