Recall & Review
beginner
What is a constraint in a database?
A constraint is a rule applied to a database table to ensure data integrity and correctness. It restricts the type of data that can be inserted or updated.
Click to reveal answer
beginner
Why do constraints matter in databases?
Constraints help keep data accurate, consistent, and reliable by preventing invalid or duplicate data from being stored.
Click to reveal answer
beginner
Name two common types of constraints in SQL.
Two common constraints are PRIMARY KEY, which uniquely identifies each row, and NOT NULL, which ensures a column cannot have null values.
Click to reveal answer
intermediate
How do constraints help when multiple people use the same database?
Constraints prevent users from entering wrong or conflicting data, so everyone sees accurate and consistent information.
Click to reveal answer
beginner
What might happen if a database has no constraints?
Without constraints, the database could have duplicate, missing, or incorrect data, making it unreliable and hard to trust.
Click to reveal answer
What does a PRIMARY KEY constraint do?
✗ Incorrect
A PRIMARY KEY uniquely identifies each row and cannot be null.
Which constraint prevents a column from having empty values?
✗ Incorrect
NOT NULL ensures that a column must have a value and cannot be left empty.
Why are constraints important when many users access the same database?
✗ Incorrect
Constraints keep data accurate and consistent even with multiple users.
What could happen if a database has no constraints?
✗ Incorrect
Without constraints, invalid or duplicate data can be stored.
Which constraint ensures values in a column are unique but can be null?
✗ Incorrect
UNIQUE constraint allows unique values and can accept nulls.
Explain why constraints are important for maintaining data quality in a database.
Think about what happens if wrong data is allowed.
You got /4 concepts.
Describe how constraints help when multiple users work with the same database.
Consider how rules keep data trustworthy for everyone.
You got /4 concepts.