How to select data from multiple tables which all have same id field? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

How to select data from multiple tables which all have same id field?

Let's suppose we have three tables student, teacher, parent in which sid present.

15th May 2019, 4:39 PM
Shubham Tandale
Shubham Tandale - avatar
4 Antworten
+ 5
Okay if we have a table named Student and we want to select all the students in that table The Query : Select * from Student and if we have a table Teacher which is in relation with the table Student and we want to select the student name and his teacher name The query : select student_name , teacher_name From [Student] Join Teacher On [Student].teacher_Id = teacher_Id
15th May 2019, 5:05 PM
Why So Serious ?
Why So Serious ? - avatar
+ 5
Then you need two Join operations in the same query to read from the 3 tables You need to read and understand the JOIN notion
15th May 2019, 5:17 PM
Why So Serious ?
Why So Serious ? - avatar
0
Also I want to select parent name as well from parent from 3 tables I have to pick
15th May 2019, 5:13 PM
Shubham Tandale
Shubham Tandale - avatar
0
Okay
15th May 2019, 5:22 PM
Shubham Tandale
Shubham Tandale - avatar