We may earn an affiliate commission when you visit our partners.
Andy Bek

Welcome to the best resource online for learning to work with SQL in python.

Python and SQL are two of the most in-demand skills in any data-related or data-adjacent role today.

In this course, we'll use SQLite, MySQL and PostreSQL to build three projects of increasing complexity that will give you a solid foundation in using SQL in python applications.

Over 17 hours and 50 coding assignments, you will gain practical mastery of, not only SQL and python, but also tens of programming and computer science concepts.

Read more

Welcome to the best resource online for learning to work with SQL in python.

Python and SQL are two of the most in-demand skills in any data-related or data-adjacent role today.

In this course, we'll use SQLite, MySQL and PostreSQL to build three projects of increasing complexity that will give you a solid foundation in using SQL in python applications.

Over 17 hours and 50 coding assignments, you will gain practical mastery of, not only SQL and python, but also tens of programming and computer science concepts.

In building these projects, you won’t be copy/pasting code. Instead, we will be writing code from scratch, and we will be writing lots of it.

This "forced" practice will help solidify your understanding of the concepts and techniques we cover. Each assignment will be followed by a detailed solution and explanation.

By the end of the course, after 3 immersive days, SQL and python will be on your resume.

––––– Structure & Curriculum –––––

· Day 1: SQLite

· understanding connections, cursors, transactions in sqlite3

· parameterizing and executing queries

· understanding and preventing SQL injections

· introduction to DBAPI

· building the Freight Manager (9 coding assignments)

· Day 2: MySQL

· revisiting connections, cursors, transactions with mysql-connector

· building prepared statements

· exploring dictionary, buffered and namedtuple cursors

· building the School Registrar (19 coding assignments)

· Day 3: PostgreSQL

· revisiting connections, cursors, transactions with psycopg2

· generating dynamic SQL from python code

· building the Guestbook API (22 coding assignments)

· with object oriented programming, password hashing, and more

This is the ultimate, immersive introduction to two of the most valuable skills today.

I'll see you inside.

Enroll now

What's inside

Learning objectives

  • Work with sql databases confidently in python applications
  • Build and deploy a web-based api using fastapi and postgresql
  • Understand cursors, transactions, connections, and query execution in depth
  • Explore more advanced topics around dynamic sql generation, prepared statements, and non-tuple cursors

Syllabus

Day 0 - Two Minute Welcome
2-min Introduction
All Course Resources - Lectures + Project Challenges
Day 1 - Freight Manager
Read more
Section Overview
Lecture Resources
Introduction to SQLIite
sqlite3 In Python
DBAPI 2.0
Connections And Cursors
Inserts
DML vs DDL (and DCL and DQL)
Fetching
Column Names Would Be Nice
The Transaction Lifecycle
Parameterized Statements
A Different Flavor
Various Ways To Execute
Database Dump
Context Managed Connections
Let's Build!
Project Resources - All Solution Challenges
Creating A Virtual Environment
Challenge 1 - Interface
The Interface
Sketching Out The Basics
Challenge 2 - DDL
Executing the DDL
Foreign Key Gotcha
The Add Box Menu
Challenge 3 - Add Box To Database
Add Box Helper
Challenge 4 - Displaying Box Types
Displaying All Boxes
A Prettier Display
Challenge 5 - Loading Boxes With Validation
Load Box Menu
The Containers Database View
Container Constraints
The Final Stretch
Quick Note
Challenge 6 - Seed Data
Seeding Some Boxes
Challenge 7 - Containers
Displaying Containers
Business Summary
The Bottom Line
Challenge 9 - Configurable Constants
Refactoring Configuration
Day 2 - Course Registrar
Welcome To MySQL
Local Vs Cloud MySQL
Connecting From Python
URL Parsing
Cursors Again
Context Managers Revisited
Parameterized Inserts
Prepared Statements
Let's Fetch
Buffering
Dict Cursors
A Named Alternative
.executescript() Please?
Best: Multi With Autocommit
Project Resources - All Challenge Solutions
Setting Up
Challenge 1 - Connection Helper
Writing The Helper
Challenge 2 - Prepare The DDL
Wiring Up The DDL
Challenge 3 - The Reset Command
Resetting The Database
Challenge 4 - Add Student
Adding New Students
Challenge 5 - Add Course
Adding New Courses
Challenge 6 - Prerequisites
Prereq DDL And Command
Addressing A Small Inconsistency
Challenge 7 - Querying
The Query Helper
Challenge 8 - Seeding Data
Initializing Data
—no-with-data
Challenge 9 - Show Prerequisites For Course
Displaying Prereqs
Pretty Tables
Challenge 10 - Show Students And Courses
Displaying Students And Courses
Challenge 11 - Course Enrollment Part I
Naive Enrollment
Challenge 12 - Grading
The Grade Command
Challenge 13 - Course Enrollment Part II
Prereq-aware Enrollment
Hiding Internals, Colorizing Externals

Save this course

Save Practical SQL With Python In 3 Days: Beginner to Pro to your list so you can find it easily later:
Save

Activities

Coming soon We're preparing activities for Practical SQL With Python In 3 Days: Beginner to Pro. These are activities you can do either before, during, or after a course.

Career center

Learners who complete Practical SQL With Python In 3 Days: Beginner to Pro will develop knowledge and skills that may be useful to these careers:

Reading list

We haven't picked any books for this reading list yet.
Using a unique and engaging approach, this book introduces SQL concepts through real-world examples and hands-on exercises. It is suitable for beginners seeking a practical understanding of SQL.
Written in a clear and concise style, this book provides a step-by-step guide to writing effective SQL queries. It is particularly helpful for beginners who want to master the basics of SQL.
This practical guide offers a collection of ready-to-use SQL recipes for various data manipulation and analysis tasks. It is valuable for experienced SQL users who want to expand their knowledge and solve specific problems.
This specialized book focuses on the critical topic of SQL injection attacks and defense mechanisms. It is relevant for individuals concerned with data security and protecting databases from malicious attacks.
This user-friendly guide introduces SQL concepts in a simplified and accessible manner. It is suitable for absolute beginners who want to gain a basic understanding of SQL.
This concise guide offers a crash course in SQL, covering the basics within a limited time frame. It is suitable for beginners who need a quick introduction to SQL.
This concise and practical reference provides a quick overview of SQL syntax and commands. It valuable resource for experienced SQL users who need a handy reference guide.
This advanced book delves into complex SQL concepts and techniques. It is suitable for experienced SQL users who want to expand their knowledge and tackle challenging data manipulation and analysis tasks.
Practical guide to using Python for basic automation tasks, providing a gentle introduction to Python's core concepts and its practical applications.
Comprehensive guide to the basics of Python programming, covering data types, control flow, functions, object-oriented programming, and debugging.
Comprehensive guide to Python's data analysis ecosystem, including NumPy, Pandas, and Matplotlib, with a focus on practical applications.
Comprehensive guide to deep learning using Python, covering neural networks, convolutional neural networks, and recurrent neural networks.
Concise and comprehensive reference to the Python language, covering syntax, built-in functions and objects, and advanced topics.
Comprehensive guide to the Python Standard Library, covering its vast collection of modules and their applications.
This comprehensive guide covers all aspects of SQL, from basic concepts to advanced techniques. It is especially relevant for individuals seeking a thorough understanding of SQL for data analysis and reporting.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser