73
MariaDB Joins
In MariaDB database, JOINS are used to retrieve data from multiple tables. It is performed when we have two or more than two tables.
There are three types of JOINS in MariaDB:
- MariaDB INNER JOIN (Also called SIMPLE JOIN)
- MariaDB LEFT OUTER JOIN (Also called LEFT JOIN)
- MariaDB RIGHT OUTER JOIN (Also called RIGHT JOIN)
MariaDB INNER JOIN
MariaDB INNER JOIN is the most common type of join which returns all rows from multiple tables where the join condition is satisfied.
Syntax:
Image representation:
Example:
We have two tables “Students” and “Employee2”.
Student table:
Employee2 Table:
Use the following syntax to join both table according to given parameters:
Output:
You can combine as many fields as you want. Let?s add some more fields:
Output:
Next TopicMariaDB Left Outer Join