Question: Here is the relational database schema we consider. Participants ( SiteID ( INT ) , LastName ( CHAR ) , FirstName ( CHAR ) ,
Here is the relational database schema we consider.
ParticipantsSiteID INT LastName CHAR FirstName CHAR PatientID INT Status CHAR Gender CHAR Age INT Language CHAR Disease CHAR Ethnicity CHAR
AlertPINPatientID INT EndUserID INT AlertName CHAR
EventsEndUserID INT StartDate DATE EndDate DATE EventName CHAR
MessagesEndUserID INT ResponseDate DATE Question VARCHAR Response VARCHAR
ReadingsEndUserID 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:
PatientIDs whos readings were recorded for blood pressure and oxygen level.
Names of the black participants who suffer from coronary disease or Alzheimers
Ids of the patients who have at least readings recorded on st February
Status of the participants for whom an alert was generated and whos readings were recorded for weight and sugar.
PatientIDs of the participants who are active but have no readings recorded.
SiteID with at least nonactive participants.
Solutions :
output : patientid participants
condition : records of blood pressure and oxygen level readings
join : patientidparticipants patientsidalertpin enduseridalertpin enduseridreadings
participantspatientidParticipants participants.patientidalertpin.patientid AlertPIN alertpin.enduseridreadings.enduserid readingsreadingtype 'blood pressure' readings.readingtype 'oxygen level'Readings
output : patientname participants
condition : ethnicity 'black' suffered from coronary disease participants
join : query involves only the participants table so no join needed
participantsfirstName, participants.lastNameparticipantsethnicity 'Black' participantsdisease 'coronary disease' participants.disease 'AlzheimersParticipants
output : patientid participants
condition : count st February readings
join : patientidparticipants and alertpin and readingdatereadings
participants.patientid countreadingsreadingdate Readings AlertPIN alertpin.patientidparticipants.patientid Participants
output : status participants
condition : records of weight and sugar readings
join : statusparticipants and alertpin and recordsreadings
participantsstatusParticipants AlertPIN readingsreadingtype 'weight'Readingsreadingsreadingtype 'sugar'Readings
output : patientid participants
condition : no records, active status participants readings
join : patientidparticipants alertpin, readings
participantspatientidparticipantsstatus 'Active'Participants participants.patientidalertpin.patientid AlertPIN alertpinpatientidalertpin readings
output : siteid participants
condition : count nonactive status participants
join : query involves only the participants table so no join needed
participantssiteid count 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
