CROSS JOIN in SQLite
CROSS JOIN is also konown as a Cartesian product. CROSS JOIN returns the combined result set with every row matched from the first table with the second table.
For example, if there are 5 rows in first table and 5 rows in second table, then the cartesian product of first and second row is 5 * 5 i.e 25 rows are retrieved.
Syntax:
SELECT columns
FROM table1
CROSS JOIN table2;
Example of CROSS JOIN
SELECT *
FROM Teachers
CROSS JOIN department;
Output:
Explanation: In the above Query, we have fetched the data from the both tabes rows are multiplied and the count of number of rows is increased to 25 as the product is done(5 * 5).
SQLite Joins
SQLite is a server-less database engine and it is written in C programming language. It is developed by D. Richard Hipp in the year 2000. The main motive for developing SQLite is to overcome the use of complex database engines like MySQL etc. It has become one of the most popularly used database engines used in Television, Mobile Phones, web browsers, and many more. It is written simply so that it can be embedded into other applications.
In this article we will learn about the Joins in SQLite, and how it works, and also along with that, we will be looking at different types of joins in SQLite in a detailed and understandable way with examples.