Question: Please create the queries to answer the following business questions/tasks and submit your queries (including use database command) in one single .sql script named as

Please create the queries to answer the following business questions/tasks and submit your queries (including use database command) in one single .sql script named as LAB4_firstname_lastname to Moodle.

NOTE: Please make sure your code is correct and executable. Non-executable code will receive 0 points.

Please create the queries to answer the followingPlease create the queries to answer the followingPlease create the queries to answer the following

ISDS 3110: Data and Information Management LAB #4: Join Tables SQL Lab Please create the queries to answer the following business questions/tasks and submit your queries (includinguse database' command) in one single .sql script named as "LAB4_firstname_lastname" to Moodle. NOTE: Please make sure your code is correct and executable. Non-executable code will receive 0 points. Part I - In this section, you will practice querying the text schema on the MySQL server. The required tables are person and car: one person can sell many cars, while a car can only be sold by one person. Create queries to answer the following questions: 1. (1pt) List all details of car sales, including salesperson's name and the gross profit (selling price minus cost price). (Hint: What special consideration do you have to deal with in this example? Specifically, how to handle column name with space?). 2. (1pt) How many cars were sold by Sheila O'Hara? (Hint: how to handle column name with space? Same as Q1.) Use her first and lasts names as your filtering criteria. 3. (1pt) What is the average selling price of cars and number of cars sold by Sue Lim? Use her first and lasts names as your filtering criteria. 4. (1pt) List details of the sales made by Bruce Bush. Use his first and lasts names as your filtering criteria. 5. (1pt) Report the gross profit made, number of cars sold, first name and last name grouped by each salesperson. Hint Be sure to group by each person. Limit to 1000 rows 1. 3100 use text; select * from person; select * from car; 2. 3. Result Grid Edit: 43 Export/Import: Wrap Cell Content: A I personid Result Grid 2 5 7 8 0 Filter Rows: : person person first last Gigi Garfield Nolan Haley Macedonio Gomez Bruce Bush Kendra Haley Kwok-kee Tan Sheila O'Hara Barbara Capelli James Haley Sue Lim NULL NULL Form Editor 10 16 21 Field Types 63 74 99 NULL Query Stats person 1 x car 2 Apply Revert Limit to 1000 rows 1. use text; 2. select from person; 3. select * from car; === Result Grid Result Grid Filter Rows: 2 : Edit: 4 Export/Import: Wrap Cell Content: IA carid carcost carsell cartype personid 1 500.00 795.00 sedan 5 2 15500.00 14750.00 coupe 8 3 1255.00 1355.00 sports 8 4 950.00 2000.00 sedan 8 5 7500.00 9000.00 sports 21 6 5400.00 6000.00 sedan 21 7 10300.00 12000.00 sedan 99 8 5700.00 9000.00 coupe 99 9 9000.00 12000.00 sports 74 10 6000.00 6500.00 sedan 63 NULL NULL NULL HULL KULL Form Editor Field Types & Query Stats person 1 car 2 X Apply Revert

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 General Management Questions!