For example SELECT student_id, student_name, school_id, school, grade

Type JOIN to do an Inner Join. This returns records that have matching values in both tables. For example FROM Students JOIN Details. Type LEFT JOIN to do an Outer Left Join. This returns all records from the left table and matching values from the right table. For example FROM Students LEFT JOIN Details. Type RIGHT JOIN to do a Outer Right Join. This returns all records from the right table and matching values from the left table. For example FROM Students RIGHT JOIN Details. Type FULL JOIN to do a Full Outer Join. This returns all records from both tables. For example FROM Students FULL JOIN Details.

In our example, “Students” is the first table and “student_id” is the primary key from the Students table, which is also in the Details table. So we would type ON Students. student_id = Details. student_id. This joins the Students table with the Details table using “student_id” as the primary key. Alternatively, if the student_name column is in the “Details” table, you can display the student_name column in place of the student_id field by typing ON Students. student_id = Details. student_name.

In our example, we would type JOIN Schools.

SELECT student_id, student_name, school_id, school, grade FROM Students FULL JOIN Details ON Students. student_id = Details. student_id JOIN Schools ON Schools. student_id = Students. student_id