Q51.Marks: +2.0UGC NET Paper 2: Computer Science 26th Nov 2021
Given the following STUDENT‐COURSE scheme : STUDENT (Rollno, Name, Courseno) COURSE (Courseno, Coursename, Capacity), where Rollno is the primary key of relation STUDENT and Courseno is the primary key of relation COURSE. Attribute Coursename of COURSE takes unique values only. The number of records in COURSE and STUDENT tables are 3 and 5 respectively. Following relational algebra query is executed : R = STUDENT × COURSE
Match List I with List II in context to the above problem statement.
List I
List II
A.
Degree of table R
I.
15
B.
Cardinality of table R
II.
NIL
C.
Foreign key of relation STUDENT
III.
6
D.
Foreign key of relation COURSE
IV.
Courseno
Choose the correct answer from the options given below :
1.A ‐ III , B ‐ I , C ‐ IV , D ‐ II✓ Correct
2.A ‐ II , B ‐ III , C ‐ IV , D ‐ I
3.A ‐ I , B ‐ III , C ‐ IV , D ‐ II
4.A ‐ I , B ‐ III, C ‐ II , D ‐ IV
Solution
Degree: The degree of relationship means the number of entities associated with a relationship in a relational model, that is, the number of columns in the final resultant table R = STUDENT x COURSE.
Formula: Sum of number of columns in all the tables. Hence, 3 + 3 = 6
Cardinality: It represents the number of times an entity of an entity set participates in a relationship set, that is, the number of tuples or rows in a relationship table R = STUDENT x COURSE.
Formula: Product of number of records in all the tables. Hence, 3 * 5 = 15
Foreign Key: A foreign key is a set of attributes in a table that refers to the primary key of another table. The foreign key links these two tables.
Foreign key for relation STUDENT - Courseno, present as foreign key in STUDENT and primary key in COURSE.
Foreign key for relation COURSE - NIL, no columns from relation COURSE is a primary key for STUDENT.