Please show steps in MySQL for the followings: a. Display entertainers who have
ID: 3702822 • Letter: P
Question
Please show steps in MySQL for the followings:
a. Display entertainers who have no musical style
b. List entertainers who live in the same area as his/her customer
c. List agents who work for every customer
d. Display detail of first hired agents for each engagement contract.
Explanation / Answer
a) select entertainerID from ENTERTAINERS where entertainerID not in (select EntertainerID from ENTERTAINER_STYLES as y where not exists (select 1 from MUSICAL_STYLES as z where z.StyleID=y.StyleID))
b) select EntertainerID from ENTERTAINERS as a inner join (select y.EntertainerID,z.CustZipCode from ENGAGEMENTS as y INNER JOIN CUSTOMERS as z on y.CustomerID=z.CustomerID) as b on a.EntZipCode=b.CustZipCode and a.EntertainerID=b.EntertainerID