Question discussion

Select the correct SQL statement which will correctly insert a new row into the Customer table with only the CustomerID, Name, and Product…

359221Medium DSSSB TGT Computer Science 0 replies 0 views
0
Select the correct SQL statement which will correctly insert a new row into the Customer table with only the CustomerID, Name, and Product columns specified, assuming the table allows NULLs for other columns.
  • AINSERT Customer SET CustomerID=101, Name='Alice', Product='Pen';
  • BINSERT INTO Customer VALUES (101, 'Alice', 'Pen');
  • CINSERT INTO Customer (101, 'Alice', 'Pen');
  • DINSERT INTO Customer (CustomerID, Name, Product) VALUES (101, 'Alice', 'Pen');
Correct answer: D

Explanation

Option 4 names the columns explicitly: INSERT INTO Customer (CustomerID, Name, Product) VALUES (...). This leaves the other columns NULL.

Discussion 0

Nobody has replied yet. Start the discussion!