SQLUndergraduate courses
SQL — Introduction to Database Queries
Get your data out of the database and into your analysis — SELECT, filtering, joins and subqueries, taught on a real airline data set.
- Introductory
- 4 weeks
- Approx. 15 hours per week
- 3 semester hours
About this course
SQL, the structured query language, is what pulls data from the various tables in a database and assembles it in a format amenable to statistical analysis or review. This course builds both halves of that: a conceptual understanding of how a relational database differs from the flat file you are probably used to, and the practical query skills to get what you want out of one. The emphasis throughout is on structuring a query for extraction — it is not a course in designing databases, and it is not a course in big data methods.
Who this course is for
Beginners in data science who need to learn how to extract data from their relational databases — analysts who can do the statistics once the data is in front of them, but who currently have to ask somebody else to fetch it.
What you will learn
8 outcomes
By the end of this course, you will be able to:
- Understand the relational database file model, and how it differs from a flat file
- Load MySQL and read in .csv data
- Query a database to obtain the data you want
- Incorporate functions in queries
- Add filtering to queries
- Join tables
- Perform subqueries
- Understand the principles of an efficient SQL database
Week by week
4-Week curriculum overview
This curriculum is identical across all start dates. Expand a week to explore the topics covered.
- Weeks
- 4
- Your week
- Approx. 15 hours
- Level
- Introductory
Getting startedWeek 1
- Flat files — the spreadsheet model
- Relational databases (RDBMS), and how a table compares with an R data frame
- MySQL
- Reading in .csv data
- Introducing the airline data set
- A preview of the SQL commands
- Simple queries against the airline data — SELECT … FROM … LIMIT …
Basic SQL procedures and functionsWeek 2
- Functions in queries
- Aliases for column headers
- Operations on tables versus operations on results
- The WHERE clause
- GROUP BY and ORDER BY
- HAVING
- Wrangling dates
Joining tables and subqueriesWeek 3
- JOIN — left, right and cross
- Table aliases
- Subqueries
Efficient SQL databasesWeek 4
- Indices
- EXPLAIN
- Keys — primary, unique and foreign
- UPDATE
- INSERT
- CREATE TABLE
- ALTER TABLE
Instructors
Expert-Led Guidance
Each cohort is led by dedicated instructors and assistant teachers who actively lead weekly discussions, provide personalized feedback and grade your assignments.
Dr. Ben Baumer
Dr. Ben Baumer is the Director of the Statistical & Data Sciences Program at Smith College, and an Assistant Professor in the Program in Statistical & Data Program. He is a data scientist — his research and teaching is focused on extracting meaning from data. This interest is informed by both his graduate work, which focused on discrete mathematics and theoretical computer science, and his professional experience, where he served as the Statistical Analyst for the New York Mets from 2004 to 2012. Having extensive experience and training in mathematics, computer science, and statistics, Ben enjoys the interplay between these three fields, particularly in data science and network science. Ben is also knowledgeable about sabermetrics, sports analytics, applied statistics, statistical modeling, analysis of algorithms, combinatorial optimization, data visualization, graph theory, and combinatorics.
Before you start
What you need
Everything to have to hand before the first week. Open a row for the detail.
Course Format & Schedule
This is a 4-week, 100% online, asynchronous course.
- No mandatory live sessions: Log in and complete your work at times that fit your schedule.
- Weekly Releases: At the start of each week, you will receive new lecture materials and answer keys for the previous week's exercises.
- Interactive Community: Work through exercises, submit assignments, and engage with your instructor and peers via a private discussion board.
Homework
Short-answer questions testing conceptual understanding, and guided data wrangling projects using SQL, alongside practice exercises and assigned readings.
Texts
Step by step SQL instructions will be supplied in the course. The required text for this course is Modern Data Science with R. Note: The sections of the book we will use deal almost exclusively with SQL, although they will have occasional references to R. Lack of knowledge of R will not impede you in this course.
Software
We will use MySQL programming language. You will be provided with access to an online SQL editor (runs in a browser). No need to install any other software for the course.
FAQ
The text is a book about R. Do I need to know R?This course
No. Only the SQL sections of the book are used, and while they mention R here and there, nothing in the course requires you to write any. R turns up once more as a comparison in week one, because a database table and an R data frame are close enough that the analogy is worth drawing.
Does this cover designing a database, or big data tools?This course
Neither, deliberately. The course is about structuring queries to get data out. Week four looks at indices, keys and EXPLAIN so that you can tell why a query is slow and write one that is not — that is as close to database design as it goes, and big data platforms are a separate subject.
Is there a money-back or satisfaction guarantee?Every course
We handle cancellation and refund requests on an individual basis. If a course is not meeting your expectations or your circumstances change, please reach out to our team (support@learnstatistics.org) so we can work with you on a solution.
Can I transfer to a later start date or withdraw after the course begins?Every course
Yes. If you need to defer your enrollment to a future start date, withdraw mid-course, or transfer your seat to a colleague, please contact us directly. We address these requests flexibly on a case-by-case basis.
Who teaches the course?Every course
Each cohort is led by dedicated instructors and assistant teachers who actively lead weekly discussions, provide personalized feedback and grade your assignments.
Something not answered here? Ask us before you book — and the terms set out what a purchase covers.
Credit, and where it counts
This course carries a verified figure of 3 semester hours. A credit recommendation from the American Council on Education says what a course is worth; the institution receiving it decides whether to award it.
Anyone can take this subject: there is no application, and you do not have to be studying at a university. It also counts toward a degree at Thomas Edison State University, which decides what to award for it. The full position — including the limits each university publishes is on its own page, and worth reading before you buy.