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.
Which of the following is NOT one of the biases in decision making?
Decision making process first requires identification of problem. Which of the following types of problems can be considered here?
How does a cost-benefit analysis contribute to selecting the best solution?
The pre-dispositioning theory of decision making was given by ___________
Which of the following is not a characteristic of decision making?
Which of the following is not a feature of Decision-making process?
Leaders use specific and different styles when contemplating decisions. One such style is the directive decision making style. Which of the following is...
Which of the following style of decision-making focuses on long term?
Which of the following best describes a decision tree?
Which of the following technique of decision making is a process in which a group of individuals generate and state ideas, but in which the rules prohib...