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

For this lab you will be using SQL SELECT statements to query your database tabl

ID: 3914549 • Letter: F

Question

For this lab you will be using SQL SELECT statements to query your database tables. You will be turning in the results of the following queries:

1. List all Patients and what Bed they are assigned to

//Note that not all patients have a bed.

2. List all patients who had Treatments and what Treatment they received

3. List all patients who had tests and what Test they had

4. List the employees (doctors, nurses, etc.) who assisted each patient.

5. List all patients in alphabetical order

6. List all patients who live in Atlanta and had a test completed

7. List all patients who live in either Woodstock or Roswell who had a treatment completed.

//I will add patients that live in Atlanta, Woodstock and Roswell.

Explanation / Answer

If you have any doutbs, please give me comment...

1)

SELECT P.patient_id, first_name, last_name, bed_id, room_id

FROM patients P, Beds B

WHERE P.patient_id = B.patient_id;

2)

SELECT P.patient_id, first_name, last_name, Code, Description

FROM patients P, treatments T

WHERE P.patient_id = T.patient_id;

5)

SELECT *

FROM patients

ORDER BY last_name, first_name;

7)

SELECT P.patient_id, first_name, last_name

FROM patient P, admission A

WHERE (City = 'Woodstock' OR City = 'Roswell') AND A.date_discharged IS NOT NULL;

Note:

Information not sufficient for rest of questions, otherwise if you give any explanation, I will give the solution...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote