Question
Thank you, here is my question. The database name is Hospital . Tables Doctor DID DName DPhone 1111 James Marks 719-555-1111 1222 Jason Marks 719-555-1111
Thank you, here is my question.
The database name is Hospital.
Tables
Doctor
DID | DName | DPhone |
1111 | James Marks | 719-555-1111 |
1222 | Jason Marks | 719-555-1111 |
1333 | Joe James Smith | |
1444 | Jason Marks | 650-555-6666 |
Patient
PID | PName | PState | PAge |
3111 | Mary Marks | CO | 54 |
3333 | Matt Marks | CO | 28 |
3444 | Ming Lee | TX | 19 |
3555 | Mike Chong | AZ | 43 |
Visit
VID | Date | DID | PID |
4001 | 03-21-2013 | 1111 | 3111 |
4002 | 04-04-2013 | 1111 | 3333 |
4011 | 12-21-2014 | 1111 | 3111 |
4014 | 03-02-2015 | 1222 | 3111 |
4035 | 07-22-2016 | 1444 | 3555 |
Treatment
TID | TName | Cost | VID |
5001 | Flu Shot | 10.00 | 4001 |
5002 | Annual Checkup | 55.00 | 4001 |
5003 | EKG | 110.00 | 4001 |
5011 | Flu Shot | 10.00 | 4014 |
5059 | X-ray | 78.00 | 4035 |
1. WITHOUT USING JOIN, list the patient's ID and name for patient(s) who have ever had a flu shot. Exclude duplicated results.
2. For each patient, list patient's ID and the total treatment cost. Since some visits do NOT involve any expenses, ignore patients whose total treatment cost is zero.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started