Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2) (50 points) Consider the following database about patients visiting doctors. A record is added into the table visits whenever a patient visits a doctor.
Q2) (50 points) Consider the following database about patients visiting doctors. A record is added into the table visits whenever a patient visits a doctor. Primary keys are underlined Patients (Pnum Pname, Age, Address, Phone) Doctors (Dmum, Dname. Rank, Salary) Visits (Pnum Dpum, Visit_Date, Diagnoses) Write an SQL statement for the following queri 1. List the doctors with rank starting with the letter 'P 2. List the patients' names and ages from the oldest to the youngest 3 List the patients who visited Dr. Ahmed and remove duplicates 4. Delete all patients with age between 12 and 20 years. 5. Increase the salary of all doctors with rank 'P3, with 10%. 6. Write the create table statement of the table visits, specify the primary key, foreign keys and any constraint
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