Question: SQL CODE: CAN SOMEONE PLEAAE HELP ME ON THIS? 4. Return a list of every patient that has an appointment scheduled tomorrow. Include the name

SQL CODE: CAN SOMEONE PLEAAE HELP ME ON THIS?
4. Return a list of every patient that has an appointment scheduled tomorrow. Include the name of the provider that the appointment is scheduled with as well. Try to write this code such that it can be reused for any day that the code is executed. [Code should return four columns, with the relevant patient and provider names].
5. Return a list of patients that had more than two prescriptions written for Humira in the year 2019. Include the number of prescriptions that were written as an additional column, and order by prescription frequency (with the patient with the most prescriptions listed first). [Code should return three columns: Patient first and last names, and a count column]
Imagine a simplified data-model with the following 3 tables: Patient Stores patient-level information and demographics. Indicator Column Name PK patient_id first name last name Description Primary Key Patient First Name Patient Last Name Additional Columns Prescription - Stores information on prescriptions written for the patients. Indicator Column Name Description PK prescription_id Primary Key FK patient_id Foreign Key to the Patient table prescription_date Date on which the prescription was written medication Name of the Medication prescribed provider_first The first name of the Doctor or other provider that prescribed the medication provider last The last name of the prescribing provider Additional Columns Appointment - Stores information on patient's scheduled appointments. Indicator Column Name Description PK appointment id Primary Key FK patient id Foreign Key to the Patient table appointment_date Date on which the appointment is scheduled provider_first The first name of the Doctor (or other provider) that patient is scheduled to see provider_last The last name of the provider Additional columns
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
