Consider the following two tables along with their structures and sample data.…
2026
Consider the following two tables along with their structures and sample data.
Table: MOVIES
MovieID | MovieTitle | ReleaseDate | ScreenNo |
|---|---|---|---|
2026103 | Chhaava | 2025-12-09 | S2 |
2026112 | Dragon | 2026-02-01 | S2 |
2025125 | Ikkis | 2026-01-12 | S1 |
Table: SCREENS
ScreenNo | ScreenSize | TotalSeats |
|---|---|---|
S1 | 60 | 380 |
S2 | 70 | 540 |
Note: Both tables include more relevant rows.
Assume that each MovieID has exactly one ScreenNo assigned to it. Answer the following questions based on the given tables and concepts of relational databases:
(A) If ScreenNo is the common attribute between the two tables, identify in which table it can act as a foreign key. Can the foreign key ScreenNo contain NULL values in that table?
(B) Determine the total number of attributes and tuples in the resulting table obtained after performing a natural join between the MOVIES and SCREENS tables. Assume that each movie is assigned to a valid screen.
(C) Which MySQL command can we use to add one more column ‘Cast’ to the MOVIES table?
(D) Which MySQL command can we use to add one more screen (record) to the SCREENS table?
Attempted by 43 students.
Show answer & explanation
(A) ScreenNo acts as a foreign key in MOVIES table referencing SCREENS. Since every movie has a valid screen, a foreign key can contain NULL values (if a NOT NULL constraint is not specifically applied to it).
(B) Natural Join on ScreenNo:
Attributes = 4 (MOVIES) + 3 (SCREENS) − 1 = 6
Tuples = 3 (each movie maps to one screen).
(C) To add column:
ALTER TABLE MOVIES ADD Cast VARCHAR(50);(D) To insert record:
INSERT INTO SCREENS VALUES ('S3', 80, 600);Conclusion: Foreign keys maintain integrity, while JOIN combines related data efficiently.