[sql] SELECT PatientFirst, PatientLast, PatientDOB, DoctorFisrt, DoctorLast, Doc
ID: 3720873 • Letter: #
Question
[sql]
SELECT PatientFirst, PatientLast, PatientDOB, DoctorFisrt, DoctorLast, DoctorSpecialty, appointmentDate, appointmentTime
FROM Appointments INNER JOIN Patients
ON Appointments.ApptID = Patients.ApptID
INNER JOIN Doctors ON Appointments.ApptID=Doctors.ApptID
Create a query that contains two inner joins that returns only those rows where the patient has an appointment with a doctor. Patient ID, Patient First, Patient Last, DOB, DoctorID, Doctor First, Doctor Last, Appointment Date, Appointment Time, Doctor speciality.
what is wrong with this query? it gives me an error
Msg 207, Level 16, State 1, Line 3
Invalid column name 'ApptID'.
Msg 207, Level 16, State 1, Line 4
Invalid column name 'ApptID'.
Explanation / Answer
see this code as my of sql query
doctors table
patients table
appointment table
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.