Multiple choice technology databases

Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?

  1. INSERT INTO tab1 SELECT cx, cy FROM tab2

  2. INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)

  3. INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)

  4. INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To insert all rows from one table into another, use INSERT INTO with a SELECT subquery. Option A is correct: INSERT INTO tab1 SELECT cx, cy FROM tab2 will insert all rows from tab2 into tab1, with the columns mapping in order (cx goes to c1, cy goes to c2). Option B is incorrect because VALUES requires literal values, not table references. Option C is incorrect because VALUES expects individual value expressions, not a SELECT statement. Option D is incorrect because VALUES cannot contain a SELECT subquery in that position.