Constraints
Question 1 |
Let R(a, b, c) and S(d, e, f) be two relations in which d is the foreign key of S that refers to the primary key of R. Consider the following four operations R and S.
I. Insert into R
II. Insert into S
III. Delete from R
IV. Delete from S
Which of the following can cause a violation of the referential integrity constraint above?
I. Insert into R
II. Insert into S
III. Delete from R
IV. Delete from S
Which of the following can cause a violation of the referential integrity constraint above?
Both I and IV | |
Both II and III | |
All of these | |
None of these |
Question 1 Explanation:

Question 2 |
In a database system, the domain integrity is not defined by:
The data type and the length | |
The NULL value rejection | |
The allowable values, through techniques like constraints or rules | |
Default value |
Question 2 Explanation:
A domain defines the possible values of an attribute. Domain Integrity rules govern these values.
In a database system, the domain integrity is defined by:
1.The data type and the length
2.The NULL value acceptance
3.The allowable values, through techniques like constraints or rules
4.The default value
In a database system, the domain integrity is defined by:
1.The data type and the length
2.The NULL value acceptance
3.The allowable values, through techniques like constraints or rules
4.The default value
Question 3 |
The employee salary should not be greater than Rs.2000. This is
integrity constraint | |
referential constraint | |
Over-defined constraint | |
feasible constraint |
Question 3 Explanation:
● Integrity constraints are used to ensure accuracy and consistency of data in a relational database. Data integrity is handled in a relational database through the concept of referential integrity.
● Integrity constraints are primary key constraints,Foreign Key Constraints, Check Constraints and so on.
● Check (CHK) constraints can be utilized to check the validity of data entered into particular table columns. Check constraints are used to provide back-end database edits, although edits are commonly found in the front-end application as well.
● A referential integrity constraint is specified between two tables.
● In the Referential integrity constraints, if a foreign key in Table 1 refers to the Primary Key of Table 2, then every value of the Foreign Key in Table 1 must be null or be available in Table 2.
● Integrity constraints are primary key constraints,Foreign Key Constraints, Check Constraints and so on.
● Check (CHK) constraints can be utilized to check the validity of data entered into particular table columns. Check constraints are used to provide back-end database edits, although edits are commonly found in the front-end application as well.
● A referential integrity constraint is specified between two tables.
● In the Referential integrity constraints, if a foreign key in Table 1 refers to the Primary Key of Table 2, then every value of the Foreign Key in Table 1 must be null or be available in Table 2.
Question 4 |
Referential integrity constraints works on the concept of:
Secondary key
| |
Super key
| |
Foreign key
| |
Primary key
|
Question 4 Explanation:
Referential integrity constraints works on the concept of foreign key.
Referential Integrity Rules
→ A referential integrity rule is a rule defined on a key (a column or set of columns) in one table that guarantees that the values in that key match the values in a key in a related table (the referenced value).
→ Referential integrity also includes the rules that dictate what types of data manipulation are allowed on referenced values and how these actions affect dependent values.
The rules associated with referential integrity are:
1. Restrict: Disallows the update or deletion of referenced data.
2. Set to Null: When referenced data is updated or deleted, all associated dependent data is set to NULL.
3. Set to Default: When referenced data is updated or deleted, all associated dependent data is set to a default value.
4. Cascade: When referenced data is updated, all associated dependent data is correspondingly updated. When a referenced row is deleted, all associated dependent rows are deleted.
5. No Action: Disallows the update or deletion of referenced data. This differs from RESTRICT in that it is checked at the end of the statement, or at the end of the transaction if the constraint is deferred.
Referential Integrity Rules
→ A referential integrity rule is a rule defined on a key (a column or set of columns) in one table that guarantees that the values in that key match the values in a key in a related table (the referenced value).
→ Referential integrity also includes the rules that dictate what types of data manipulation are allowed on referenced values and how these actions affect dependent values.
The rules associated with referential integrity are:
1. Restrict: Disallows the update or deletion of referenced data.
2. Set to Null: When referenced data is updated or deleted, all associated dependent data is set to NULL.
3. Set to Default: When referenced data is updated or deleted, all associated dependent data is set to a default value.
4. Cascade: When referenced data is updated, all associated dependent data is correspondingly updated. When a referenced row is deleted, all associated dependent rows are deleted.
5. No Action: Disallows the update or deletion of referenced data. This differs from RESTRICT in that it is checked at the end of the statement, or at the end of the transaction if the constraint is deferred.
There are 4 questions to complete.
