There are several syntaxes you can use to do the same thing. In this case, all your joins are going to be "inner" joins, so what you want is to use "Left Inner" joins from your user_student table back to user and student, respectively.
SELECT u.name, s.name FROM user_student us LEFT JOIN user u ON u.id = us.user_id LEFT JOIN student s ON s.id = us.student_idThis person created a nice site that really breaks down and makes clear the syntax and the different variations you can use. http://mysqljoin.com/
- Twinbird likes this