Question: Requirements. A television channel has decided to create a simple database to register payment information about its most successful show TheVoiceLondon. In this show, there

Requirements. A television channel has decided to create a simple database to register payment information about its most successful show TheVoiceLondon.

In this show, there are contenders that compete to represent the UK in Eurovision. These contenders are coached by famous artists (namely the coaches). Contenders can be formed by a group of participants or a single participant. Both coaches and participants are paid based on the number of shows they attend.

For each coach and participant, the database stores their id, name, surname, date of birth, phone, gender and daily salary.

For each contender, the database stores its id, type (group or individual), stage name, its coach and the participants forming that contender. Each contender should have at least one participant.

For each show, the database stores its date, start time, end time and a location if the show does not take place in the television studio.

Finally, the database also registers which coaches and contenders attended each show.

If a coach decides to leave the program, then their personal and attendance information must be deleted from the database and any contenders they coach need to be assigned a replacement coach.

The following relational schema contains the database model for this TV show.

Coach: PRIMARY KEY (idCoach)

Contender: PRIMARY KEY (idContender), FOREIGN KEY (idCoach) in Coach

Participant: PRIMARY KEY (idParticipant), FOREIGN KEY (idContender) in Contender

Show:

PRIMARY KEY (idShow)

CoachInShow: PRIMARY KEY (idCoach, idShow), FOREIGN KEY (idCoach) in Coach, FOREIGN KEY (idShow) in Show

ContenderInShow: PRIMARY KEY (idShow, idContender), FOREIGN KEY (idShow) in Show FOREIGN KEY (idContender) in Contender

---------------------------------------------

QUESTION

(Please give me a correct answer that works with MySQL with simple explanation)

--------------------------------------------

1. Most Expensive Contender. TheVoiceLondon would like to know which contender has the highest total daily salary (i.e., sum of the daily salaries of the participants forming that contender). Write a SELECT query that lists the stage name of the contender with the highest total daily salary.

2. Well Formed Groups! Note group contenders should be formed by more than one participant (otherwise they are individual contenders).

Since MySQL does not support an assertion to check this constraint, write a SELECT statement that returns only a scalar Boolean value (i.e. either True or False). It should return True if there are no violations in the database of this regulation. If there is a violation, then the SELECT statement should return False.

There is a violation if there is a group contender formed by less than 2 participants.

Show that your SELECT statement works by creating a group contender that violates this rule and then running your SELECT statement.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!