Question

In: Computer Science

2. Consider the following relations: Doctor(SSN, FirstName, LastName, Specialty,YearsOfExperience, PhoneNum) Patient(SSN, FirstName, LastName, Address, DOB, PrimaryDoctor_SSN)...

2. 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).

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

Solutions

Expert Solution

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

Here , if we know the SSN number ,we can know the doctor first name, last name , speciality , years of experience .

Also, if we know the (Doctor's First Name + Last Name) we can know the doctor's speciality , years of experience.

Therefore ,

SSN --> FirstName, LastName, Specialty,YearsOfExperience
FirstName, LastName --> Specialty,YearsOfExperience

Why not PhoneNum ?

Let us consider a case,

SSN FirstName LastName Speciality YOE PhoneNum
17235 John Wick Dentist 5 7894561230
17235 John Wick Dentist 5 3214569870

In this case , even if we know SSN,First Name,Last Name , Speciality and Years of Experience the phone num
is ambiguous.
Hence SSN--> phoneNum is WRONG.

But,if we know the phone number , we can determine the SSN,First Name ,Last Name of that person and by knowing SSN, we can determine Speciality and years of experience too.

Therefore ,

PhoneNum --> SSN,FirstName, LastName, Specialty,YearsOfExperience

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

Similarly,

SSN --> FirstName, LastName, Address, DOB, PrimaryDoctor_SSN
FirstName, LastName --> Address, DOB, PrimaryDoctor_SSN

3) Medicine(TradeName, UnitPrice, GenericFlag)

TradeName --> UnitPrice, GenericFlag

4) Prescription(Prescription Id, Date, Doctor_SSN, Patient_SSN)

Prescription Id--> Date, Doctor_SSN, Patient_SSN

5) Prescription_Medicine(Prescription Id, TradeName, NumOfUnits)

Prescription Id , TradeName --> NumOfUnits

Because, Let us consider a case

Prescription Id TradeName NumOfUnits
1 Amoxicillin 5
1 Acetaminophen. 4

Therefore , it is not sufficient to just know the prescription Id .

By knowing the prescription id and TradeName , you can find the Num Of units .

Note :- In a database , you cannot have more than one entry in a single cell.

Ex :- Even though you have multiple phone numbers for a single person, you have to make separate entries for each phone number.


Related Solutions

Using C++ Design a class named PersonData with the following member variables: lastName firstName address city...
Using C++ Design a class named PersonData with the following member variables: lastName firstName address city state zip phone and at a minimum the following member functions: A class constructor - which initializes all the member variables above a display() function - which ONLY displays all the person's data to the console Also write the appropriate accessor/mutator functions for the member variables Write a NewPersonData function. This is a stand-alone function that you can use in your main to generates...
Problem 2: (20 pts) Create a Patient class which has private fields for patientid, lastname, firstname,...
Problem 2: (20 pts) Create a Patient class which has private fields for patientid, lastname, firstname, age, and email. Create public data items for each of these private fields with get and set methods. The entire lastname must be stored in uppercase. Create a main class which instantiates a patient object and sets values for each data item within the class. Display the data in the object to the console window
Database Normalize the relations to BCNF: Member- (MemID, dateJoined, firstName, lastName, street, city, state, zip, areaCode,...
Database Normalize the relations to BCNF: Member- (MemID, dateJoined, firstName, lastName, street, city, state, zip, areaCode, phoneNumber, currentOfficeHeld) Play- (title, author, numberOfActs, setChanges) Sponsor- (sponID, name, street, city, state, zip, areaCode, phoneNumber) Subscriber- (subID, firstName, lastName, street, city, state, zip, areaCode, phoneNumber) Production- (prodyear, seasonStartDate, seasonEndDate, title) Performance – (perfyear,perfdate, time, seasonStartDate) TicketSale- (saleID, saleDate, totalAmount, perfyear, perfdate,subID) DuesPayment- (MemID, duesYear, amount, datePaid) Donation – (sponID, donationDate, donationType, donationValue, prodYear, seasonStartDate) Ticket- (saleID, seatLocation, price, type) Member - Production-(MemID, prodYear,...
Consider the following relations: Please answer in the form of symbol. Thank You Student (ssn, name,...
Consider the following relations: Please answer in the form of symbol. Thank You Student (ssn, name, address, major) Course(code, title) Registered(ssn,code) List the titles of all courses List the information of the students majoring in ‘CS’ List the codes of courses for which at least one student is registered (registered courses List the titles of registered courses List the codes of courses for which no student is registered
(C++) You are given a file consisting of students’ names in the following form: lastName, firstName...
(C++) You are given a file consisting of students’ names in the following form: lastName, firstName middleName. (Note that a student may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastName. Your program must read each student’s entire name in a variable and must consist of a function that takes as input a string, consists of a student’s name, and returns the string consisting of the altered name. Use the...
Tables CUSTOMER CustomerID FirstName LastName Address Phone LicenseNo 1 David Hacker 101 Yammba road, Rockhampton 0749008877...
Tables CUSTOMER CustomerID FirstName LastName Address Phone LicenseNo 1 David Hacker 101 Yammba road, Rockhampton 0749008877 089 777 123 2 Tony Morrison 98 South street, Melbourne 0490787772 088777555 3 Issac Newton 90 Heaven road, Sydney 0299001122 099 776 123 4 James Farrell 101 St Lucia Garden, Brisbane 0733099000 090 566 777 5 David Land 345 Illinois road, Brisbane 0739000554 456 000 999 6 Peter Garry 201 South port road, Gold Coast 0745676766 234 090 767 RENTAL RentalID CustomerID RegoNo StartDate...
SQL ONLY- Given Tables- Employee (EmployeeID, FirstName, LastName, Address) Department (DeptNo, DepartmentName, City) DepartmentEmployee(DeptNo, EmployeeID, Position)...
SQL ONLY- Given Tables- Employee (EmployeeID, FirstName, LastName, Address) Department (DeptNo, DepartmentName, City) DepartmentEmployee(DeptNo, EmployeeID, Position) Project (ProjectNo, ProjectName, DeptNo) Project Team ( ProjectNo, EmployeeID, Role) MAKE THE QUERY FOR- 1. List the name and position of all the employee who works in the (DeptNo = ‘22C’). 2. List the total number of employees in each department for those departments with more than 5 employees. 3. List the project number, project name and the number of employees who worked on...
Tax year 2017 Bob Jones DOB: October 10, 1952 SSN: 444-00-4444 Marital Status: Single Home Address:...
Tax year 2017 Bob Jones DOB: October 10, 1952 SSN: 444-00-4444 Marital Status: Single Home Address: 5100 Lakeshore Drive, Pensacola, FL 32502 Mandy’s personal tax information is as follows: Mandy Jones DOB: June 30, 1990 SSN: 999-99-9999 Marital Status: Single Home Address: 5990 Langley Road, Pensacola, FL 3520 Business address: 210 Ocean View Drive in Pensacola, Florida. Bob had $1,200,000 in taxable income. Investments in land, stocks, and bonds, is about $14,000,000. The $14,000,000 includes land worth $9,000,000 that Bob...
What is wrong with the following INSERT commands: INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position,...
What is wrong with the following INSERT commands: INSERT IN EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-285-8320','[email protected]'); INSERT INTO (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor, OfficePhone, EmailAddress) VALUES (5,'Alan','Adams','Human','H R 1',4,'360-2858320','[email protected]'); INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]'); INSERT INTO EMPLOYEE (EmployeeNumber, FirstName, LastName, Department, Position, Supervisor, OfficePhone, EmailAddress) VALUES ('Alan','Adams','Human','H R 1',4,'360285-8320','[email protected]')
Database Schema: Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberID, bookID,...
Database Schema: Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberID, bookID, loan-date, due-date) History(memberID, bookID, loan-date, return-date) Members can borrow books from the library. The number of books they can borrow is limited by the “limit” field of the Member relation (it may differ for different members). The category of a book includes fiction, non-fiction, children’s and reference. The CurrentLoan table represents the information about books that are currently checked out. When the book is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT