Document 5
Document 5
One or more columns of a composite primary (a primary key that comprises of more than one attribute)
key can be allowed to have NULL values. TRUE / FALSE?
TRUE
FALSE
2. A foreign key of any table must refer to the primary key of its base table. TRUE/FALSE
TRUE
FALSE
3. The value of a foreign key attribute A of table R that refers to table S cannot be NULL if which of the
following holds?
If attribute A is part of a primary key attribute in R
If attribute A refers the primary key of S
If attribute A is UNIQUE
If either a or b or both holds
4. An attribute must contain only values consistent with the defined data format of that particular
attribute is called
Entity integrity
Referential integrity
User-defined integrity
Column integrity
5. The __________ property ensures that any instance of the original relation can be identified from
corresponding instances of the smaller relations.
Lossless-join
Lossy-join
Both a and b
None of the above
8. The determinant of a functional dependency refers to the attribute, or group of attributes, on the left-
hand side of the arrow.
TRUE
FALSE
9. Assume a set of functional dependencies F = {Regno Name --> Gender, Regno --> Department, Regno
--> Gender, Name --> Branch}. Here, Regno Name --> Gender is,
Gender is fully funcionally dependent on Regno and Name
Gender is partially funcionally dependent on Regno and Name
Name and branch together form the primary key
None of the above
10. _____________ ensure that a value that appears in one relation for a given set of attributes also
appears for a certain set of attributes in another relation.
Referential integrity constraints
Weak entity sets
Entity integrity constraints
None of the above
1. __________ refers to a attribute or group of attributes mentioned in the left hand side of the arrow in a
FD.
Discriminator
Determinant
Multivalued attribute
All of the above
2. In a functional dependency X --> Y, if Y is functionally dependent on X, but not on X's proper subsets,
then we would call the functional dependency as
Full Functional Dependency
Partial Functional Dependency
Multivalued Functional Dependency
None of the above
6. Consider F1 and F2 as two sets of functional dependencies. If every functional dependency in F2 can
be inferred from the functional dependencies of F1 using inference rules, then F1 is _________ of F2
Cover Set
Closure Set
Minimal Set
None of the above
7. If X --> Y is a functional dependency and X and Y are sets of attributes, what is the relationship
between X and Y?
One-to-Many
Many-to-One
One-to-One
Many-to-Many
9. To check whether X (a set of one or more attributes) is a candidate key of relation R, we need to find
______ of X.
Canonical Cover
Closure
Minimal Cover
None of the above
10. (a) If every functional dependency in F1 can be inferred from F2 on application of inference rules, and
(b) removal of any one attribute from any functional dependency of F2 violates (a).
Then F2 is called ______ for F1.
Minimal Cover
Canonical Cover
Both Minimal and Canonical Cover
None of the above
1. Which of the following of a relation schema R, fully functionally determines all attributes of R?
Primary Key
Candidate Key
Both Primary and Candidate Key
Neither Primary Key nor Candidate Key
2. Any attribute that is proper subset of a primary key of a relation schema is called as
Descriptor attribute
Composite attribute
Prime attribute
Atomic attribute
4. The words Canonical cover and Minimal cover meant the same.
TRUE
FALSE
5. An attribute of relation schema R, that is not a part of Primary key is always considered as Non-Prime
attribute
TRUE
FALSE
6. Assume the candidate keys for a relation schema R(A,B,C,D,E) as {A,B}, {A,C}, {C,D}, and {A,B} is
chosen as the Primary key for R. Which of the following is true?
A is non-key attribute
C is non-prime attribute
E is key attribute
None of the above
7. If DNo --> {DName, DLoc}, which of the following Armstrong's axioms allow the functional dependency
DNo --> DName?
Reflexivity rule
Augmentation rule
Decomposition rule
Union rule
8. Assume that a bank relates every customer with the home branch in which the customer maintains an
account. Which of the following is true?
Branch --> Branch
Customer --> Branch
Customer --> Customer
All of the above
10. In a relational schema R(A, B, C) with functional dependencies A --> B, B --> C, and A --> C, which of
the functional dependencies is redundant?
A --> C
A --> B
B --> C
None of the above
1. Functional dependency analysis helps in the normalization of a relational schema. TRUE / FALSE?
TRUE
FALSE
2. Normalization attempts to reduce redundant information that are stored as part of a relation.
TRUE/FALSE?
TRUE
FALSE
3. Redundancy is at the root of insertion and deletion anomalies in a relational database. TRUE/FALSE?
TRUE
FALSE
4. A null value has exactly one interpretation, ie., one meaning. TRUE/FALSE?
TRUE
FALSE
5. A functional dependency is a relationship between an attribute "Y" and a determinant (1 or more other
attributes) such that for a given value of a determinant the value of the attribute Y is uniquely defined.
TRUE/FALSE?
TRUE
FALSE
6. Functional dependencies can be found out algorithmically (automatically) by analysis of the relation. No
semantic analysis is required. TRUE/FALSE?
TRUE
FALSE
7. In practical terms, we want non-key attributes to be functionally dependent on the primary key in any
relation. TRUE/FALSE?
TRUE
FALSE
8. Transitivity of functional dependencies means that if a →b and a→c then c→b. TRUE/FALSE?
TRUE
FALSE
9. Decomposition of functional dependencies would mean that if a→bc then a→b and a→c.
TRUE/FALSE?
TRUE
FALSE
B → CD
B → CD is not true because the only functional dependency that has B on left hand side is B → E. now neither E nor B
is not on the left hand side of any of the other functional dependencies.
A→E
A → E can be derived through the functional dependencies A → B and B → E. [ Transitivity rule ]
CD → EF
CD → EF can be derived through the functional dependencies CD → E and CD → F. [ Union rule]
AD → F
AD → F can be derived through the functional dependencies A → C and CD → F. [ Pseudo-transitivity rule]
(a) ABCE → D
(b) ABCD → E
(c) BCE → A
(d) None of the above
13. Let us consider a relation R with the schema R (A, B, C, D). If we expect
R to be in BCNF, then which of the following sets of functional
dependencies must hold in R?
(a) A → C, A → D, AD → C, B → A
(b) C → B, C → D, A → C, D → A
(c) C → D, CD → A, BD → A, AB → C
(d) A → D, C → A, AC → B, D → B
Answer:
(b) C → B, C → D, A → C, D → A
1. For a relation R, we are given that the domains of all attributes of R are indivisible. With this
information, we can say the relation R is in
1 NF
2 NF
3 NF
BCNF
2. In a table with the schema STU(STUNO, STUNAME, ADDRESS, COURSENO, COURSENAME) and
with the functional dependencies, STUNO --> STUNAME ADDRESS, COURSENO --> COURSENAME,
STUNO COURSENO --> STUNAME ADDRESS COURSENAME, which of the following anomalies would
present?
Insetion Anomaly
Deletion Anomaly
Update Anomaly
All of the above
3. A relation which has only atomic attributes and every non-key attribute fully functionally dependent on
candidate keys is said to be in
1 NF
2 NF
3 NF
BCNF
6. If you have removed repeated groups of values from a relation and also removed the partial key
dependencies, then we would say that the given relation is in
1 NF
2 NF
3 NF
BCNF
7. Assume a table with the schema STU(STUNO, STUNAME, ADDRESS, PINCODE) and with the
functional dependencies, STUNO --> STUNAME ADDRESS PINCODE, PINCODE --> ADDRESS. Is this
relation is in 2 NF?
YES
NO
9. Assume a table with the schema STU(STUNO, STUNAME, ADDRESS, PINCODE) and with the
functional dependencies, STUNO --> STUNAME ADDRESS PINCODE, PINCODE --> ADDRESS. Is this
relation is in 3 NF?
YES
NO
10. Assume a table with the schema STU(STUNO, STUNAME, ADDRESS, COURSENO,
COURSENAME) and with the functional dependencies, STUNO --> STUNAME ADDRESS, COURSENO
--> COURSENAME, STUNO COURSENO --> STUNAME ADDRESS COURSENAME with no transitive
dependency. The relation STU is in _______ NF?
1 NF
2 NF
3 NF
BCNF
1. Assume that a relation R has the following properties. What is the normal form of
R?
No multi-valued attributes
No partial key dependencies
(a) First Normal Form (b) Second Normal Form
(c) Third Normal Form (d) Boyce-Codd Normal Form
2. Assume that a relation R has the following properties. What is the normal form of
R?
Has no partial key dependencies
Has multi-valued attributes
(a) First Normal Form (b) Second Normal Form
(c) Third Normal Form (d) None of the above
3. All functional dependencies must _________
(a) have attributes of the same table (b) have a single attribute on its LHS
(c) have a single attribute on its RHS (d) All of the above
4. Which one of the following is always a single-valued attribute?
(a) a person’s phone number (b) a person’s address
(c) a person’s age (d) a person’s car
2. The rule that a value of a foreign key must appear as a value of some specific table
is
called a ______
(a) Referential integrity (b) Entity integrity
(c) Unique integrity (d) Dependent integrity
Why? – For referential integrity to hold in a relational database, any field in a table
that is declared a foreign key can contain either a null value, or only values from a
parent table’s referenced columns (primary key or candidate keys). In other words,
when a foreign key value is used it must reference a valid, existing primary key in the
parent table.
3. For a relation R with schema R (A, B, C, D), let us assume that A is the primary key.
And, R consists of the set of functional dependencies F = {A → B, A → C, AB → C,
C → D}. Which of the following would violate the 3NF rule?
(a) AB → C (b) C →D
(c) A → BCD (d) None of the above
Why? – 3NF – “no non-key attribute should depend on another non-key attribute”
(i.e, no Transitive dependency). In this question, a non-key attribute D is fully
functionally dependent on another non-key attribute C. Hence, it violates 3NF.
4. For a relation R (A, B, C, D), we assume that the key is (A, B), a composite key. With
this information, we would say which of the following is TRUE for R.
(a) R may be in 2NF (b) R may be in 3NF
(c) R may be in BCNF (d) Not enough information
Why? – The only information given is the primary key of the table. And the primary
is a composite key. Hence, we would say that the table can be in 2NF. We need the set
of functional dependencies for deciding further.
Why? – If we have a relation with just two attributes we cannot look for partial key
dependency, non-key dependency, or multiple candidate keys. Hence, the relation is
in 3NF and BCNF.
The decomposition given above is not dependency preserving decomposition.
Because, the decomposition results in elimination of C → B.
5. Find the minimal cover of the set of functional dependencies given; {A → BC,
B → C, AB → D}
(a) {A → C, B → C, AB → D} (b) {A → C, B → C, B → D}
(c) {A → B, B → C, A → D} (d) {A → BC, B → C, A → D}
Solution: Visit for detailed answer here.
1. We would say that {A1, A2, …, An}+ is the set of all attributes of R if and
only if (A1, A2, …, An) is a ____________ for R.
[a] Primary key [b] Candidate key
[c] Super key [d] All of the above
Answer: YES
A decomposition of R into R1 and R2 is said to be lossless join decomposition if
either of the following two conditions hold;
R1 ⋂ R2 → R1
R1 ⋂ R2 → R2
As per the given question, (ABC) ⋂ (ADE) = A. A is the candidate key for R1
from the FD A → BC, hence the first condition holds. So, the decomposition is
lossless join decomposition.
Answer: NO
Refer answer 2 above for rules
As per the given question, (ABC) ⋂ (CDE) = C. From the given FDs it is clear
that C alone does not uniquely identify any attributes of R. C is not a candidate
key for either of the relations. So, the decomposition is not lossless join
decomposition.
Answer: [a] 0, rs
The operation R Natural Join S results in any tuple if at least one record of R and
one record of S satisfy the join condition.
Minimum – If no records satisfy the join condition, the result will be 0 (Zero).
Maximum – If all the records of R can be joined with all the records of S, then the
result will be r*s.
5. Assume a relation R(A, B, C) with the records (1, 2, 3), (4, 2, 3), (5, 3, 3),
(5, 3, 4). Which of the following FDs is/are true?
[a] A → B [b] BC → A
[c] B → C [d] None of the above.
Answer: [a] A → B
View Answer
Answer: (a)
Let us say R1 = ABC. If decomposed from R, R 1 will have the following set of
functional dependencies F1;
F1 = {AB → C, AC → B, BC → A}
The candidate keys for R1 are AB, AC, and BC. As per rules governing BCNF, LHS of
all the functional dependencies must be the candidate key which is true for R1.
Hence, R1 in BCNF.
View Answer
Answer: (c)
Let us say R1 = AECH. If decomposed from R, R1 will have no functional
dependencies. Hence, the key for R1 is AECH itself. So, R1 is in BCNF.
View Answer
Answer: (c)
Let us say R1 = ABCEG. If decomposed from R, R 1 will have the following set of
functional dependencies F1;
F1 = { AB → C, AC → B, BC → A, E → G}
Candidate keys;
(AB)+ = ABC ≠ R1
(AC)+ = ACB ≠ R1
(BC)+ = BCA ≠ R1
(ABE)+ = ABCEG = R1. Likewise, (ACE)+ = (BCE)+ = R.
Hence, candidate keys are ABE, ACE, and BCE.
As per the rules of 2NF, there shouldn’t be any partial key dependencies.
But, in R1, the FD E → G is a partial key dependency. That is, E is not a candidate
key but a key attribute. And E alone determines another non-key attribute G
uniquely (the FD E → G). Hence, R1(ABCEG) is not in 2NF.
Q4. Let us suppose that R1 = DCEGH is a relation which is decomposed
from R satisfies the set F of functional dependencies F= {E → G}. What is
the strongest normal form currently R1 is in?
a) 1NF
b) 2NF
c) 3NF
d) BCNF
View Answer
Answer: (a)
The key is DCEH.
R1 is not in BCNF because E on the LHS of FD E → G is not a candidate key.
R1 is not in 3NF and not even in 2NF because the FD E → G is a partial key
dependency.
Hence, R1 is in 1NF.
View Answer
Answer: (b)
If R1(ABCD) is decomposed from R, then the set of functional dependencies holds by
R1 is as follows;
F1 = { AB → C, AC → B, B → D, BC → A }
We can take, for instance, the first FD AB → C to find the closure. The closure of AB =
ABC. So, we can create a separate table R 11(ABC) with the first FD. The remaining is
the FD B → D, and B+ is BD. This can go as R12(BD).
Hence, the decomposition results in R11(ABC), R12(BD)
1. Consider relation R(A,B,C,D,E) with functional dependencies:
AB → C, C → D, BD → E
Which of the following attribute sets does not functionally determine E ?
a) AB
b) AC
c) BC
d) ABC
View Answer
Answer: (b)
(AB)+ = ABCDE
(BC)+ = BCDE
(ABC)+ = ABCDE
(AC)+ = AC
Only the closure of AC does not include E in the result.
3. Suppose relation R(A,B,C) has tuples (0,0,0) and (1,2,0) , and it satisfies
the functional dependencies A → B and B → C . Which of the following
tuples may be inserted into R legally?
a) (0,0,1)
b) (1,2,1)
c) (0,1,1)
d) (0,0,2)
View Answer
Answer: None are correct
None of the options are correct.
If the record (0,0,1) will be inserted, it will violate the FD B → C. because, alredy there
exists a record with B value 0 and C value 0. Now we try to insert B value 0 and C
value 1. Likewise, record (b) and (d) both will violate this FD.
If the record (0,1,1) will be inserted, it will violate both FDs A → B and B → C.
4. Under what isolation level is the following schedule allowed?
R3(b); R1(b); W3(p); R2(b); R1(p); R1(c); W2(c); W1(c); R3(c); R2(c); W3(p);
a) Read uncommitted
b) Read committed
c) Repeatable read
d) Serializable
View Answer
Answer: (a)
Given schedule;
R3(b); R1(b); W3(p); R2(b); R1(p); R1(c); W2(c); W1(c); R3(c); R2(c); W3(p);
In this schedule, transaction 1 reads a value (R1(p)) which was written by transaction
3 (W3(p)) before T3 commits. Hence, the read was a dirty read. The transaction
isolation level that permits this type of read is READ UNCOMMITTED. [Other
violating instructions also highlighted].
[Refer here: Transaction isolation level READ UNCOMMITTED]
View Answer
Answer: (c)
E+ is the closure of E. This can be calculated using the given FD.
E+ = EC from FD E → C
= ECBF from FD C → BF
= ECBF from FD B → E (no change)
No more FDs with any of the attributes or combination of E, C, B, and F. Hence,
closure finding algorithm stops here.
[Refer here: How to find closure of a set of attributes here]
1. For a relation R(A, B, C), if A → B and A → C holds, then A → BC also holds. Which of the following rule
ensures this?
Answer:
(a) AB, CD
(d) A, D, DE
Answer:
3. Assume a relation R with the schema R(A, B, C, D, E). The primary key of R is A. Which of the following
is correct for R?
(a) R is in 1NF only
(c) R is in 3NF
(d) R is in BCNF
Answer:
4. Assume a relation R with the schema R(A, B, C, D, E) and a set F of functional dependencies as follows;
F = {A → B, C → D, D → E} The relation R is not in Second Normal Form (2NF). Why?
Answer:
F = {A → BC, CD → E, B → D, E → A}