Question
Which of the following database operations is used to
remove all records from a table but not the table itself?Solution
The TRUNCATE operation in SQL is used to remove all rows from a table without affecting the table structure. Unlike the DELETE operation, which removes rows one at a time and can be rolled back if used with a transaction, TRUNCATE is a more efficient way to delete all records in a table because it does not generate individual row delete statements. TRUNCATE resets any identity columns and typically cannot be rolled back in most database management systems unless within a transaction. Option 1 (DELETE) removes rows from a table but allows for specific conditions (such as WHERE clauses) to filter which rows to delete. Unlike TRUNCATE, DELETE can be rolled back if wrapped in a transaction. Option 2 (DROP) removes the entire table from the database, including its structure, and is more drastic than TRUNCATE. Option 4 (REMOVE) is not a valid SQL operation. Option 5 (ALTER) is used to modify the structure of a table, such as adding or deleting columns, but it does not remove data from the table.
In what year were Particularly Vulnerable Tribal Groups first recognized by the Indian government?
Who has been named the next president of Marylebone Cricket Club ( MCC ) ?
Recently government launched 4th tranche of Bharat Bond ETF which will mature in ______.
Union Minister Nitin Gadkari has launched the Rs 5600 crore National Highway Project in which state?
Which segment is excluded from receiving subsidies under the revised FAME scheme for electric vehicles?
In Jan 2024, who was appointed as the Chairman and Managing Director (CMD) of Power Grid Corporation?
In India, who among the following is responsible for auditing all receipts and expenditure of the Union and State governments?
The term 'Digital Single Market Strategy' seen in the news refers to
Consider the following statements about National Transit Pass System (NTPS):
1. Recently, Union Minister for agriculture launched the NTP...
Which city under SBM Urban 2.0 successfully transformed its legacy landfill site into an ecological park?