Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

[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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote