Store and query real data from Python with sqlite3 and the SQLAlchemy ORM, safely.
SQL Basics taught you how to ask a database for what you want. What it did not cover is who does the asking. In a real program the questions come from Python: a function needs the four cheapest tools, a form has just handed you a name to search for, a booking has to be written down and then unwritten because the borrower changed their mind. This course is that seam, and it is where a language and a database stop being two subjects. The first half uses sqlite3, the driver built into Python itself. You open a connection, run statements through a cursor, and read rows back as tuples and as dictionaries. Then comes the section that matters most: a query built by gluing user input into a string can be rewritten by anyone who types the right characters, and you will watch a search return every row in the table before you fix it with placeholders. After that, updating and deleting inside a transaction you can roll back. The second half is SQLAlchemy, the ORM most Python job listings name, where a table is a class, a row is an object, and a query is Python instead of a string. Everything is built on the Tool Library, a community shed that lends out power tools. It starts as one table of four tools, gains a lookup and then a search that cannot be injected, then loans that can be taken back when something goes wrong, then the same tools again as models with borrowers linked to them, and it finishes as a library you can load from a CSV file and export back out.
45 Lessons • 53 Practices • 18 Quizzes • 4 Projects · ~10h Total
Not just theory. You finish this course with real work to show.
This is the same in-browser editor every lesson uses. Edit the code, hit Run.
Run code in the browser and see the result immediately. Every lesson works this way.
Stuck? Puff explains the error and nudges you forward, without giving the answer away.
Streaks, diamonds, and certificates. Your progress saves automatically, forever.
Every completed course issues a certificate with a public verification link.
Every certificate has a public verification link employers can check.
One certificate per course. Finish a program and earn its program certificate too.
LinkedIn-ready, with a PDF you can download and attach.
You can write the query. This is how a program sends it, reads the answer, and handles the parts that go wrong.
Your data lives in CSV and JSON files that are getting slow and hard to search. A database is the next stop.
The models you write in the second half of this course become the pages of the web app in the next one.
Python Databases is free to start, no credit card needed. Some later sections are part of Pro, and finishing every section, including the certificate, needs a Pro plan.
Yes. Devpuff's Python Databases course teaches how Python talks to a database, not the query language itself, so SELECT, INSERT, WHERE, ORDER BY and JOIN are assumed from the first item and never re-taught. If you can read a query and say what it returns, you are ready. The Python side assumes the earlier courses in the Python Developer program, up to and including Python File Handling.
Yes. It is SQLite 3.39, the same database engine that ships inside Python, compiled to WebAssembly so it can run in a browser tab. The database file lives in that tab rather than on your hard drive, and everything else is unchanged: the same sqlite3 module, the same SQL, the same results. Code you write here runs against a file on a real disk without a single edit.
Both are taught here, in that order, and the honest answer is that most Python projects use an ORM and every Python developer still needs the driver. An ORM writes the SQL for you, which is a real saving until something is slow or wrong and the SQL is what you have to read. Starting with the driver also means you see the string-building problem that the security section is about, which an ORM hides rather than removes.
Because a browser tab cannot open a database socket, and PostgreSQL and MySQL are servers you reach over the network. Everything in this course that would change on a real server is one line, the connection details, and both halves of the course name that line where you meet it. Nothing else about the code changes.
The Tool Library, a lending shed for power tools, across four projects: a lookup that reads tools out of the database, a loan ledger that can undo a half-finished change, a borrower catalog written entirely through the ORM, and a capstone that loads a CSV file into related tables and exports a report back out.
Yes, for this course at 100 percent. It also counts towards the Python Developer program certificate, which issues once every course in that program is complete.
How this course connects to the bigger picture, and what to explore next.
Build a real web app with Flask: routes, templates, forms, JSON, and a database behind it.
Query real data with SQL: SELECT, filtering, sorting, joins, grouping, and the tables behind every app.
Write real Python in your browser: variables, strings, conditionals, loops, lists, and functions.
Free to start, no credit card required. Write real code from the first lesson and keep your progress forever.
Start Learning Free