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.
Which report indicates that India’s CO₂ emissions will increase by 4.6% in 2024?
How many additional rural and urban households will be provided assistance for house construction under the Pradhan Mantri Awas Yojana (PMAY)?
If a Panchayat is dissolved, elections must be held within how many months?
Reserve Bank of India has launched the Inflation Expectations Survey of Households (IESH) which will provide useful inputs for?
What was India’s forex reserve as of the week ending February 28, 2025?
What is the objective of the "100 Microsites Project" launched by the National Health Authority (NHA) under the Ayushman Bharat Digital Mission (ABDM)?
Which Indian payment system led to India contributing 48.5% of the global real-time payments in FY 2025?
What is the stake of NIRL in the Joint Venture with MAHAPREIT?
How many Zonal Cultural Centres (ZCCs) has the Government of India set up to recognize and promote cultural industries?
Which Indian cricketer became the first to complete 7500 runs in IPL history in 2024?