SQL Questions and Answers – SQL Delete Statement

This set of SQL Multiple Choice Questions & Answers (MCQs) focuses on “SQL Delete Statement”.

1. Which clause is used to delete existing records of a table?
a) Delete
b) Drop
c) Remove
d) Clear
View Answer

Answer: a
Explanation: Using delete clause, all the existing records of a table can be deleted. Specific records can be deleted from a table by using WHERE clause in DELETE statement. If WHERE is omitted, all the records of table will be deleted.

2. Which of the following clause is used in delete statement to remove only specific records of a table?
a) Specify
b) Delete
c) Where
d) Remove
View Answer

Answer: c
Explanation: The DELETE Statement in SQL is used to delete one or more records from a table. Single as well as multiple records can be deleted from a table depending on whether WHERE clause is used or not. WHERE clause is used to delete only specific records based on given conditions.

3. Which of the following is a correct syntax for delete statement?
a) Delete From table_name Where condition(s);
b) Delete table_name;
c) Delete Table table_name;
d) Delete From table table_name;
View Answer

Answer: a
Explanation:

advertisement
advertisement
DELETE FROM TABLE_NAME WHERE condition(s);

This is the correct syntax to remove one or more records from a table based on the conditions provided in WHERE clause.

4. Which of the following clause is omitted from a delete statement to remove all the records of a table?
a) All
b) Delete
c) Where
d) From
View Answer

Answer: c
Explanation: We can delete one or more records depending on the condition we specify in the WHERE clause. If WHERE clause is omitted then all the records of the table will be deleted and the table will be empty.

5. It is not possible to delete all rows in a table without deleting the table.
a) True
b) False
View Answer

Answer: b
Explanation: It is possible to delete all rows in a table without deleting the table by using DELETE statement. Table structure, attributes, and indexes of a table will remain even after deleting all the records using DELETE statement.
advertisement

6. By using DELETE statement, which of the following is/are not deleted permanently from a table?
a) Records, Attributes
b) Table structure, Records
c) Table structure, Attributes
d) Records, Indexes of table
View Answer

Answer: c
Explanation: Using DELETE statement, only records of a table are deleted permanently. It deletes all the rows without deleting the table. Table structure, attributes, and indexes of a table will be intact.

7. Multiple tables can be deleted using a single DELETE statement.
a) True
b) False
View Answer

Answer: b
Explanation: Only one table can be deleted at a time using one DELETE statement. To delete n number of tables, delete statement should be written n number of times.
advertisement

8. To delete records in one table based on values in another table, which clause is used?
a) Values
b) Exists
c) Value
d) Exist
View Answer

Answer: b
Explanation: To delete records of one table based on values of another table EXISTS clause is used. Syntax for such statement is:

DELETE FROM TABLE_NAME WHERE EXISTS (SELECT statement);

9. After performing a delete operation using DELETE statement, which of the following is used to undo the changes made by it?
a) Undo
b) Commit
c) Rollback
d) Undo it
View Answer

Answer: c
Explanation: The DELETE command is used to remove one or more records from a table. After performing a DELETE operation, ROLLBACK is used to undo the changes.

10. DELETE is a _________ command.
a) Data definition language
b) Data manipulation language
c) Data control language
d) Transaction control language
View Answer

Answer: b
Explanation: Statements used for managing data within schema objects comes under DML commands. DELETE is a DML command.

Sanfoundry Global Education & Learning Series – SQL.

To practice all areas of SQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.