Database Constraints Business requirements are enforced by implementing database
ID: 3651365 • Letter: D
Question
Database ConstraintsBusiness requirements are enforced by implementing database constraints on tables and columns. The database constraints available include the following.
PRIMARY KEY
FOREIGN KEY or REFERENTIAL INTEGRITY
NOT NULL
UNIQUE
CHECK
Give a business requirement and the constraint that could be implemented to enforce it. Explain the constraint you choose, and give the SQL to implement the constraint in the database.
What are the long-term problems when these constraints are not implemented?
Explanation / Answer
A table named Employee - PRIMARY KEY - employee_id - It should be unique, and is used to identify the record. FOREIGN KEY or REFERENTIAL INTEGRITY - department_id, linked to department table as foreign key NOT NULL - employee_name - Each employee should have a name UNIQUE - employee_insurance_number - each employee has unique insurance CHECK - field 'employee_age' > 21. These checks are routinely implemented in database systems. Please rate !
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.