This statement is used to join and return the rows that meet the JOIN conditions from two tables as the result set.
1 2 | SELECT attr_expr_list FROM table_reference {JOIN | INNER JOIN} table_reference ON join_condition; |
JOIN/INNER JOIN: Only the records that meet the JOIN conditions in joined tables will be displayed.
To join the course IDs from the student_info and course_info tables and check the mapping between student names and courses, run the following statement:
1 2 | SELECT student_info.name, course_info.courseName FROM student_info JOIN course_info ON (student_info.courseId = course_info.courseId); |