Module 1: Introduction to SQL

Module Overview

Structured Query Language - the Lingua Franca of Data. Known (to varying degrees) by software engineers, data scientists, DevOps, and MBAs, SQL is the beginning (and sometimes entirety) of many data pipelines. Why is it universal? One reason is it is relatively simple - it is a declarative language, demanding what it wants by mere description, not worrying about the details of "how." SQL is a standard - all SQL distributions support a common core of functionality, and most add their own features or special syntax on top of it. For our purposes, we will focus on PostgreSQL, but most of what we learn will be general.

Learning Objectives

1. Write basic SQL queries to get specific subsets of data from a database and answer basic "business questions"

• Create and execute SELECT statements to retrieve data
• Use WHERE clauses to filter data based on conditions
• Apply basic SQL functions and operators
• Format query results for business reporting
• Understand database table structure and relationships
• Write queries to answer specific business questions

2. Understand the purpose of SQL joins and perform joins to access data from multiple tables

• Identify different types of SQL joins
• Write queries using INNER JOIN, LEFT JOIN, RIGHT JOIN
• Combine data from multiple related tables
• Understand table relationships and keys
• Use aliases to improve query readability
• Handle NULL values in joined queries

Guided Project

Sprint 10 Introduction to SQL Video

Guided Project File:

guided-project.md

Module Assignment

Please read the assignment.md file in the GitHub repository for detailed instructions

Assignment File:

assignment.md

Assignment Solution Video

Check for Understanding

Make sure you can answer the following questions about SQL fundamentals:

  • What is a relational database and how does it differ from other database types?
  • What are the main SQL commands and what does each one do?
  • How do you create a new table in a database?
  • What is the purpose of primary keys and foreign keys?
  • How do you filter data in a SQL query using the WHERE clause?

Additional Resources