Instructor(s): Filsan Musa, and Fadumo Diriye
This course serves as an introduction to Structured Query Language (SQL) for the aspiring data analyst, focusing on fundamental concepts and practical applications. The course is divided into two parts: the first part provides a foundational understanding of RDBMS, SQL, and access to databases, while the second part introduces applications of the SELECT statement, various functions, clauses, and operators. The course incorporates interactive video lectures, as well as weekly course exercises to reinforce learning.
There are no required prerequisites for this course.
- 1. Week 1: Introduction to the course
- a. Overview of material
- 2. Week 2: What is SQL?
- a. What is a database?
- b. What is a RDBMS?
- c. Define SQL
- d. What is an SQL flavour? Are there differences between different SQL flavours?
- 3. Week 3: Getting Started with SQL
- a. Register for SQLite Online
- b. Setting up the database
- c. Introducing the Chinook database
- 4. Week 4: What is in a SQL table?
- a. Tabular data storage
- b. Primary key
- c. Foreign key
- 5. Week 5: Understand SQL commands and components
- a. Types of SQL commands
- b. Components of a query
- 6. Week 6: What are the SQL data types?
- a. Understanding the data types
- i. Boolean
- ii. Numeric
- iii. String
- iv. Datetime
- b. Identifying the data type of a column, or in a table
- 7. Week 7: Constructing a Select Statement
- a. Selecting from a table
- b. Selecting one, multiple, or all columns
- c. Selecting distinct values from a column
- d. Using aliases
- 8. Week 8: Basic Aggregation Functions
- a. Count
- b. Sum
- c. Avg
- d. Min
- e. Max
- 9. Week 9: Basic Formatting Functions, and Keywords
- a. String Functions
- i. Lower()
- ii. Upper()
- b. Numeric Functions
- i. Floor()
- ii. Round()
- c. Datetime Functions
- i. Time(), Day(), Month(), Year()
- ii. Timestamp(), Date()
- iii. Current_Timestamp, Current_Time, etc.
- 10. Week 10: Limit, Order By, Group By
- a. Limit
- b. Order By
- i. Asc
- ii. Desc
- c. Group By
- 11. Week 11: Where & Having Clauses
- a. Where
- b. Having
- 12. Week 10: Logical & Comparison Operators
- a. And / Or / Between / In
- b. Not / Is (Not) Null
- c. Like
- d. Greater (Than) / Less (Than)
- e. Equality / Inequality
- 13. Week 13: Arithmetic Operators
- a. Addition
- b. Subtraction
- c. Product
- d. Division
- e. Modulo
- 14. Week 14: Use cases for the Case When statement
- a. Using case when w/ logical & comparison operators
- b. Using case when w/ arithmetic operators
- 15. Week 15: Introduction to Joins
- a. Left Join
- b. Right Join
- c. Inner Join
- d. Outer Join
- 16. Week 16: How to properly structure a Query
- a. Query Order
- b. Query Format
- c. Variable naming conventions
- d. Common Errors & Debugging
- e. Reference a Database
Course Material:
https://github.com/filsan95/Course-SQL_Fundamentals_for_Data_Analysis
Resources (Optional):
Oppel, A., & Sheldon, R. (2009). SQL A Beginner's Guide (3rd ed.). McGraw Hill. Retrieved from SQL: A Beginner's Guide
W3Schools. (n.d.). SQL Tutorial. Retrieved from W3Schools SQL Tutorial
The contents of this repository are licensed under the CC0 1.0 Universal. Please view the "LICENSE" file for further details.