MySQL Project
Orders
- Load the database using the following command. Inspect the different tables and columns.
= pymysql.connect(
connection = "dsc140.cmgtlybtlnmh.us-east-2.rds.amazonaws.com",
host = "guest",
user = "UMUdsc140",
password ="orders") db
- Identify and print the names of all the tables in the database. Look at the columns within some of the tables and briefly describe what this database appears to be all about.
- Find the sale amount for every order. To do this you’ll need to find how many units were sold in each order and the price per unit for the corresponding item that was sold, then multiply the values together.
- Make a histogram of the sale amounts you found in #3.
- Generate a pandas dataframe that lists the customerID for all customers served by the employee with EmployeeID “8”. Display the dataframe.
- Generate a pandas dataframe that lists the Customer’s Name and their corresponding country of residence, again only for customers served by the employee with EmployeeID “8”. Display the dataframe.
Auto Project
- Load the database using the following command. Inspect the different tables and columns.
= pymysql.connect(
connection = "dsc140.cmgtlybtlnmh.us-east-2.rds.amazonaws.com",
host = "guest",
user = "UMUdsc140",
password ="autos") db
- Load the mpg table as a dataframe
- Create a plot of model year vs. mpg. Include the correlation score, slope and y-intercept of the line of best fit and add the line of best fit to the plot. Do the same for weight vs mpg and model year vs weight.
- Create a box and whisker plot of mpg separated by country codes.
- Use K-Means to determine the optimal number of groupings for the cars. This will require you to look up how to do K-Means in Python.
- Use k-nearest neighbors to try to classify the car data by the clusters returned in step 5.