Consider the table, MOVIEDETAILS given below:
Table: MOVIEDETAILS
MOVIEID | TITLE | LANGUAGE | RATING | PLATFORM |
M001 | Minari | Korean | 5 | Netflix |
M004 | MGR Magan | Tamil | 4 | Hotstar |
M010 | Kaagaz | Hindi | 3 | Zee5 |
M011 | Harry Potter and the Chamber of Secrets |
English | 4 | Prime Video |
M015 | Uri | Hindi | 5 | Zee5 |
M020 | Avengers: Endgame | English | 4 | Hotstar |
(a) Identify the degree and cardinality of the table.
(b) Which field should be made the primary key? Justify your answer.
OR
(a) Identify the candidate key(s) from the table MOVIEDETAILS. (b) Consider the table SCHEDULE given below:
Table: SCHEDULE
SLOTID | MOVIEID | TIMESLOT |
S001 | M010 | 10 AM to 12 PM |
S002 | M020 | 2 PM to 5 PM |
S003 | M010 | 6 PM to 8 PM |
S004 | M011 | 9 PM to 11 PM |
Which field will be considered as the foreign key if the tables MOVIEDETAILS and SCHEDULE are related in a database?
Answer
(a) Degree: 5
Cardinality: 6
(b) MOVIEID should be made the primary key as it uniquely identifies each record of the table.
OR
(a) MOVIEID and TITLE
(b) MOVIEID