Question: I have got to write SQL queries on how to find the following questions. Example: SELECT PATIENT_ID, PATIENT_NAME FROM PATIENT (b) The following relations form

 I have got to write SQL queries on how to find

I have got to write SQL queries on how to find the following questions. Example:

SELECT PATIENT_ID, PATIENT_NAME FROM PATIENT

(b) The following relations form part of a relational database (the relations are self-explanatory): Patient (Patient_ID, Patient_Name) Doctor (Doctor_ID, Doctor_Name) Drug (Drug_ID, Drug_Name) Prescription (Doctor_ID, Patient_ID, Drug_ID, Date) Consultation (Patient_ID, Doctor_ID, Date) With reference to this relational schema, write SQL state ments for the following queries: 41 14 i. List the names of doctors who prescribed drug Calpol. ii. List the number of patients who had consultation with Dr Jones. iii. List the names of patients who had been prescribed the same drug more than 5 times. iv. List the names of doctors and the number of consul- tations they had during August 2018, including those who had none during that month

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!