Data Engineering Associate with Databricks Practice Exam

Session length

1 / 20

What SQL operation is effectively used to insert multiple records from one table to another?

INSERT INTO

The SQL operation that is effectively used to insert multiple records from one table to another is the INSERT INTO statement. This command allows you to take data from an existing table and add it to a new or existing table in a structured manner. By using a SELECT statement in conjunction with INSERT INTO, you can transfer multiple records at once, which is efficient for batch operations.

For example, a commonly used syntax would look like this:

```sql

INSERT INTO target_table (column1, column2)

SELECT column1, column2

FROM source_table;

```

This command will insert all selected records from the source table into the target table. This makes it an ideal choice for tasks involving data migration or consolidation, where you're looking to populate another table with data that meets specific criteria.

The other options presented do not fulfill the requirement of inserting multiple records from one table to another. UPDATE is used to modify existing records in a table, REPLACE typically updates or inserts a new record, and ALTER TABLE is used for changing the structure of a table, such as adding or removing columns. None of these operations are designed for the purpose of inserting multiple new records directly between tables.

UPDATE

REPLACE

ALTER TABLE

Next Question
Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy