what does a right join do in sql
A RIGHT JOIN produces a set of records which matches every entry in the right table (course) regardless of any matching entry in the left table (user): SELECT user.name, course.name FROM `user` RIGHT JOIN `course` on user.course = course.id;