Which command in SQL combines records from two or more tables?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the OCR GCSE Computer Science Paper 2 exam. Practice with diverse questions, flashcards, and detailed explanations. Boost your confidence and ace your test!

The SQL command that combines records from two or more tables is JOIN. JOIN is used when you want to retrieve data from multiple tables based on related columns between them. By using JOIN, you can create a set of results that combines rows where there is a match in specified columns across the different tables, allowing for comprehensive data analysis and retrieval.

For example, if you have a table of customers and a table of orders, you can use JOIN to get a result set that shows customer details alongside their respective orders. This is particularly useful in relational databases, where data is often spread across multiple tables to maintain organization and integrity.

The other choices do not accurately describe the process of combining records across tables in the same way JOIN does. UNION, for example, is used to combine the results of two or more SELECT queries, but it operates on the results of those queries to consolidate similar data into a single output rather than combining rows from tables based on relationships. LINK and COMBINE are not standard SQL commands used for combining records from multiple tables.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy