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.
4 is related to 70 following a certain logic. Following the same logic, 8 is related to 518. To which ofthe following is 6 related, following the same l...
How straight lines are there in the given picture?
There are seven persons Anmol, Fuzail, Raju, Enamul, Dinesh, Badal and Chaman each of different professions Lawyer, Judge, Police, Professor, Architect,...
Three statements are given, followed by three conclusions numbered I, II and III.
Assuming the statements to be true, even if they seem to be a...
In a classroom, there are 5 rows, and 5 children Akshay, Vineet, Sujeet, Guddu and Mangal are seated one behind the other in 5 separate rows as follows:...
A dice with six faces is marked with six numbers 1, 2, 3, 4, 5, 6. This dice is rolled two times and two positions are shown as:
In a family, there are six members named K, L, M, N, O and P. N's age is three times the age of L. The age of O is equal to the total age of L and M. P'...
In a certain language, ADDICT is written as DDATCI. How will JAGUAR be written?
A, B, C, D, J, K, L and M are sitting around a square table facing the centre of the table. Four of them are sitting at either of the corners while the ...
A paper has been folded and cut as shown. Figure (X) shows the manner in which the folded paper has been cut. Choose a figure which would most closely r...