INNER JOIN


INNER JOIN is used to combine data from two related tables.

It returns only those records where matching values exist in both tables.

If a record does not have a match, it will not appear in the result.
 

INNER JOIN works using a common column between tables.

Usually this common column is a primary key in one table and a foreign key in another table.

This relationship allows SQL to connect related data.

Consider two tables where one table stores customer information and another table stores order information.

Both tables are connected using customer id.
 

The second table stores data that depends on the first table.

The customer_id column connects both tables.

This column relationship is required for joining tables.
 

INNER JOIN is written using the JOIN keyword.

The ON condition defines how the tables are connected.

Only matching records from both tables are returned.

If a customer does not have any order, that customer will not appear in the result.

INNER JOIN always returns common data between tables.

This join is widely used in real backend applications.