Querying SQLite from R
In our Querying SQLite from R mission, you’ll learn how to query a SQLite database using the DBI and RSQLite packages.
Being able to write SQL queries using R can be quite beneficial. Otherwise, you would find yourself writing code in R, exporting data from R, importing that in a separate program you have that can query data, saving that data, and importing it back into R. That would be, needless to say, a cumbersome process!
In this mission, you will learn how to avoid that process by writing queries for a SQLite database from within R using the DBI and RSQLite packages. As you progress through the mission, you will get familiar with connecting to SQLite databases and build experience with the SQL query workflow.
Throughout this mission, you’ll also continue your analysis of the 2010-2012 college grade data to give you practice using SQL to solve real-world data science problems.
- How to run SQL queries using RSQLite in R.
- Introduction to the Data
- Connecting to the Database
- Running Queries With Our Connection
- Limitations of dbGetQuery()
- Cleaning Up After Ourselves
- Using the Whole Workflow
- Wrapping Up The Connection
- Next Steps