Computer AwarenessHardIBPS SO IT Officer · SBI Clerk Mains

Which statement about DELETE and TRUNCATE in SQL is correct?

  1. A. TRUNCATE can remove selected rows with WHERE; DELETE always empties the whole table
  2. B. DELETE removes the table structure as well, while TRUNCATE keeps the structure
  3. C. DELETE can remove selected rows using WHERE; TRUNCATE empties the table but keeps its structure
  4. D. Both DELETE and TRUNCATE remove the table's structure along with all its data

Correct answer: C. DELETE can remove selected rows using WHERE; TRUNCATE empties the table but keeps its structure

DELETE is a DML command that may take a WHERE clause; TRUNCATE is a DDL command that removes all rows at once and keeps the table definition. Only DROP removes the structure.

हिंदी में

SQL में DELETE और TRUNCATE के बारे में कौन-सा कथन सही है?

  1. A. TRUNCATE WHERE से चुनी हुई पंक्तियाँ हटा सकता है; DELETE सदा पूरी तालिका खाली करता है
  2. B. DELETE तालिका की संरचना भी हटा देता है, जबकि TRUNCATE संरचना रखता है
  3. C. DELETE WHERE का प्रयोग करके चुनी हुई पंक्तियाँ हटा सकता है; TRUNCATE तालिका खाली करता है पर उसकी संरचना रखता है
  4. D. DELETE और TRUNCATE दोनों तालिका की संरचना को उसके सारे डेटा के साथ हटा देते हैं

उत्तर: C. DELETE एक DML कमांड है जिसमें WHERE क्लॉज़ हो सकता है; TRUNCATE एक DDL कमांड है जो सभी पंक्तियाँ एक साथ हटाता है और तालिका की परिभाषा रखता है। केवल DROP संरचना हटाता है।

More Computer Awareness questions

Exams that ask this topic