Question: R Programming SQL PLEASE HELP In order to answer these questions you will need to load up the mdsr package and RMySQL package, as we

R Programming SQL PLEASE HELP

 

In order to answer these questions you will need to load up the mdsr package and RMySQL package, as we did in class. Once you pull in the query you may use the data wrangling verbs we have developed to answer the following questions.

Connect to the airlines database. Make a list of all of the tables in this database. List the names of all of the variables in the flights table.

Do a query to generate a data frame that represents the number of flights that flew from Minneapolis/St. Paul (MSP) on June 12, 2015. How many of those flights flew to Denver (DEN)? (Be sure to not include any canceled flights.)

Do a query to generate a data frame that represents all the flights that flew from Minneapolis/St. Paul in 2010.

Using the data frame from Exercise 3, what were the top 6 destinations for flights from Minneapolis/St. Paul in 2010?

Using the data frame from Exercise 3, from flights that flew from Minneapolis/St. Paul in 2010, which 5 airports had the highest average arrival delay time?

****THIS IS WHAT WE DID IN CLASS******

library(mdsr) library(RMySQL) # Connect to the server and the database airlines db <- dbConnect_scidb(dbname ="airlines") # Connect to the specific dataframes flights <- tbl(db, "flights") class(flights) # Emphasize this is not a data frame - the data still live on the sql server. carriers <- tbl(db, "carriers") show_query(carriers) # This code shows the SQL language syntax to pull the query

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 Databases Questions!