R RStudio File Edit Code View Plots Session Build Debug Profile Tools Help chinook (3).rx 日 Source on Save 3 library(DBI) Go to file/function ▾ Addins ▾ Run Environment History Connections Tutorial Source Import Dataset 165 MIB ▼ R▾ Global Environment ▾ a Project: (None) List ▾ 4 library(RSQLite) 5 drv <- dbDriver ("SQLite") 6 7 con <- dbconnect (drv, dbname="chinook.db") ##be sure chinook.db is in the R workir dbListTables (con) Environment is empty 8 query

Elementary Linear Algebra (MindTap Course List)
8th Edition
ISBN:9781305658004
Author:Ron Larson
Publisher:Ron Larson
Chapter4: Vector Spaces
Section4.CR: Review Exercises
Problem 82CR
Question

Please show me how this would look in the R studio, I can not get chinook.db to work.  Download the chinook database. This is an example assignment to teach us and prepare us for the big test. 

Place the “chinook.db” file in your R Studio working directory

library(DBI)

library(RSQLite)

drv <- dbDriver("SQLite")

con <- dbConnect(drv, dbname="chinook.db")

dbListTables(con) to test connection

You should be able to see this line in your console

 "Album"   "Artist"   "Customer"  "Employee"  "Genre"     

   "Invoice"    "InvoiceLine"  "MediaType"   

 "Playlist"      "PlaylistTrack" "Track"    

R RStudio
File Edit Code View Plots Session Build Debug Profile Tools Help
chinook (3).rx
日
Source on Save
3 library(DBI)
Go to file/function
▾ Addins ▾
Run
Environment
History Connections
Tutorial
Source
Import Dataset
165 MIB ▼
R▾
Global Environment ▾
a
Project: (None)
List ▾
4
library(RSQLite)
5
drv <- dbDriver ("SQLite")
6
7
con <- dbconnect (drv, dbname="chinook.db") ##be sure chinook.db is in the R workir
dbListTables (con)
Environment is empty
8
query<dbGetQuery(con, "select * from Album;")
9
query
10
query<dbGetQuery(con, "select avg (Milliseconds) from Track;")
11
query
12
13
14
query<dbGetQuery(con, "select artistid from Artist where Name = 'Queen' ")
15
query <- dbGetQuery(con, "select customerid, sum(total) from Invoice group by cust
query
query
16
query<dbGetQuery(con, "select composer from Track order by Milliseconds; ")
17
query
Files Plots Packages
New Folder New Blank File ▾
Help
Viewer
Presentation
* Delete
Rename
More ▾
18
query <- dbGetQuery(con, "select Name, Title from Track join Album using (AlbumId)
Home
19
query
Name
Size
Modified
20
1:1
(Top Level) +
Console
Terminal x
Background Jobs x
RR 4.4.1 ~
R Script
Chapter 8 Quiz_ MG343ZA Supervisory Management.pdf
Chapter 9 Quiz MG343ZA Supervisory Management.pdf
CheapOair transript.docx
127.6 KB
Mar 27, 2024, 8:02 PM
124.3 KB
Apr 3, 2024, 2:36 PM
chinook.db
116.4 KB
OB
May 13, 2024, 7:51 PM
Sep 9, 2024, 4:06 PM
Command & Conquer 3 Kane's Wrath
DOOOO
BBBBBB
Command and Conquer 3 Kanes Wrath
Command and Conquer 3 Tiberium Wars
Command and Conquer Generals Data
Command and Conquer Generals Zero Hour Data
Copies of Passports and IDs
CopilotAnswers-20240617-190422.xlsx
CopilotAnswers-20240624-144823.xlsx
Current Enrollment Spring 2024.pdf
Custom Office Templates
7 KB
Jun 17, 2024, 7:05 PM
6.8 KB
493.3 KB
Jun 24, 2024, 2:48 PM
Dec 26, 2023, 11:10 AM
Transcribed Image Text:R RStudio File Edit Code View Plots Session Build Debug Profile Tools Help chinook (3).rx 日 Source on Save 3 library(DBI) Go to file/function ▾ Addins ▾ Run Environment History Connections Tutorial Source Import Dataset 165 MIB ▼ R▾ Global Environment ▾ a Project: (None) List ▾ 4 library(RSQLite) 5 drv <- dbDriver ("SQLite") 6 7 con <- dbconnect (drv, dbname="chinook.db") ##be sure chinook.db is in the R workir dbListTables (con) Environment is empty 8 query<dbGetQuery(con, "select * from Album;") 9 query 10 query<dbGetQuery(con, "select avg (Milliseconds) from Track;") 11 query 12 13 14 query<dbGetQuery(con, "select artistid from Artist where Name = 'Queen' ") 15 query <- dbGetQuery(con, "select customerid, sum(total) from Invoice group by cust query query 16 query<dbGetQuery(con, "select composer from Track order by Milliseconds; ") 17 query Files Plots Packages New Folder New Blank File ▾ Help Viewer Presentation * Delete Rename More ▾ 18 query <- dbGetQuery(con, "select Name, Title from Track join Album using (AlbumId) Home 19 query Name Size Modified 20 1:1 (Top Level) + Console Terminal x Background Jobs x RR 4.4.1 ~ R Script Chapter 8 Quiz_ MG343ZA Supervisory Management.pdf Chapter 9 Quiz MG343ZA Supervisory Management.pdf CheapOair transript.docx 127.6 KB Mar 27, 2024, 8:02 PM 124.3 KB Apr 3, 2024, 2:36 PM chinook.db 116.4 KB OB May 13, 2024, 7:51 PM Sep 9, 2024, 4:06 PM Command & Conquer 3 Kane's Wrath DOOOO BBBBBB Command and Conquer 3 Kanes Wrath Command and Conquer 3 Tiberium Wars Command and Conquer Generals Data Command and Conquer Generals Zero Hour Data Copies of Passports and IDs CopilotAnswers-20240617-190422.xlsx CopilotAnswers-20240624-144823.xlsx Current Enrollment Spring 2024.pdf Custom Office Templates 7 KB Jun 17, 2024, 7:05 PM 6.8 KB 493.3 KB Jun 24, 2024, 2:48 PM Dec 26, 2023, 11:10 AM
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elementary Linear Algebra (MindTap Course List)
Elementary Linear Algebra (MindTap Course List)
Algebra
ISBN:
9781305658004
Author:
Ron Larson
Publisher:
Cengage Learning
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Glencoe Algebra 1, Student Edition, 9780079039897…
Glencoe Algebra 1, Student Edition, 9780079039897…
Algebra
ISBN:
9780079039897
Author:
Carter
Publisher:
McGraw Hill
College Algebra
College Algebra
Algebra
ISBN:
9781938168383
Author:
Jay Abramson
Publisher:
OpenStax