Question: Here is the relational database schema we consider. Participants ( SiteID ( INT ) , LastName ( CHAR ) , FirstName ( CHAR ) ,

Here is the relational database schema we consider.
Participants(SiteID (INT), LastName (CHAR), FirstName (CHAR), PatientID (INT), Status (CHAR), Gender (CHAR), Age (INT), Language (CHAR), Disease (CHAR), Ethnicity (CHAR))
AlertPIN(PatientID (INT), EndUserID (INT), AlertName (CHAR))
Events(EndUserID (INT), StartDate (DATE), EndDate (DATE), EventName (CHAR))
Messages(EndUserID (INT), ResponseDate (DATE), Question (VARCHAR), Response (VARCHAR))
Readings(EndUserID (INT), ReadingID (INT), ReadingType (CHAR), ReadingDate (DATE))
Note:
Primary keys are underlined.
Datatypes are provided for your guidance.
Status is either Active or Not Active. Patients are either actively involved in the program or not at all involved.
Language is English, French, Hindi, Spanish, Mandarin
Ethnicity is Asian, Black, Native American, White
EndUserID (different than the PatientID) is generated for a participant in case of an alert event
ResponseDate is the date recorded when a patient is questioned by a doctor/ nurse
ReadingID generated for every EndUserID for different ReadingType like blood pressure, pulse rate, weight, etc.
Write the following queries in relational algebra, not SQL (so cannot use aggregation):
1.PatientIDs whos readings were recorded for blood pressure and oxygen level.
2.Names of the black participants who suffer from coronary disease or Alzheimers.
3.Ids of the patients who have at least 3 readings recorded on 21st February 2021('02-21-2021').
4.Status of the participants for whom an alert was generated and whos readings were recorded for weight and sugar.
5.PatientIDs of the participants who are active but have no readings recorded.
6.SiteID with at least 500 non-active participants.
Solutions :
1. output : patientid -> participants
condition : records of blood pressure and oxygen level -> readings
join : patientid(participants)= patientsid(alertpin), enduserid(alertpin)= enduserid(readings)
(participants.patientid)((Participants participants.patientid=alertpin.patientid AlertPIN) alertpin.enduserid=readings.enduserid ( (readings.readingtype = 'blood pressure' readings.readingtype = 'oxygen level')(Readings))
2. output : patientname -> participants
condition : ethnicity = 'black' , suffered from coronary disease -> participants
join : query involves only the participants table so no join needed
(participants.firstName, participants.lastName)((participants.ethnicity = 'Black' (participants.disease = 'coronary disease' participants.disease = 'Alzheimers'))(Participants))
3. output : patientid -> participants
condition : count >=3,21st February 2021('02-21-2021')-> readings
join : patientid(participants) and alertpin and readingdate(readings)
participants.patientid (((count(*)>2)((readings.readingdate ='02-21-2021'))(Readings) AlertPIN alertpin.patientid=participants.patientid Participants)
4. output : status -> participants
condition : records of weight and sugar -> readings
join : status(participants) and alertpin and records(readings)
(participants.status)(Participants AlertPIN ((readings.readingtype = 'weight')(Readings))((readings.readingtype = 'sugar')(Readings)))
5. output : patientid -> participants
condition : no records, active status -> participants , readings
join : patientid(participants), alertpin, readings
(participants.patientid)((participants.status = 'Active')(Participants participants.patientid=alertpin.patientid AlertPIN)) (alertpin.patientid)(alertpin readings)
6. output : siteid -> participants
condition : count >=500, non-active status -> participants
join : query involves only the participants table so no join needed
(participants.siteid)(( count(*)>499)( status = 'not active'))(Participants)))
please review and make necessary changes if needed. also it is only for relational algebra so now cannot use any sql query in this.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!