SELECT s.name, u.title, l.release_year FROM `students` AS `s` INNER JOIN `link` As `l` On l.student_id = s.student_id INNER JOIN `universities` As `u` On u.university_id = l.university_id
Connection between the three tables
- Single Page
Posted 18 January 2014 - 19:50 PM
Posted 18 February 2014 - 18:51 PM
Hello. There are 3 tables. The first Students id_student, name), the second "Universities" (id_university, title). And a third table relative LINK (id_student, id_university, release_year). How can I write code to link? Here is the SQL query that should beSELECT s.name, u.title, l.release_year FROM `students` AS `s` INNER JOIN `link` As `l` On l.student_id = s.student_id INNER JOIN `universities` As `u` On u.university_id = l.university_id
the sql code can be put in a view then use the view name instead of a table name