The SQLite Inner join is the most common type of join. It is used to combine all rows from multiple tables where the join condition is satisfied.
The SQlite Inner join is the default type of join.
Syntax:
SELECT ... FROM table1 [INNER] JOIN table2 ON conditional_expression ...
or
SELECT ... FROM table1 JOIN table2 USING ( column1 ,... ) ...
or
SELECT ... FROM table1 NATURAL JOIN table2...
Image representation:
We have two tables "STUDENT" and "DEPARTMENT".
The "STUDENT" table is having the following data:
The "DEPARTMENT" table is having the following data:
Let's take the above two tables "STUDENT" and "DEPARTMENT" and make an inner join according to the below conditions:
Example:
SELECT EMP_ID, NAME, DEPT FROM STUDENT INNER JOIN DEPARTMENT ON STUDENT.ID = DEPARTMENT.EMP_ID;
Output: