What is the purpose of the JOIN clause in SQL?

What is the purpose of the JOIN clause in SQL?

a) To combine rows from two or more tables based on a related column
b) To filter records based on conditions
c) To delete rows from a table
d) To insert new rows into a table

Answer:

a) To combine rows from two or more tables based on a related column

Explanation:

The JOIN clause in SQL is used to combine rows from two or more tables based on a related column. It allows data from different tables to be merged into a single result set, based on common attributes.

Common types of JOINs include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN. Each type defines how unmatched rows are handled in the resulting dataset.

JOINs are essential for queries that require data from multiple tables, such as retrieving customer and order details from two different tables.

Reference:

Database Management System MCQ (Multiple Choice Questions)

Scroll to Top