1.

Consider the tables given below and answer the questions that follow :Table: EventEventIdEventNumPerformesCelebrityID101Birthday10C102102Promotion Party20C103103Engagement12C102104Wedding15C104Table: CelebrityCelebrityldNamePhoneFeeChargedC101Faiz Khan99101956200000C102Sanjay Kumar893466448250000C103Neera Khan Kapoor981166558300000C104Reena Bhatia65877755100000(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.

Answer»

(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.



Discussion

No Comment Found

Related InterviewSolutions