Question: There are no tables, create and populate on the fly from questions. Enter your values and use to show commands work, put an example or
There are no tables, create and populate on the fly from questions. Enter your values and use to show commands work, put an example or pull your own values.
For statement syntax, use Google to find examples. If asked for a SQL statement write the SQL to perform the requested task, do not use the GUI.
1. Retrieve the average MPG Highway for all vehicles.
Hint: Only 1 row should be returned from your select statement.
Paste the SQL statement and results below.
Remember, pasting the results is 50% of the credit.
2. Select the average rating for all restaurants in city of Miami. Hint: use the location table.
Paste the SQL statement and the results below.
4. Retrieve the count of vehicle models produced by each make in 1997. Order the results by make. Hint: There are 44 unique vehicle makes.
Paste the SQL statement and results below.
5. Retrieve the top 10 (best) average MPG City values by vehicle model. Group the average MPG values by vehicle model. Exclude vehicles with a MPG city value of 0. Then order the results with the highest average MPG City on top.
Example: The average MPG city of all Ford Mustangs across all years with the MPG City greater than 0, would be 1 of the rows returned.
Paste the SQL statement and the results below.
6. Retrieve the count of models produced by each make in only 2002. Order the results by make. Exclude makes who only produce less than 5 models by using a having clause.
Paste the SQL statement and results below.
7. Create an ER diagram of the database using MySQL Workbench. This diagram will have the new tables we created in the previous questions of this lab. Export the diagram as an image.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
