What Is Constraint
What Is Constraint
ProgrammingAdivces.com MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
Copyright© 2023 Mohammed Abu-Hadhoud
ProgrammingAdivces.com MBA, PMOC, PgMP®, PMP®, PMI-RMP®, CM, ITILF, MCPD, MCSD
26+ years of experience
What is Constraint?
Primary Key
Employees Table
ID FirstName LastName Gender Birthdate Salary DepartmentID
Primary Key
1 U@s#5#Z|9E Abu‐Hadhoud M 6/11/1977 ‐400 1
1 IT Amman
5 Fadi Khalil M 6/6/1980 1400 4
2 Finance Amman
6 Maha Majed M 7/7/2001 300 3
3 HR UAE
7 Omar Ali M 6/6/1977 2000 1
4 Marketing Qatar
8 Huda Omar F 4/2/1990 1000 5
Foreign Key
• By using constraints, you can help ensure that your data is accurate,
consistent, and easy to manage.
3.Unique Constraint: This constraint ensures that the data in a column or set of
columns is unique across all rows in the table. This constraint helps to enforce
data integrity and prevent duplicate values from being inserted into the table.
5. Check Constraint: This constraint ensures that the data in a column or set
of columns meets a specified condition. This constraint helps to enforce data
integrity and prevent invalid data from being inserted into the table.
Primary Key is Unique but it does not allow NULL while Unique allows NULL.