Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to join two tables in SQL?

1 Answer

0 votes
by (119k points)
edited by

Suppose if you have two tables Table_A and Table_B and you want join both tables on a particular column ‘column_1’ then following are the syntaxes:

Inner Join joins returns only the records in both tables where the condition met

SELECT column_name(s)
FROM Table_A
INNER JOIN Table_B
ON Table_A.column_1 = Table_B.column_1;

Left Join returns all the records of the left table and the records of another table where the condition met.

SELECT column_name(s)
FROM Table_A
LEFT JOIN Table_B
ON Table_A.column_1 = Table_B.column_1;

Right Join returns all the records of the right table and the records of another table where the condition met.

SELECT column_name(s)
FROM Table_A
RIGHT JOIN Table_B
ON Table_A.column_1 = Table_B.column_1;

You can learn SQL by signing up for SQL certification course by Intellipaat.

Related questions

0 votes
2 answers
0 votes
1 answer
asked Jan 7, 2021 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 30, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...