SIT 103 - SIT 103 1: SELECT SURNAME, GIVEN FROM DOCTOR...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
SIT 103 1: SELECT SURNAME, GIVEN FROM DOCTOR WHERE ((RESIGNED – JOINED)/365.25) > 5 ORDER BY SURNAME, GIVEN; 2: SELECT GIVEN ||','|| SURNAME AS NAME FROM PATIENT, DOTOR WHERE DISEASE.NAME = ‘Depression’ AND DISEASE.DISEASEID = DIAGNOSED.DISEASEID AND DIAGNOSED.APPOINTMENTID = APPOINTMENT.APPOINTMENTID AND APPOINTMENT.DOCTORID = DOCTOR.DOCTORID AND APPOINTMENT.PATIENTID = PATIENT.PATIENTID AND DATEOFAPPIONTMENT < ‘01-JAN-2011’ AND DATEOFAPPIONTMENT > ’31-DEB-2009’; 3: CREATE VIEW TODAYS_ APPOINTMENTS AS SELECT DATEOFAPPOINTMENT, TIMEOFAPPOINTMENT, GIVEN ||','|| SURNAME AS NAME, PHONEHOME, PHONEWORK, PHONEFAX, DONE FROM APPOINTMENT, PATIENT, DOCTOR WHERE DATE(DATEOFAPPOINTMENT) = DATE(NOW()) AND APPOINTMENT.DOCTORID = DOCTOR.DOCTORID AND APPOINTMENT.PATIENTID = PATIENT.PATIENTID ORDER BY DOCTOR.NAME, TIMEOFAPPOINTMENT; 4: SELECT CONSULTATION-ROOMNO, COUNT (*) FROM APPOINTMENT WHERE ((TIMEOFAPPOINTMENT-DATEOFAPPOINTMENT)) >0 GROUP BY CONSULTATION-ROOMNO; 5: SELECT SURNAME, GIVEN, APPOINTMENTID, COUNT (*)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/03/2011 for the course SIT 202 taught by Professor Robindoss during the Three '09 term at Deakin.

Page1 / 2

SIT 103 - SIT 103 1: SELECT SURNAME, GIVEN FROM DOCTOR...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online