Professional Documents
Culture Documents
DSE 310
Practice-1
Solution:
A Primary Key is the minimal set of attributes of a table that
has the task to uniquely identify the rows, or we can say the
tuples of the given particular table.
✔ Minimal:
✔ Accessible
✔ Unique
✔ Not-Null
student_id={1,2,3,1,4}
student_id, name ={(1,ROHAN), (2, kARTHIKA),
(3,PINAKI),(1,ROHAN)}
student_id, course_id={(1,c1), (2,c1),(3,c2),(1,c2),(4,c2) }
….etc.
Q. In context of a database, identify the incorrect
statement:
1) There can be more than one superkeys.
2) A candidate key is the minimal superkey.
3) One of the candidate keys is designated as
primary key
4) Primary key is obtained by removing one of
the attributes from candidate keys.
Q. Consider the following statements regarding keys:
(I) SuperKey is an attribute or combination of attributes that
uniquely identify records in the RDMS table
(II) Candidate key is subset of superkeys
(III) All superkeys are candidate keys but vice-versa is not
true.
X1 Y1 Z1 Y1 V1 X2 X4 Z4 Y1 V1
X1 Y1 Z1 Y3 V2 X2 X4 Z4 Y3 V2
X1 Y1 Z1 Y2 V3 X2 X4 Z4 Y2 V3
X1 Y1 Z1 Y2 V2 X2 X4 Z4 Y2 V2
X1 Y1 Z2 Y1 V1
X1 Y1 Z2 Y3 V2
X1 Y1 Z2 Y2 V3
X1 Y1 Z2 Y2 V2
X2 Y2 Z2 Y1 V1
X2 Y2 Z2 Y3 V2
Satisfying both
X2 Y2 Z2 Y2 V3
conditions Ans is X2
X2 Y2 Z2 Y2 V2
Sol ii:
Q.X Q.Y Q.T R.Y R.V Q.X Q.Y Q.T R.Y R.V
X2 Y1 2 Y1 V1 X3 Y3 1 Y1 V1
X2 Y1 2 Y3 V2 X3 Y3 1 Y3 V2
X2 Y1 2 Y2 V3 X3 Y3 1 Y2 V3
X2 Y1 2 Y2 V2 X3 Y3 1 Y2 V2
X1 Y2 5 Y1 V1
X1 Y2 5 Y3 V2
X1 Y2 5 Y2 V3
X1 Y2 5 Y2 V2 X1
X1 Y1 6 Y1 V1
X1 Y1 6 Y3 V2
X1 Y1 6 Y2 V3
X1 Y1 6 Y2 V2
For the following relation instance of CR(StudentName, CourseName), what are the tuples T1 and
T2 will contain.
For the following relation instance of CR(StudentName, CourseName), what are the tuples T1 and
T2 will contain.
R S
P Q R1 R2 R3 P Q S1 S2
a b 1 2 3 a b 20 22
c d 4 5 6 c d 40 42
e z 7 8 9 e y 50 56
v f 10 11 12 w f 70 74
q r 13 14 15 s t 80 90
P Q R1 R2 R3 S1 S2
a b 1 2 3 20 22 Ans: a and c
c d 4 5 6 40 42
R S
P P P
a a a Ans: a, c and e
Natural
c c c
Relation
e e e
v w
s R S
q
P Q P Q P Q
a b a b a b
Intersection c d
c d c d
e z e y Ans: a and c
v f w f
q r s t
P Q P Q P Q P Q P Q P Q
a b a b a b a b e z a b
c d c d c d c d v f c d
e z e z e y e z q r
v f v f w f v f
q r q r s t q r
99 5 ME 70
Ans is D
All of his/her dependents