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...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.