โ† All SQL Flashcard Decks

Data Definition Language (DDL) Flashcards

7 cards from real SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Data Definition Language (DDL) flashcards as text
  1. Which DDL command removes an entire table including its structure and all data?

    Answer: DROP TABLE

    DROP TABLE deletes the table definition along with all its data and indexes.

  2. What is the key difference between TRUNCATE and DELETE?

    Answer: TRUNCATE cannot be filtered with WHERE and resets storage

    TRUNCATE removes all rows without a WHERE clause and generally resets the table more efficiently than DELETE.

  3. Which command adds a new column to an existing table?

    Answer: ALTER TABLE ... ADD COLUMN

    ALTER TABLE with ADD COLUMN modifies an existing table's structure by adding a column.

  4. Why is TRUNCATE classified as DDL rather than DML?

    Answer: It operates at the table-structure level and is not transaction-logged per row

    TRUNCATE deallocates data pages at the structural level rather than logging individual row deletions, so it is treated as DDL.

  5. Which statement renames an existing database object in standard SQL?

    Answer: RENAME TABLE / ALTER TABLE ... RENAME

    Renaming is done via ALTER TABLE ... RENAME (or RENAME TABLE in some dialects), both DDL operations.

  6. What does the CREATE INDEX statement accomplish?

    Answer: Creates a structure to speed up data retrieval on specified columns

    CREATE INDEX builds a data structure that improves the speed of queries filtering or sorting on the indexed columns.

  7. After issuing a DROP COLUMN with ALTER TABLE, what happens to that column's data?

    Answer: It is permanently removed

    Dropping a column permanently deletes the column and all its data from the table.