Given the following relation schemas, instances, primary and foreign key constraints, list all constraint violations.
R(A,D) S(A,B,C) S.A is a foreign key to R.A. C and D have string domains. A and B have integer domains.
|
|
1)
PRIMARY KEY - A combination of a NOT NULL and UNIQUE. Uniquely identifies each row in a table
NOT NULL - Ensures that a column cannot have a NULL value
Above table violates Primary key constraint where A is the primary key of R. And R.A has a null value which violates the primary key constrain. Also, it violates NOT NULL Constraint.
2. Domain Constraint
Table S, R violates domain constraint. In the description, it is given that C and D have string domains, A and B have integer domains. But in R.A we have X which is not an integer, R.D has integers which is not a string, S.B has "aa" which is not an integer.
Get Answers For Free
Most questions answered within 1 hours.