Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write each of the following queries in Relational Algebra (You are not allowed to use grouping function) Question 1. [50 marks] Consider the following relational
Write each of the following queries in Relational Algebra (You are not allowed to use grouping function)
Question 1. [50 marks] Consider the following relational database scheme TREATMENT (disease, medication) PERSON (SSN, firstName, lastName, phone, email, address, city, province) PATIENT (patient_id, SSN) DOCTOR (doctor_id, SSN, disease_of_specialization) TREATED (doctor_id, patient id, date, procedure, diagnostio) A patient may suffer from several diseases, and may take several medications for each disease. It is possible to a doctor to be a patient and vice-versa. The domains of the attributes "disease" and "disease-of-specialization" are the same, namely, the set of all diseases. In "treated" relation, the procedure could be consultation, or intervention (surgery etc.) and the diagnostic could be the name of a disease or the type of intervention. Write each of the following queries in Relational Algebra (You are not allowed to use grouping function) a. Give the detail (SSN, firstName, lastName, phone, email, address, city, province) of doctors who do not suffer from any disease b. List detail of patients (SSN, firstName, lastName, phone, email, address, city, province) who suffer from more than one disease Give the firstName, lastName and phone of doctors who are also patients suffering from a disease in their own specialization c. d. Find diseases for which there is only one medication. e. Give the detail (SSN, firstName, lastName, phone, email, address, city, province) of patients who are diagnosed with HIV, Heart Disease, Diabetic and Blood pressure as well
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