Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following relations: Doctor ( SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum) Patient (SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN) Medicine (TradeName, UnitPrice, GenericFlag) Prescription (Prescription

Consider the following relations:

Doctor (SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)

Patient (SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)

Medicine (TradeName, UnitPrice, GenericFlag)

Prescription (Prescription Id, Date, Doctor_SSN, Patient_SSN)

Prescription_Medicine (Prescription Id, TradeName, NumOfUnits)

Note: The Medicine relation has attributes, trade name, unit price, and whether or not the medicine is generic (True or False).

  1. Determine the functional dependencies that exist in each table given above.

Example answer for - Doctor table:

Doctor (SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)

Write Functional dependency exists in this table:

Doctor_SSN FirstName, LastName, Specialty, YearsOfExperience, PhoneNum,

Patient_SSN

  1. After determining the functional dependencies, convert these tables to an equivalent collection of tables that are in third normal form (3NF). If they are already in 3NF justify your answer.

Example: Answer for table Doctor

Doctor (SSN, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum, *Patient_SSN)

1NF: No repeating groups. So it is 1NF.

2NF : check Partial dependency on the primary key, so the relation is in 2NF.

3NF: Check non primary key dependent on another non-primary key attribute

No So it is in 3NF

Repeat this for other tables.

  1. Write SQL queries to answer following questions.

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

Calculus Of A Single Variable

Authors: Ron Larson, Bruce H. Edwards

11th Edition

978-1337275361, 9781337275361

Students also viewed these Databases questions