Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago