Question: Question 1 ( Relational Algebra - Queries ( I ) ) [ 2 5 points ] Consider the following relation schemas. Primary keys are underlined.
Question Relational Algebra Queries I
points
Consider the following relation schemas. Primary keys are underlined. All attributes are of type string
if not indicated otherwise. Use multistep and multiline queries to ease the formulation of queries. Use
the rename operator to give intermediate query results a name some textbooks use the equivalent
notation Aggregate functions as you can find them defined in some textbooks are not allowed, neither
in homework assignments nor in exams, since they are problematic extensions of the classical Relational
Algebra.
PatientsPatientID FirstName, LastName, BirthDate, Gender, PrimaryPhysicianID
PhysiciansPhysicianID FirstName, LastName, Specialty, DepartmentID, HireDate
DepartmentsDepartmentID Name, Location, StaffNumber
NursesNurseID FirstName, LastName, Shift, DepartmentID, SupervisorID
TreatmentsTreatmentID Name, Description, Cost
PatientTreatmentsPatientID TreatmentID, Date, PhysicianID, NurseID
AppointmentsAppointmentID PatientID, PhysicianID, Date, Time, Purpose
MedicalRecordsRecordID PatientID, Date, Summary, Diagnosis, TreatmentPlan
a points Find the names of patients who have received treatment in more than one department, and
list these departments along with the names of the patients.
b points Find the names of physicians who have treated patients whose first names are PatientA or
PatientB on Nov
c points Find the names of physicians in the general surgery department who have treated patients
assisted by NurseA unique first name
d points Find the names of patients who have had appointments with physicianA unique first name
but have not received any treatment no show
e points Identify the patients who have incurred the highest treatment costs. List their names along
with the respective costs.
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
