Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
afebmunn
Starting Member
4 Posts |
Posted - 2008-12-17 : 17:43:55
|
| Relational Algebra Help SQLI have the following table :Patient (PatientCode, PatientSurname, PatientFirstname, PatientSex, Age, PatientOccupation, PatientHeight, PatientWeight, PatientAddress)Doctor (DoctorCode, DoctorSurName, DoctorFirstName, DoctorPrivateAddress, MobileNo, Function)Operation (Operation Code, PatientCode, DoctorCode, Date, Time, Result, OperationType)Is_Seen_By (PatientCode, DoctorCode, Date, Time).2 - i need in relational algebra form 2 find :1. Find the surname and gender of the patients that have been operated on by doctor "DR20" and results have been successful.2. Find the code of the operations that have been done on the 15th of December of 2008 and have been successful.3. Find the first name, surnames and address of the patients that have had at least one operation with broken limb.4. Find the details of all patients that have shared any doctors with the patient that has the code “P555".5. Find the surname, gender and age of the patients that have been seen by doctor "DR55" and have been operated on by doctor “DR9”.**** for the first one i have came up with : -R1: select doctor where doctor code ="DR20"R2: R1 NAT JOIN PatientR3: Project R2 over patientsurname, patientsexstuck on last bit can somebody help? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-18 : 01:13:47
|
| show what you've tried so far for last bit and then we will help you |
 |
|
|
afebmunn
Starting Member
4 Posts |
Posted - 2008-12-18 : 08:10:46
|
| R1: select doctor where doctor code ="DR20"R2: R1 NAT JOIN PatientR3: Project R2 over patientsurname, patientsexR4: select opearation where result ="successful"im sure there is something wrong here some ppl told me i should maybe have onli up to R3. thanks for your help |
 |
|
|
afebmunn
Starting Member
4 Posts |
Posted - 2008-12-18 : 13:53:11
|
| ? |
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-12-18 : 14:53:23
|
| [code] Select PatientSurname, PatientSex From Patient p inner join Operation o on p.PatientCode = o.PatientCode inner join Doctor d on d.DoctorCode = o.DoctorCode where DoctorCode = 'DR20' and o.Result = 'successful'[/code] |
 |
|
|
afebmunn
Starting Member
4 Posts |
Posted - 2008-12-18 : 16:49:39
|
| ok thanks alot. i done the second 1 is this correct?select operation code, result,where date ="15th december 2008" >? |
 |
|
|
|
|
|
|
|