Database Management System (DBMS) / ER Model

Attribute Consistency Constraints

πŸ§‘β€πŸŽ“ What is Attribute Consistency Constraints?

Attribute Consistency Constraints are rules in a DBMS that ensure the values of attributes are consistent, valid, and meaningful according to their defined data type, format, range, and semantics.

These constraints help maintain the integrity and accuracy of the data in the database.


πŸ§ͺ Types of Attribute Consistency Constraints:

Constraint Type

Description

Example

Type Constraint

Value must match data type

Age must be an integer

Domain Constraint

Value must fall within a predefined range or set

Marks between 0 to 100

Format Constraint

Value must follow a specific pattern/structure

Email must include @ and .com

Uniqueness Constraint

No two entities can have the same value

Student_ID must be unique

Not Null Constraint

Attribute cannot be left empty (null)

Name must always be filled

Default Constraint

A default value is automatically assigned if none is given

Status defaults to "active"



πŸ–ΌοΈ In ER Model:

While ER diagrams don’t explicitly show these constraints, they are:

  • Applied during schema creation

  • Enforced at the database level (e.g., via SQL)


🎯 Why Are Attribute Consistency Constraints Important?

  • βœ… Ensure data quality

  • βœ… Prevent invalid entries

  • βœ… Avoid logical errors

  • βœ… Maintain data integrity


🧠 Summary:

πŸ”Ή Term

πŸ“– Description

Attribute Consistency Constraint

Rule to ensure attribute values are valid and meaningful

Applies To

Data type, range, format, uniqueness, nullability

Helps With

Data integrity, accuracy, and database reliability