MYSQL basic of SQL including JOINS

manoj shakya
Madgical Techdom — MadTechBits
2 min readNov 30, 2021

What is SQL ?

MySQL is a database management system that is used by WordPress to store and retrieve all your blog information. MySQL is an open-source relational database management system. It runs as a server and allows multiple users to manage and create numerous databases.

What is JOINS ?

In the simplest terms, a JOIN in SQL is a way to access data from multiple tables that reference and share overlapping data.

Introduction to MySQL join clauses

A relational database consists of multiple related tables linking together using common columns, which are known as foreign key columns. Because of this, data in each table is incomplete from the business perspective.

A join is a method of linking data between one or more tables based on values of the common column between the tables.

MySQL supports the following types of joins:

  1. Inner join
  2. Left join
  3. Right join
  4. Cross join

Inner join-

The Inner join keyword selects records that have matching values in both tables.

Left join-

The Left join keyword returns all records from the left table and the matching records from the right table. The result is 0 records from the right side if there is no match.

Right join-

The Right join keyword returns all records from the right table and the matching records from the left table. The result is 0 records from the left side if there is no match.

Cross join-

The SQL CROSS JOIN produces a result set which is the number of rows in the first table multiplied by the number of rows in the second table if nowhere clause is used along with CROSS JOIN.

--

--