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?
A
Both I and IV
B
Both II and III
C
All of these
D
None of these
       Database-Management-System       Constraints       ISRO-2016
Question 1 Explanation: 
Question 2
The employee salary should not be greater than Rs.2000. This is
A
integrity constraint
B
referential constraint
C
Over-defined constraint
D
feasible constraint
       Database-Management-System       Constraints       Nielit Scientist-B CS 2016 march
Question 2 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.
Question 3
____key must satisfy referential integrity in a relation, while__key must satisfy entity integrity.
A
Candidate, primary
B
Foreign,primary
C
Primary,foreign
D
Foreign,superkey
       Database-Management-System       Constraints       KVS 22-12-2018 Part-B
Question 3 Explanation: 
→ To ensure entity integrity, it is required that every table have a primary key.
→ Neither the primary key nor any part of it can contain null values. This is because null values for the primary key mean we cannot identify some rows.
→ Referential integrity requires that a foreign key must have a matching primary key or it must be null. This constraint is specified between two tables (parent and child); it maintains the correspondence between rows in these tables. It means the reference from a row in one table to another table must be valid.
Question 4

Referential integrity constraints works on the concept of:

A
Secondary key
B
Super key
C
Foreign key
D
Primary key
       Database-Management-System       Constraints       JT(IT) 2018 PART-B Computer Science
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.
Question 5
Consider the database table "persons" having Person_ID as the primary key.

what are the violated by the above table?
A
Relationship integrity
B
Referential integrity only
C
Entity and domain integrities
D
Referential and domain integrities
       Database-Management-System       Constraints       KVS DEC-2017
Question 5 Explanation: 
→ Entity integrity ensures that each row of a table is uniquely identified, so that it can be retrieved separately if necessary. The value set of a primary key is unique; no two values may be the same.
→ The rules of entity integrity state that no primary key can be null and that no change can render the primary key null. These rules guarantee that every row of a table is accessible, whether you're retrieving data or modifying it. You can retrieve each row separately by specifying the value of a primary key.
→ Domain integrity ensures that all the data items in a column fall within a defined set of valid values. Each column in a table has a defined set of values. When you limit the value assigned to an instance of that column (an attribute), you are enforcing domain integrity.
→ Domain integrity enforcement can be as simple as choosing the correct data type and length for a column.
Question 6
Real life constraints on the relational schema can be specified by
A
Functional dependency
B
Domain Integrity rules
C
Referential Integrity rules
D
Entity Integrity rules
       Database-Management-System       Constraints       KVS 30-12-2018 Part B
Question 6 Explanation: 
→A relation is nothing but a table of values. Every row in the table represents a collection of related data values.
→These rows in the table denote a real-world entity or relationship.
→Functional dependency is a relationship that exists when one attribute uniquely determines another attribute.
Question 7
Integrity constraints ensure that changes made to the database by authorized users do not result into loss of data consistency. Which of the following statement(s) is (are) true w.r.t. the examples of integrity constraints ?
(A) An instructor Id. No. cannot be null, provided Instructor Id No. being primary key.
(B) No two citizens have same Adhar-Id.
(C) Budget of a company must be zero.
A
(A), (B) and (C) are true.
B
(A) false, (B) and (C) are true.
C
(A) and (B) are true; (C) false.
D
(A), (B) and (C) are false
       Database-Management-System       Constraints       UGC NET CS 2017 Jan -paper-2
Question 7 Explanation: 
Primary key, every table have at least one attribute as “primary key”. No primary key should ever have null values.
Statement-1: TRUE: Here, instructor ID is primary key. So, they mentioned it is not null.
Statement-2: TRUE: No two citizens have same Adhar-Id. It is clear example of primary key.
Statement-3: FALSE: Budget of a company must be zero. It is violated constraint of “not null”. Because entity integrity constraints should not accept not null but referential integrity constraints will accept null value.
Question 8
Data which improves the performance and accessibility of the database are called:
A
Indexes
B
User Data
C
Application Metadata
D
Data Dictionary
       Database-Management-System       Constraints       UGC NET CS 2015 Dec- paper-2
Question 8 Explanation: 
→ An index is a data which improves the performance and accessibility of the database. An index is a copy of selected columns of data from a table that can be searched very efficiently that also includes a low-level disk block address or direct link to the complete row of data it was copied from.
→ To create the application metadata XML file containing details of all the Business Process Server applications that need to be packaged and published.
→ A data dictionary (or) metadata repository is a "centralized repository of information about data such as meaning, relationships to other data, origin, usage, and format".
Question 9
Let R1(a,b,c) and R2(x,y,z) be two relations in which a is the foreign key of R1 that refers to the primary key of R2 . Consider following four options.
(a) Insert into R1
(b) Insert into R2
(c) Delete from R1
(d) Delete from R2
Which of the following is correct about the referential integrity constraint with respect to above ?
A
Operations (a) and (b) will cause violation.
B
Operations (b) and (c) will cause violation.
C
Operations (c) and (d) will cause violation.
D
Operations (d) and (a) will cause violation.
       Database-Management-System       Constraints       UGC NET CS 2018 JUNE Paper-2
Question 9 Explanation: 
In case of referential integrity Insertion into table containing the foreign key and Deletion from table whose Primary key is referred can cause the violation.
Question 10
The student marks should not be greater than 100. This is
A
Integrity constraint
B
Referential constraint
C
Over-defined constraint
D
Feasible constraint
       Database-Management-System       Constraints       UGC NET CS 2013 Dec-paper-2
Question 10 Explanation: 
Integrity constraint have some rules:
1. Every table have at least one attribute as primary key
2. No prime attribute should ever have null value.
The above example given condition but it is not referring any table. So, it is not referential constraints. Other two are not relevant to this question.
So, Option-A is correct answer.
Question 11
Which of the following key constraints is required for functioning of foreign key in the context of relational database?
A
Unique key
B
Primary key
C
candidate key
D
Check key
       Database-Management-System       Constraints       UGC NET June-2019 CS Paper-2
Question 11 Explanation: 
Foreign key is a key whose values depends on the primary key of a relation. So for the functioning of a foreign key in the context of relational database we need a primary key.
Question 12
Following table has two attributes Employee_id and Manager_id, where Employee_id is a primary key and manager_id is a foreign key referencing Employee_id with on-delete cascade:



On deleting the table (20,40), the set of other tuples that must be deleted to maintain the referential integrity of table is
A
(30,35) only
B
(30,35) and (35,20) only
C
(35,20) only
D
(40,45) and (25,40) only
       Database-Management-System       Constraints       UGC NET June-2019 CS Paper-2
Question 12 Explanation: 
If (20, 40) is deleted then the entry in manager_id containing 20 value will violate the referential integrity constraint so entry (35,20) is deleted because of deletion of (20,40).
Similarly entry (30,35) is deleted because of the deletion of entry (35,20).
After deletion of entry (30,35) referential integrity is maintained in given relation so no further deletion are made.
Hence correct option is option(2).
Question 13
Which of the following constraints enforces that the value of the primary key cannot be Null?
A
Key Constraint
B
Foreign key constraint
C
Entity integrity constraint
D
Domain constraint
       Database-Management-System       Constraints       CIL Part - B
Question 13 Explanation: 
The entity integrity constraint states that primary key value can't be null. This is because the primary key value is used to identify individual rows in relation and if the primary key has a null value, then we can't identify those rows.
Question 14
Which of the following is used to specify whether the existence of an entity depends on its being related to another entity via the relationship type?
A
Entity integrity constraint
B
Foreign key constraint
C
Cardinality ratio
D
Participation constraint
       Database-Management-System       Constraints       CIL Part - B
Question 15
Which of the following statements about “total specialization” constraint is TRUE?
A
Every entity in the subclass must be a member of the superclass.
B
Every entity in the superclass must be a member of at least one subclass in the specialization.
C
At least one entity in the superclass must be a member of at least one subclass in the specialization.
D
Every entity in the superclass must be a member of all subclass in the specialization.
       Database-Management-System       Constraints       CIL Part - B
Question 15 Explanation: 
→The total specialization rule demands that every entity in the superclass belong to some subclass. →The partial specialization rule allows an entity to not belong to any of the subclasses
There are 15 questions to complete.
PHP Code Snippets Powered By : XYZScripts.com
error: Content is protected !!