What is DDL & DML ?

📝 What is DDL & DML ?

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

What is the purpose of the **PRIMARY KEY** constraint in a **CREATE TABLE** statement?

A.

A) To uniquely identify each row in the table

B.

B) To allow duplicate values in a column

C.

C) To link columns between unrelated tables

D.

D) To store variable-length strings

Question 2

Why is a junction table like EmployeeProjects necessary?

A.

A) To store department locations

B.

B) To handle one-to-one relationships

C.

C) To manage many-to-many relationships

D.

D) To define primary keys only

Question 3

What happens if a **foreign key** references a non-existent **primary key** in the parent table?

A.

A) The row is automatically inserted

B.

B) The insertion fails due to referential integrity

C.

C) Duplicates are allowed

D.

D) The primary key is created automatically

Question 4

What is the primary purpose of the **INSERT** statement in SQL?

A.

A) To retrieve data from a table

B.

B) To modify existing data in a table

C.

C) To add new rows to a table

D.

D) To remove rows from a table

Question 5

Which INSERT statement is valid when omitting column names?

A.

A) Values in random order

B.

B) Values matching exact table column sequence

C.

C) Only numeric values allowed

D.

D) NULL values in any position

Question 6

What happens when inserting NULL into a column defined as NOT NULL?

A.

A) Insertion succeeds with default value

B.

B) MySQL automatically converts to zero

C.

C) Insertion fails with an error

D.

A) Insertion succeeds with default value

Quiz Complete!

Score: 0 / 6