- MySQL Sub Query
A sub query is a query within a query. A subquery can take place in a SELECT, FROM, and WHERE clause. A subquery can be used in a INSERT, UPDATE, SELECT, and DELETE query. The main query is called the outer query and the subquery in called the inner query. The sub query is […]
- MySQL Self Join
Self Join is designed to return rows with other rows within the same table. Table1 is joined with itself. We are joining employees to their managers. You must use ALIAS for the table to distinguish the difference.
- MySQL Cross Join
The CROSS JOIN is used to join all rows from one table to all rows of another table.
- MySQL Right Join
The RIGHT JOIN clause is used to join multiple tables, return all rows from the right table(table2) and the matched rows from the left table(table1). Non matched rows from table1 will return nulls. Here we are going to use RIGHT JOIN to show customers and their addresses.
- MySQL Left Join
The LEFT JOIN clause is used to join two or more tables together. The main table will return all of its rows and the matching rows from the joining tables. If the joining tables don’t have the matching rows then MySQL will use NULL to represent those rows. Basically, you are getting everything from…