Question 17Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

Select the correct SQL statement which will correctly insert a new row into the Customer table

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.
  1. AINSERT Customer SET CustomerID=101, Name='Alice', Product='Pen';
  2. BINSERT INTO Customer VALUES (101, 'Alice', 'Pen');
  3. CINSERT INTO Customer (101, 'Alice', 'Pen');
  4. DINSERT INTO Customer (CustomerID, Name, Product) VALUES (101, 'Alice', 'Pen');
Show answerHide answer

Correct answer: (D) INSERT INTO Customer (CustomerID, Name, Product) VALUES (101, 'Alice', 'Pen');

Explanation

To insert values into only some columns, list those columns after the table name and give matching values: INSERT INTO table (cols) VALUES (...). Option B gives no column list, so it expects values for all columns.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 17 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.