Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (total marks 20) Given the same simple Doctor Treats-Patient database schema which contains three files describing information about doctors and patients they treat as

image text in transcribedimage text in transcribed

1. (total marks 20) Given the same simple Doctor Treats-Patient database schema which contains three files describing information about doctors and patients they treat as follows, answer the following questions with regards to this database. Doctor DocID string. DSams: string. Daddress string. Numpatients: integer) Treats (DocId: string. SSN:string, illness string, day: string, cost: real) Patient (SSNstring. PatientName: string. PAddress: string. Ascintest) Note: DocID D Nams. Daddress and Numpatients stand for the doctor's identifier, name, address and the total number of patients the doctor has, respectively. Also, SSN, PatientName, PAddress and Age stand for the the patient's social security number, name, address and age respectively. The rest of the attributes are for the illness (es. Cold, flu, diabetes, headache) and cost of each treatment visit (ce $85) not including cost of buying prescription. Note that a doctor can treat a patient for several illnesses. Assume that an update operation (a general term in this chapter, for an insert, a modify or a delete operation) is to be made to this database to enter information about a new patient, who was treated for several illnesses by more than one doctor. Answer the following questions on what specific relations, attributes and operations (eg, insert, modify, delete) that need to be done for this update to be implemented in the entire database. Provide your answers both in descriptive sentence and using the formal database operations of INSERT, MODIFY, DELETE as used in Chapter 5 of book with specific attributes and relations when possible. An example formal insert of a doctor record into the Doctor table is: INSERT DocID Name DAddress, Numpatients into Doctor for new Doctor record And an example descriptive sentence is: 1). do an insert operation for a new doctor record into the Doctor table. (a) Give the set of needed insert, modify or delete operations for this update. 5 marks (b) What types of integrity constraints (explain using attributes, eg. Dec. of relevant files) would you expect to check for this update to be done? 5 marks (c) Which of these integrity constraints are key.entity integrity, and referential (foreign key) integrity constraints and which are not? 5 marks (d) Specify all the referential integrity (foreign key) constraints on this database in the format Referring Relation.Attribute - ReferredRelation.Attribute 5 marks Solution: Question a Give the operations for this update 5 marks b. What types of integrity constraints would you expect to check? (explain using attributes, ea. DocID of relevant files) 5 marks c. Which of these integrity constraints are key, entity integrity, and referential integrity constraints and which are not? 5 marks Specify all the referential integrity constraints on this database 5 marks 1. (total marks 20) Given the same simple Doctor Treats-Patient database schema which contains three files describing information about doctors and patients they treat as follows, answer the following questions with regards to this database. Doctor DocID string. DSams: string. Daddress string. Numpatients: integer) Treats (DocId: string. SSN:string, illness string, day: string, cost: real) Patient (SSNstring. PatientName: string. PAddress: string. Ascintest) Note: DocID D Nams. Daddress and Numpatients stand for the doctor's identifier, name, address and the total number of patients the doctor has, respectively. Also, SSN, PatientName, PAddress and Age stand for the the patient's social security number, name, address and age respectively. The rest of the attributes are for the illness (es. Cold, flu, diabetes, headache) and cost of each treatment visit (ce $85) not including cost of buying prescription. Note that a doctor can treat a patient for several illnesses. Assume that an update operation (a general term in this chapter, for an insert, a modify or a delete operation) is to be made to this database to enter information about a new patient, who was treated for several illnesses by more than one doctor. Answer the following questions on what specific relations, attributes and operations (eg, insert, modify, delete) that need to be done for this update to be implemented in the entire database. Provide your answers both in descriptive sentence and using the formal database operations of INSERT, MODIFY, DELETE as used in Chapter 5 of book with specific attributes and relations when possible. An example formal insert of a doctor record into the Doctor table is: INSERT DocID Name DAddress, Numpatients into Doctor for new Doctor record And an example descriptive sentence is: 1). do an insert operation for a new doctor record into the Doctor table. (a) Give the set of needed insert, modify or delete operations for this update. 5 marks (b) What types of integrity constraints (explain using attributes, eg. Dec. of relevant files) would you expect to check for this update to be done? 5 marks (c) Which of these integrity constraints are key.entity integrity, and referential (foreign key) integrity constraints and which are not? 5 marks (d) Specify all the referential integrity (foreign key) constraints on this database in the format Referring Relation.Attribute - ReferredRelation.Attribute 5 marks Solution: Question a Give the operations for this update 5 marks b. What types of integrity constraints would you expect to check? (explain using attributes, ea. DocID of relevant files) 5 marks c. Which of these integrity constraints are key, entity integrity, and referential integrity constraints and which are not? 5 marks Specify all the referential integrity constraints on this database 5 marks

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions