NATURAL
join tries to find the fields with the same name and joins themSELECT
students.*,
notes.*
FROM `notes`
NATURAL JOIN `students`
Note: using NATURAL
join is dangerous, because we don't know explicitly which fields will be joint.
SELECT students.*, notes.*
FROM `notes`
JOIN `students`
ON notes.student_id = students.student_id
AND notes.id = students.id
Returns the same result as the above query