Which of the following commands is used to delete data from a SQL database table?
-
DELETE
-
UNION
-
SELECT
-
INSERT
DELETE is the SQL command that removes rows from a table based on a WHERE condition. It's part of DML (Data Manipulation Language). INSERT adds new data, SELECT retrieves data, and UNION combines result sets.
To answer this question, you need to understand SQL commands for manipulating data in a database table.
Let's go through each option to understand why it is correct or incorrect:
Option A) DELETE - This option is correct because the DELETE command is used to remove one or more rows of data from a table in a SQL database.
Option B) UNION - This option is incorrect because the UNION command is used to combine the result sets of two or more SELECT statements.
Option C) SELECT - This option is incorrect because the SELECT command is used to retrieve data from a database table, not delete it.
Option D) INSERT - This option is incorrect because the INSERT command is used to add new rows of data into a table, not delete existing data.
The correct answer is A) DELETE. This option is correct because the DELETE command is specifically designed to delete data from a SQL database table.