A
A
Abra Kadabra2015-12-21 21:58:41
MySQL
Abra Kadabra, 2015-12-21 21:58:41

How to build a SQL query correctly?

Good evening, there is such a database. (Polyclinic database)
You need to make a request to select the patient's first and last name by doctor's name
and by referral number.
The first and last name are in the USER table, the IDs that link PATIEN and DOCTOR are in the APPOINTMENT.
Questions:
How can I link 3 tables?
Do you need to build on request?
Is it possible to fit all this into 1 SELECT ?
5d08dcb6dc9c4319836716e7475d1a12.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2015-12-21
@Jmaster

You can fit in 1 SELECT. A few JOINs will help you out. Train. Try joining Appointment to Patient first, then Users and Doctors. Good luck

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question