Data Definition Language (DDL)

📝 Data Definition Language (DDL)

Total Questions: 7
Click an answer to select it, then click "Check Answers" to see your results.
Question 1

Which constraint automatically generates sequential values for a column, typically used for IDs?

A.

A) **AUTO_INCREMENT**

B.

B) UNIQUE

C.

C) DEFAULT

D.

D) CHECK

Question 2

What is stored in the **data dictionary** of a database?

A.

A) Actual data rows from tables

B.

B) Query results from SELECT statements

C.

C) Table definitions including columns, data types, and constraints

D.

D) Temporary data during transactions

Question 3

What does the **data dictionary** store regarding inter-table relationships?

A.

A) Actual row values

B.

B) Foreign key definitions

C.

C) Inserted data rows

D.

D) Query execution plans

Question 4

What is the primary purpose of the **ALTER TABLE** command?

A.

A) To delete a table

B.

B) To modify an existing table structure

C.

C) To insert data into a table

D.

D) To query data from a table

Question 5

You need to rename the **Employees** table to **Staff**. Which statement accomplishes this?

A.

A) ALTER TABLE Employees RENAME TO Staff;

B.

B) RENAME TABLE Employees TO Staff;

C.

C) ALTER TABLE Employees CHANGE TO Staff;

D.

D) UPDATE TABLE Employees SET name = Staff;

Question 6

Which DDL command is used to remove all rows from a table while preserving its structure?

A.

A) DROP TABLE

B.

B) DELETE FROM

C.

C) TRUNCATE TABLE

D.

D) ALTER TABLE

Question 7

Which SQL statement is used to create a new table?

A.

A) ALTER TABLE

B.

B) DROP TABLE

C.

C) CREATE TABLE

D.

D) TRUNCATE TABLE

Quiz Complete!

Score: 0 / 7