INNER JOIN

The INNER JOIN is used to combine data from two tables based on a matching column.

It only returns rows where there is a match in both tables.

Syntax

SELECT table1.column1, table2.column2
FROM table1
INNER JOIN table2 ON table1.common_column = table2.common_column;

Example Finding students who have taken exams and their scores.

SELECT Students.Name, Exams.CourseID, Exams.Score
FROM Students
INNER JOIN Exams ON Students.StudentID = Exams.StudentID;

Question number:

Up Next: Practice LEFT & RIGHT JOINS

Donate

About

Privacy Policy

Changelog