Question : Which SQL statement is used to add new records into a table?
Solution :
Correct Answer : INSERT INTO
Description -
Question : What is the correct syntax for inserting data into specific columns?
Solution : INSERT INTO table_name(column1, column2) VALUES(value1, value2)
Correct Answer :
Description -
Question : Which statement inserts multiple rows correctly?
Solution :
INSERT INTO employee
Correct Answer :
VALUES (1,'A'), (2,'B');
Description -
Question : What happens if column names are omitted in INSERT statement?
Solution :
Correct Answer : Values must match all table columns in order
Description -
Question : Which keyword is used to modify existing records?
Solution :
Correct Answer : UPDATE
Description -
Question : Which clause is commonly used with UPDATE to avoid changing all rows?
Solution :
Correct Answer : WHERE
Description -
Question : What will happen in the following query?
UPDATE employee
SET salary = 50000;
Solution :
Correct Answer : All rows update
Description -
Question : Which statement correctly updates a single column?
Solution :
Correct Answer : UPDATE student SET marks = 90 WHERE id = 1;
Description -
Question : Which query updates multiple columns?
Solution : UPDATE emp
Correct Answer :
SET salary = 40000, city = 'Delhi'
WHERE id = 2;
Description -
Question : SQL UPDATE JOIN is mainly used to:
Solution :
Correct Answer : Combine and update data using another table
Description -
Question : Which query correctly uses UPDATE JOIN in MySQL?
Solution : UPDATE orders o
Correct Answer :
JOIN customers c
ON o.cust_id = c.id
SET o.city = c.city;
Description -
Question : Which JOIN type is mostly used with UPDATE JOIN?
Solution :
Correct Answer : INNER JOIN
Description -
Question : Which statement updates date values?
Solution : UPDATE employee
Correct Answer :
SET joining_date = '2025-01-01'
WHERE id = 1;
Description -
Question : Which format is commonly used for SQL DATE datatype?
Solution :
Correct Answer : YYYY-MM-DD
Description -
Question : Which function returns current date in MySQL?
Solution :
Correct Answer : CURRENT_DATE()
Description -
Question : What is the output purpose of this query?
UPDATE orders
SET order_date = CURRENT_DATE()
WHERE id = 5;
Solution :
Correct Answer : Updates order date to current date
Description -
Question : Which command inserts NULL value?
Solution : INSERT INTO student(name, age)
Correct Answer :
VALUES ('Aman', NULL);
Description -
Question : Which keyword is mandatory in UPDATE statement?
Solution :
Correct Answer : SET
Description -
Question : Which query increases salary by 10%?
Solution : UPDATE emp
Correct Answer :
SET salary = salary * 1.10;
Description -
Question : Which statement is TRUE about UPDATE?
Solution :
Correct Answer : It modifies existing records
Description -