/  MySQL Constraints and Indexes – Quiz

This Quiz contains totally 25 Questions each carry 1 point for you.

1. Which constraint ensures that a column cannot have a NULL value? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

2. Which constraint ensures that all values in a column must be unique?
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

3. Which constraint uniquely identifies a row in a table? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

4. Which constraint establishes a relationship between two tables based on a column's values? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

5. Which constraint is used to enforce referential integrity between tables? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

6. Which constraint is used to specify that a column's values must be unique and not NULL? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

7. Which constraint is automatically created when a column is defined as a primary key? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

8. Which constraint is used to specify that a column can contain NULL values, but if it contains a value, it must be unique? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

9. Which constraint is used to create a relationship between a primary key column and a foreign key column?
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

10. Which constraint is used to ensure that values in a column are always unique and not NULL, even if the column is not the primary key? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

11. Which constraint is used to specify that a column must have a value and cannot be left empty?
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

12. Which constraint is used to define a column or a set of columns that uniquely identify a row in a table? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

13. Which constraint is used to ensure that a column's values refer to existing values in another table?

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

14. Which constraint is used to speed up the retrieval of data from a table by creating a separate data structure? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

15. Which constraint is used to enforce the integrity of the data stored in a column by ensuring that only unique values are allowed?
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

16. Which constraint is used to ensure that a column's values are unique within a table but allows NULL values? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

17. Which constraint is used to create an index on a column or a set of columns? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

18. Which constraint is used to establish a relationship between tables by referencing the primary key column of another table? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

19. Which constraint is used to enforce the uniqueness of a column's values within a table? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

20. Which constraint is used to ensure that a column cannot have duplicate values and must contain a value for each row? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

21. Which constraint is used to specify that a column must contain a value and cannot be left empty? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

22. Which constraint is used to define a column or a set of columns that uniquely identifies a row and is used to create relationships with other tables? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

23. Which constraint is used to ensure data integrity and enforce referential integrity between tables? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

24. Which constraint is used to create an index on a column or a set of columns to optimize query performance? 

 

 

 
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

25. Which constraint is used to ensure that a column's values are unique within a table, but NULL values are allowed?
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

Ignore & go to results

MySQL Constraints and Indexes – Quiz

You got %%score%% of %%total%% right

%%description%%

%%description%%

Loading...