Consider the tables given below and answer the questions that follow : Table: Event EventId Event NumPerformes CelebrityID
Consider the tables given below and answer the questions that follow :
Table: Event
| EventId | Event | NumPerformes | CelebrityID |
| 101 | Birthday | 10 | C102 |
| 102 | Promotion Party | 20 | C103 |
| 103 | Engagement | 12 | C102 |
| 104 | Wedding | 15 | C104 |
Table: Celebrity
| Celebrityld | Name | Phone | FeeCharged |
| C101 | Faiz Khan | 99101956 | 200000 |
| C102 | Sanjay Kumar | 893466448 | 250000 |
| C103 | Neera Khan Kapoor | 981166558 | 300000 |
| C104 | Reena Bhatia | 65877755 | 100000 |
(i) Name the Primary keys in both the tables and Foreign key in 'Event' table. Can NumPerformers (Number for performers) be set as the Primary key? Give reason.
(ii) How many rows will be present in the Cartesian join of the above mentioned two tables?
In the table 'Event', the CelebrityID 102 is present twice in the column "CelebrityId". Is there any discrepancy ? Give reason.
1 Answers
(i) Primary Key in Event: EventId
Primary Key in Celebrity: CelebrityId
Foreign Key in Event: CelebrityId
No, NumPerformers cannot be set as a Primary Key, because the number of performers can be same in multiple fields and also they have to proper patters when we talk about the teams.
(ii) 16 rows.
No, there will not be any discrepancy in the Event table because, it is not the primary key, it is only Foreign Key, whose value can appear multiple times as same.