SQLite Inner Join
To combine all rows from multiple tables, the SQLite Inner join is used. However, it joins only those rows where the join condition is satisfied. It is the simplest, most popular and the default type of Join in SQLite.
SELECT columns FROM table_1 INNER JOIN table_2 ON conditions
SELECT columns FROM table_1 JOIN table2 USING ( column_1 ,... ) ...
SELECT columns FROM table_1 NATURAL JOIN table2...
STUDENT_ID STUDENT_NAME STUDENT_SUBJECT 1 Tom French 2 Jerry Physics 3 Bruno English
ID NAME SALARY SUBJECT 1 Jim 10000 English 2 John 20000 Geology 3 Watson 15000 French 4 Holmes 25000 Chemistry 5 Tony 30000 Physics
SELECT ID, STUDENT_NAME, NAME, SUBJECT FROM STUDENTS INNER JOIN TEACHERS ON STUDENTS.STUDENT_SUBJECT = TEACHERS.SUBJECT;
ID STUDENT_NAME NAME SUBJECT 3 Tom Watson French 5 Jerry Tony Physics 1 Bruno Jim English
In the above example, the records from the ID, NAME and the SUBJECT Columns of the TEACHERS table and the STUDENT_NAME column of the STUDENTS table is fetched and joined where the value of the STUDENT_SUBJECT column of the STUDENTS table is equal to the SUBJECT column of the TEACHERS table.