Question
Which SQL command is used to remove only specific rows
from a table while preserving the structure and other rows?Solution
The DELETE command in SQL is used to remove specific rows from a table based on a WHERE clause condition. Unlike DROP or TRUNCATE, which impact the entire table, DELETE operates on a more granular level, enabling selective removal of data while preserving the table structure and any other rows. For example: DELETE FROM employees WHERE department = 'Sales'; This query removes only the rows from the employees table where the department is 'Sales', leaving all other rows intact. Additionally, the DELETE command logs each deleted row, making it possible to rollback transactions if the database supports it (e.g., in databases using transaction control). This makes DELETE particularly useful for scenarios where precision and rollback capabilities are required. Explanation of Incorrect Options: A) DROP : The DROP command is used to completely remove a table or database, including its structure. It is not selective and deletes the entire object. B) TRUNCATE : While TRUNCATE removes all rows from a table, it does not allow selective deletion. Furthermore, TRUNCATE is faster but does not log individual row deletions, making rollback impossible in most cases. D) REMOVE : This is not a valid SQL command. E) UPDATE : The UPDATE command is used to modify existing data, not to delete it.
How many scientists have been jointly awarded the Nobel Prize for Physics in the year 2023?
Reliance Jio announced that it will be landing a multi-terabit India-Asia-Xpress (IAX) undersea cable system in _________ to directly connect the countr...
Consider the following statements about Garba dance:Â
1.   Recently, Garba has been inscribed in the Representative List of Intangible Cultu...
Recently, Central Intelligence Agency has appointed whom as its chief technology officer?
Where is the newly established Center for Generative AI, Shrijan, located?
Who among the following assumed charge as the new Election Commissioner (EC) of India?
In December 2021, Prime Minister Narendra Modi has been conferred with the highest civilian award of __________, Ngadag Pel gi Khorlo, on the occasion o...
What was Vincent Keymer’s final score at the Quantbox Chennai Grand Masters 2025?
Which of the following statements is/are NOT true with respect to the shrinkage of the NBFC loans in the urban areas according to the data provided by t...
Chilikalake has become the single largest habitat of Irrawady Dolphins in the world. Chilika lake is in the state of: