The correct answer is Rows from two or more tables. In SQL (Structured Query Language), a JOIN operation is used to combine rows from two or more tables based on a related column between them. This is a fundamental operation in relational databases, allowing you to retrieve data that is logically connected but stored across different tables.
For instance, if you have one table for 'Customers' and another for 'Orders', you might join them on a common column like 'CustomerID' to see which customers placed which orders. The result of a JOIN operation is a new result set that contains columns from both (or more) tables, with rows matched according to the specified join condition.
There are several types of JOINs, including:
- INNER JOIN: Returns rows when there is a match in both tables.
- LEFT (OUTER) JOIN: Returns all rows from the left table, and the matched rows from the right table.
- RIGHT (OUTER) JOIN: Returns all rows from the right table, and the matched rows from the left table.
- FULL (OUTER) JOIN: Returns all rows when there is a match in one of the tables.
JOINs are crucial for querying normalized databases efficiently.