Question
Create Using MySQL Workbench for the following DB Details Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum) Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN) Medicine(TradeName, UnitPrice, GenericFlag) Prescription(Id,
Create Using MySQL Workbench for the following DB Details
Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)
Medicine(TradeName, UnitPrice, GenericFlag)
Prescription(Id, Date, Doctor_SSN, Patient_SSN)
Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)
The Doctor relation has attributes Social Security Number (SSN), first and last names, specialty, the number of experience years, and the phone number.
The Patient relation has attributes SSN, first and last names, address, date of birth (DOB), and the SSN of the patients primary doctor.
The Medicine relation has attributes trade name, unit price, and whether or not the medicine is generic (True or False).
The Prescription relation has attributes the prescription id, the date in which the prescription is written, the SSN of the doctor who wrote the prescription, and the SSN of the patient to whom the prescription is written.
The Prescription_Medicine relation stores the medicines written in each prescription along with their quantities (number of units).
And Write the SQL commands for the following:
List the trade name of generic medicine with unit price less than $50.
List the first and last name of patients whose primary doctor named John Smith.
List the first and last name of doctors who are not primary doctors to any patient.
List the SSN of patients who have Aspirin and Vitamin trade names in one prescription.
List the first and last name of patients who have no prescriptions written by doctors other than their primary doctors.
Create Using MySQL Workbench for the following DB Details
Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)
Medicine(TradeName, UnitPrice, GenericFlag)
Prescription(Id, Date, Doctor_SSN, Patient_SSN)
Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)
The Doctor relation has attributes Social Security Number (SSN), first and last names, specialty, the number of experience years, and the phone number.
The Patient relation has attributes SSN, first and last names, address, date of birth (DOB), and the SSN of the patients primary doctor.
The Medicine relation has attributes trade name, unit price, and whether or not the medicine is generic (True or False).
The Prescription relation has attributes the prescription id, the date in which the prescription is written, the SSN of the doctor who wrote the prescription, and the SSN of the patient to whom the prescription is written.
The Prescription_Medicine relation stores the medicines written in each prescription along with their quantities (number of units).
And Write the SQL commands for the following:
List the trade name of generic medicine with unit price less than $50.
List the first and last name of patients whose primary doctor named John Smith.
List the first and last name of doctors who are not primary doctors to any patient.
List the SSN of patients who have Aspirin and Vitamin trade names in one prescription.
List the first and last name of patients who have no prescriptions written by doctors other than their primary doctors.
Create Using MySQL Workbench for the following DB Details
Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)
Medicine(TradeName, UnitPrice, GenericFlag)
Prescription(Id, Date, Doctor_SSN, Patient_SSN)
Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)
The Doctor relation has attributes Social Security Number (SSN), first and last names, specialty, the number of experience years, and the phone number.
The Patient relation has attributes SSN, first and last names, address, date of birth (DOB), and the SSN of the patients primary doctor.
The Medicine relation has attributes trade name, unit price, and whether or not the medicine is generic (True or False).
The Prescription relation has attributes the prescription id, the date in which the prescription is written, the SSN of the doctor who wrote the prescription, and the SSN of the patient to whom the prescription is written.
The Prescription_Medicine relation stores the medicines written in each prescription along with their quantities (number of units).
And Write the SQL commands for the following:
List the trade name of generic medicine with unit price less than $50.
List the first and last name of patients whose primary doctor named John Smith.
List the first and last name of doctors who are not primary doctors to any patient.
List the SSN of patients who have Aspirin and Vitamin trade names in one prescription.
List the first and last name of patients who have no prescriptions written by doctors other than their primary doctors.
Create Using MySQL Workbench for the following DB Details
Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)
Medicine(TradeName, UnitPrice, GenericFlag)
Prescription(Id, Date, Doctor_SSN, Patient_SSN)
Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)
The Doctor relation has attributes Social Security Number (SSN), first and last names, specialty, the number of experience years, and the phone number.
The Patient relation has attributes SSN, first and last names, address, date of birth (DOB), and the SSN of the patients primary doctor.
The Medicine relation has attributes trade name, unit price, and whether or not the medicine is generic (True or False).
The Prescription relation has attributes the prescription id, the date in which the prescription is written, the SSN of the doctor who wrote the prescription, and the SSN of the patient to whom the prescription is written.
The Prescription_Medicine relation stores the medicines written in each prescription along with their quantities (number of units).
And Write the SQL commands for the following:
List the trade name of generic medicine with unit price less than $50.
List the first and last name of patients whose primary doctor named John Smith.
List the first and last name of doctors who are not primary doctors to any patient.
List the SSN of patients who have Aspirin and Vitamin trade names in one prescription.
List the first and last name of patients who have no prescriptions written by doctors other than their primary doctors.
Create Using MySQL Workbench for the following DB Details
Doctor(SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)
Medicine(TradeName, UnitPrice, GenericFlag)
Prescription(Id, Date, Doctor_SSN, Patient_SSN)
Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)
The Doctor relation has attributes Social Security Number (SSN), first and last names, specialty, the number of experience years, and the phone number.
The Patient relation has attributes SSN, first and last names, address, date of birth (DOB), and the SSN of the patients primary doctor.
The Medicine relation has attributes trade name, unit price, and whether or not the medicine is generic (True or False).
The Prescription relation has attributes the prescription id, the date in which the prescription is written, the SSN of the doctor who wrote the prescription, and the SSN of the patient to whom the prescription is written.
The Prescription_Medicine relation stores the medicines written in each prescription along with their quantities (number of units).
And Write the SQL commands for the following:
List the trade name of generic medicine with unit price less than $50.
List the first and last name of patients whose primary doctor named John Smith.
List the first and last name of doctors who are not primary doctors to any patient.
List the SSN of patients who have Aspirin and Vitamin trade names in one prescription.
List the first and last name of patients who have no prescriptions written by doctors other than their primary doctors.
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