QuestionQ103

VerifiedManipulating Data

Refer to the exhibit and review the structure of the customers table.

Question Image

NEW_CUSTOMERS is a new table containing the columns CUST_ID, CUST_NAME, and CUST_CITY, with the same data types and sizes as their corresponding columns in the customers table. Evaluate this insert statement:

Question Image

The insert statement fails when it is executed. What could be the reason?

Explanation

A query that supplies rows for an insert must use the INSERT INTO ... SELECT ... form; it does not follow the VALUES keyword. VALUES is for expressions that create a single row. The source query’s three selected expressions correspond to the three specified target columns, and a WHERE clause is permitted in the source query.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!