Database miscellaneous
Direction: Consider the following ER diagram :
- The minimum number of tables needed to represent M, N, P, R1, R2 is
-
View Hint View Answer Discuss in Forum
There are 3 entity set, but 2 relations R1 & R2 only. R1 is one to many from P to M. R2 is one to many from P to N. N is weak entity set here.
Correct Option: B
There are 3 entity set, but 2 relations R1 & R2 only. R1 is one to many from P to M. R2 is one to many from P to N. N is weak entity set here.
- An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
-
View Hint View Answer Discuss in Forum
In one to many or many to one participation, relation is merged in table which is on many side and if there participation then relation is merged in that side consider entity set A, B in the relationship set R. Relation R merge with that of A and B.
According to the above figure. Many to one relationship set can merge towards entity set 'A' & Participation towards A side can be total. Hence option (c) is correct.Correct Option: C
In one to many or many to one participation, relation is merged in table which is on many side and if there participation then relation is merged in that side consider entity set A, B in the relationship set R. Relation R merge with that of A and B.
According to the above figure. Many to one relationship set can merge towards entity set 'A' & Participation towards A side can be total. Hence option (c) is correct.
- Consider an Entity-Relationship(ER) model in which entity sets E1 and E2 are connected by an m : n relationship R12. E1 and E3 are connected by a 1 : n (1 on the side of E1 and n on the side of E3) relationship R13. E1 has two single-valued attributes a11 and a12 of which a11 is the key attribute. E2 has two single-valued attributes a21 and a22 of which is the key attribute. E3 has two singlevalued attributes a31 and a32 of which a31 is the key attribute. The relationships do not have any attributes. If a relational model is the derived from the above ER model, then the minimum number of relations that would be generated if all the relations are in 3NF is _______.
-
View Hint View Answer Discuss in Forum
E1 (a11, a12), E2 (a21, a22), E3 and R13 (a11, a31, a32), R2 (a11 , a12), But in table (a11, a31, a32) there may be transitive dependency between a11 and a32 so we should decompose this table into 2 more tables.Correct Option: B
E1 (a11, a12), E2 (a21, a22), E3 and R13 (a11, a31, a32), R2 (a11 , a12), But in table (a11, a31, a32) there may be transitive dependency between a11 and a32 so we should decompose this table into 2 more tables.
- Given the basic ER and relational models, which of the following is incorrect?
-
View Hint View Answer Discuss in Forum
An attribute of an entity can have more than one value or multivalue.
For example,
Hence, option (a) is correct. Attributes can be composite also, Hence, option (b) is also correct. In the relational table, any attribute can contain only one value which can be null. Hence, option (d) is also correct but by the definition of 1 NF, any attribute in the relational table can contain only one value not more than one values. Hence option (c) is false or incorrect.Correct Option: C
An attribute of an entity can have more than one value or multivalue.
For example,
Hence, option (a) is correct. Attributes can be composite also, Hence, option (b) is also correct. In the relational table, any attribute can contain only one value which can be null. Hence, option (d) is also correct but by the definition of 1 NF, any attribute in the relational table can contain only one value not more than one values. Hence option (c) is false or incorrect.
- What is the optimized version of the relation algebra expression πA1(πA2 (σF1 (σF2(r)))) , where A1, A2 are sets of attributes in r with A1 ⊂ A2 and F1, F2 are Boolean expressions based on the attributes in r?
-
View Hint View Answer Discuss in Forum
ΠA1 (ΠA2 (σF1 (σF1 (r))))
= ΠA1 (ΠA2 (σ (F1 ∧ F2)(r)))
∴ A1 ⊂ A2 , final relation will be displaying values for attributes present in set A.
ΠA1 (σ (F1 ∧ F2)(r))Correct Option: A
ΠA1 (ΠA2 (σF1 (σF1 (r))))
= ΠA1 (ΠA2 (σ (F1 ∧ F2)(r)))
∴ A1 ⊂ A2 , final relation will be displaying values for attributes present in set A.
ΠA1 (σ (F1 ∧ F2)(r))