Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

MySQL Use only solutions with a simple select statements, subqueries and joins. No variables. No programming constructs. Unless indicated in the question, use only a

MySQL

image text in transcribed

Use only solutions with a simple select statements, subqueries and joins. No variables. No programming constructs. Unless indicated in the question, use only a single SQL statement to answer these.

  1. Make a list which includes the combinations of every Customer First and Last Names with every Agent First and Last Names. Each row has one customer and one agent.
  2. List the Start Date and Start Time of all Engagements. For each engagement also list the Entertainer's Name. Do this using a JOIN with an ON join condition.
  3. List all Agent First and Last Names along with the total Contract Prices from Engagements that each agent sold. Each row should be Agent First Name, Agent Last Name, and the Total Agent Contract Price. Each Agent should only be listed once. Do this using a JOIN with a USING join condition. Hint: You also need an aggregate function and a GROUP BY clause.
  4. List all "active" Member First and Last Name along with each of their StageNames. "Active" members have a Status value of "1". Do this using a NATURAL JOIN.
  5. Get the First Name, Last Name of Agents along with the total compensation of each Agent. The total compensation for an agent is ((the salary of that agent) plus ((the total Contract price of all Engagements for that agent) times (the Commission Rate of the agent))). Rename this column "Compensation" in the result. Do this using implicit JOINs. Hint: You also need an aggregate function and a GROUP BY clause.
Entertainment Agency Database EA_Customers Customer NT11) ANA CustfirstName TEXT CustlastName TEXT CustStreetAddress TEXT -- CustCity TEXT Custstate TEXT CustZipCode TEXT CusiPhone Number TEXT EA Engagements Engagement Number INT(11) NNN StartDate DATE EndDate DATE StartTime TIME StopTime TIME Contract Price DECIMAL(102) CustomerID INTT11) FKI Agenti INT(11) IFK) EntertainerID INT(11) (FK) EA Agents AgentID INT(11) Agt FirstName TEXT AgtLastName TEXT Agt StreetAddress TEXT Agt City TEXT AgtState TEXT AgtZipCode TEXT Agt Phone Number TEXT DateHired DATE Salary DECIMAL 10.2) CommissionRate DECIMALIS.2) EA_Members MemberID INT(11) MorfirstName TEXT MbrLastName TEXT MbrPhoneNumber TEXT Gender TEXT & EA Music Preis StyleID INT(11) CON Customeri INT|11) (FK) NN EA Entertainers EntertainerID INT(11) EntStageName TEXT EntSSN TEXT En StreetAddress TEXT EntCity TEXT EntState TEXT EntZipCode TEXT EntPhone Number TEXT EntWebPage TEXT EntEMailAddress TEXT Datentered TEXT EA_Entertainer_Members MemberID INT(11) FK) EntertainerID INT(11) (FKI Status INT(11) EA_Music_Styles StyleID INT(11) StyleName TEXT EA_Entertainer_Styles Style INTEL 1) (FK) EntertainerID INT(11) (FKI Entertainment Agency Database EA_Customers Customer NT11) ANA CustfirstName TEXT CustlastName TEXT CustStreetAddress TEXT -- CustCity TEXT Custstate TEXT CustZipCode TEXT CusiPhone Number TEXT EA Engagements Engagement Number INT(11) NNN StartDate DATE EndDate DATE StartTime TIME StopTime TIME Contract Price DECIMAL(102) CustomerID INTT11) FKI Agenti INT(11) IFK) EntertainerID INT(11) (FK) EA Agents AgentID INT(11) Agt FirstName TEXT AgtLastName TEXT Agt StreetAddress TEXT Agt City TEXT AgtState TEXT AgtZipCode TEXT Agt Phone Number TEXT DateHired DATE Salary DECIMAL 10.2) CommissionRate DECIMALIS.2) EA_Members MemberID INT(11) MorfirstName TEXT MbrLastName TEXT MbrPhoneNumber TEXT Gender TEXT & EA Music Preis StyleID INT(11) CON Customeri INT|11) (FK) NN EA Entertainers EntertainerID INT(11) EntStageName TEXT EntSSN TEXT En StreetAddress TEXT EntCity TEXT EntState TEXT EntZipCode TEXT EntPhone Number TEXT EntWebPage TEXT EntEMailAddress TEXT Datentered TEXT EA_Entertainer_Members MemberID INT(11) FK) EntertainerID INT(11) (FKI Status INT(11) EA_Music_Styles StyleID INT(11) StyleName TEXT EA_Entertainer_Styles Style INTEL 1) (FK) EntertainerID INT(11) (FKI

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Cost Accounting Principles And Managerial Applications

Authors: Gerald R. Crowningshield

3rd Edition

0395178371, 978-0395178379

More Books

Students explore these related Accounting questions

Question

How does teacher immediacy affect learning?

Answered: 3 weeks ago