INNER JOIN in SQL
For Complete YouTube Video: Click Here
In this class, we will try to understand INNER JOIN in SQL.
We have already discussed the concepts of GROUP BY and HAVING.
INNER JOIN in SQL
A JOIN clause combines rows from two or more tables based on a related column between them.
INNER JOIN is a key used to select all the records from Table A and Table B where the join condition meets.
To understand this consider the tables below.
Consider the following query to understand the inner join concept.
SELECT s.stunum, s.stuname, b.bname FROM studenttable s INNER JOIN branchtable b ON s.bnum = b.bnum;
The INNER JOIN is the keyword to join two tables in the above query.
The inner join will select the rows wherever the condition was met.
From the above tables, wherever the condition is ‘true,’ the values in the columns of the corresponding rows will be there in the output.
The output of the query is shown below.