SQLite Inner Join

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:

snippet
SELECT ... FROM table1 [INNER] JOIN table2 ON conditional_expression ...

or

snippet
SELECT ... FROM table1 JOIN table2 USING ( column1 ,... ) ...

or

snippet
SELECT ... FROM table1 NATURAL JOIN table2...

Image representation:

Sqlite Inner join 1

We have two tables "STUDENT" and "DEPARTMENT".

Sqlite Inner join 2

The "STUDENT" table is having the following data:

Sqlite Inner join 3

The "DEPARTMENT" table is having the following data:

Sqlite Inner join 4

Let's take the above two tables "STUDENT" and "DEPARTMENT" and make an inner join according to the below conditions:

Example:

snippet
SELECT EMP_ID, NAME, DEPT FROM STUDENT INNER JOIN DEPARTMENT
 ON STUDENT.ID = DEPARTMENT.EMP_ID;

Output:

Sqlite Inner join 5
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents