INNER JOIN
In this lesson, we will study the INNER JOIN in SQL.
We'll cover the following
INNER JOIN
The INNER JOIN keyword selects records that have matching values in both tables.
Syntax
The basic syntax of the INNER JOIN
is as follows:
SELECT table1.column1, table2.column2 ...
FROM table1
INNER JOIN table2
ON table1.common_field = table2.common_field;
Example
We will be using the CUSTOMERS and ORDERS tables as defined in the previous lesson.
Let’s say we want to retrieve the information of only those customers that have placed an order. This can be done by joining the two tables:
Get hands-on with 1400+ tech skills courses.