Question: Doctors at a busy general practice record their consultations in a central database. Each consultation has a doctor recorded against it as well as the
Doctors at a busy general practice record their consultations in a central database. Each consultation has a doctor recorded against it as well as the time of the appointment and how long (in minutes) the consultation was.
CREATE TABLE Doctor(
DoctorID int,
Name varchar(40))
CREATE TABLE Disease(
DiseaseID int,
Name varchar(40))
CREATE TABLE Consultation(
ConsultationID int,
DoctorID int,
AppointmentTime datetime,
Duration int)
CREATE TABLE ConsultationDisease(
ConsultationID int,
DiseaseID int)
Write a query or queries to find the different diseases that each doctor saw patients with for each week of the year. Also show the total time that each doctor spent examining patients with each disease for each week.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
