SQL – Equi-Join

In SQL, we use a join statement to display results from different tables side by side.

For example, we might use an Equi-join to display Films and Distributors information together

An Equi-join works when there is matching data in both tables

 

 

 

 

 

SELECT *  

FROM Films, Distributors 

Where Films.Distributor = Distributors.Distributor; 

In plain English:  

Show everything from the Films table and join it with the Distributors table.  Joining the records where the Distributor field of the Films table matches the Distributor field of the Distributors table 

 

 

EQUI-JOIN – Films.Distributor =Distributors.Distributor

 

 

 

 

 

 

 

 

 

 

Example 

SELECT Title,Rating, [Running Time], Distributors.Distributor, Founded 

FROM Films, Distributors 

Where Distributors.Distributor = Films.Distributor 

And Rating = “12A” 

ORDER BY [Running Time] ASC;