Answered step by step
Verified Expert Solution
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
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.
- 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.
- 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.
- 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.
- 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.
- 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started