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.
Citizenship is the relationship (A)/ among an individual and a state (B)/ in which the individual belongs, (C)/ and owes allowance to the state (D)/ an...
Select the most appropriate option to fill in the blank.
Today you may not ______ what you hear, but that is the truth and you have to accept it.
The centrally supported (A) hot meal programme in Government and Government-aided schools, covering (B) 11.8 crore children, will be supplemented (C) wi...
Choose the correct combination of grammatically incorrect sentences
I. Governance is still perceived to lag behind private sector management, ...
Officials also seized records pertaining to ₹1,050 crore expenditure for various projects and desilting work which was rewarded to only a few contrac...
Expensive oil could hit consumption and public investment and dent private investment (what is not a path) to a sustained revival.
The following sentence has a word bold. Read the sentence carefully and identify which part of speech the underlined word belongs to. Indicate your res...
Select the correctly punctuated sentence from the options below.
Choose the grammatically correct sentence.
...An example sentence with the Adverb Clause of Purpose is