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.
Auxin is:
Sodium deficiency in cow symptom and causes what?
Drainage method used in high water table areas under the surface.
Which of the following is a key agronomic practice in Integrated Pest Management (IPM) aimed at preventing pest outbreaks?
Which type of clay mineral chlorite is
Β A solution contains 1/ 10000 moles/I H+ ions. What is the concentration of hydroxyl ions in this solution?
Which is the major objective of Integrated Farming System?
In majority of the cases soil pH for optimal plant growth is
_____ are the non-nutritive substances usually added to basal feed in small quantity for the fortification in order to improve feed efficiency and produ...
Why do some plants exhibit protandry?