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.
564.932 + 849.029 β 425.08 = 612.095 + ?
999.99 + 99.99 + 99= ?
A sum of βΉ60,000 is invested at a compound interest rate of 'x%' per annum, compounded annually, and grows to βΉ75,264 in 2 ye...
What approximate value will come in place of the question mark (?) in the following question? (Note: You are not expected to calculate the exact value.)...
³√? × 33.97 + 59.99 × 28.9 – 48.98 × 21.42 = 1085.344
1279.98 Γ· 40.48 Γ 10.12 = ? Γ 2.16
(124.901) Γ (11.93) + 219.95 = ? + 114.891 Γ 13.90
What approximate value will come in place of the question mark (?) in the following question? (Note: You are not expected to calculate the exact value.)...