PrepAway - Latest Free Exam Questions & Answers

Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?

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?

PrepAway - Latest Free Exam Questions & Answers

A.
INSERT INTO tab1 SELECTcx, cy FROM tab2

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

C.
INSERT INTO tab1 VALUES (SELECTcx, cy FROM tab2)

D.
INSERT INTO tab1 (c1, c2) VALUES (SELECTcx, cy FROM tab2)

2 Comments on “Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?

  1. swamy says:

    SQL INSERT INTO SELECT Syntax
    We can copy all columns from one table to another, existing table:

    INSERT INTO table2
    SELECT * FROM table1;
    Or we can copy only the columns we want to into another, existing table:

    INSERT INTO table2
    (column_name(s))
    SELECT column_name(s)
    FROM table1;




    0



    0

Leave a Reply