Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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.

aggregate function, View, GROUP BY OP URUER BY) AGENTS .. ENGAGEMENTS AgentiD CUSTOMERS CustomerlD PK CustFirstName CustLastName CustStreetAddress CustCity CustSt CustzipCode CustPhoneNumber EngagementNumber PK StartDate EndDate StartTime Stop Time ContractPrice AgtFirstName AgtLastName AgtStreetAddress AgtCity AgtState AgtZipCode AgtPhoneNumber DateHired Salary CommissionRate FK FK FK --O CustomerID AgentID EntertainerlD ENTERTAINERS EntertainerlD PK EntStageName EntSSN EntStreetAddress EntCity EntState EnzpCode ENTERTAINER_MEMBERS EntertainerlD CPK Status MUSICAL PREFERENCES O MemberlD CustomerID StylelD CPK Preferenceseq Number EntWebPage EntEmailAddress DateEntered MEMBERS MemberlDPK MbrFirstName MbrLastName MbrPhoneNumber Gender ENTERTAINER STYLES EntertainerID StylelD StyleStrength MUSICAL STYLES CPK CPK StylelD PK StyleName

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