library(RCurl)
## Loading required package: bitops
x <- getURL("https://raw.githubusercontent.com/Jagdish16/jagdish_r_repo/master/DATA607/Week2/ratings.csv")
ratings<-read.csv(text=x, header=T)
ratings
library(DBI)
library(RMySQL)
library(RODBC)
drv<-dbDriver('MySQL')
#class(drv)
con <- dbConnect(drv, dbname = "movies",host = "localhost",port=3306,user="ds607", password="")
dbListTables(con)
## [1] "movies"  "raters"  "ratings"
dbListFields(con, "ratings")
## [1] "movie_name"      "rater_firstname" "rater_lastname"  "rating"
ratings<-dbGetQuery(con, "SELECT * FROM RATINGS")
print(ratings)
##                        movie_name rater_firstname rater_lastname rating
## 1                   Black Panther          Mighty          Mango      1
## 2                   Black Panther         Working         Banana      1
## 3                   Black Panther           Sweet     Strawberry      2
## 4                   Black Panther           Moody          Melon      2
## 5                   Black Panther          Klever           Kiwi      3
## 6                   Black Panther            Sour         Grapes      1
## 7          Avengers: Infinity War         Working         Banana      3
## 8          Avengers: Infinity War            Sour         Grapes      4
## 9          Avengers: Infinity War          Mighty          Mango      1
## 10         Avengers: Infinity War           Sweet     Strawberry      2
## 11         Avengers: Infinity War           Moody          Melon      2
## 12         Avengers: Infinity War          Klever           Kiwi      3
## 13                  Incredibles 2           Sweet     Strawberry      2
## 14                  Incredibles 2           Moody          Melon      1
## 15                  Incredibles 2          Klever           Kiwi      2
## 16                  Incredibles 2            Sour         Grapes      5
## 17                  Incredibles 2         Working         Banana      3
## 18                  Incredibles 2          Mighty          Mango      1
## 19 Jurassic World: Fallen Kingdom           Moody          Melon      4
## 20 Jurassic World: Fallen Kingdom            Sour         Grapes      5
## 21 Jurassic World: Fallen Kingdom         Working         Banana      3
## 22 Jurassic World: Fallen Kingdom          Mighty          Mango      1
## 23 Jurassic World: Fallen Kingdom           Sweet     Strawberry      2
## 24 Jurassic World: Fallen Kingdom          Klever           Kiwi      3
## 25                     Deadpool 2          Klever           Kiwi      5
## 26                     Deadpool 2           Sweet     Strawberry      2
## 27                     Deadpool 2          Mighty          Mango      1
## 28                     Deadpool 2         Working         Banana      3
## 29                     Deadpool 2            Sour         Grapes      5
## 30                     Deadpool 2           Moody          Melon      4
## 31   Dr. Seuss' The Grinch (2018)            Sour         Grapes      5
## 32   Dr. Seuss' The Grinch (2018)           Sweet     Strawberry      3
## 33   Dr. Seuss' The Grinch (2018)         Working         Banana      5
## 34   Dr. Seuss' The Grinch (2018)          Mighty          Mango      4
## 35   Dr. Seuss' The Grinch (2018)          Klever           Kiwi      1
## 36   Dr. Seuss' The Grinch (2018)           Moody          Melon      2