Learn How Apps Talk to Databases, From Zero
DatabaseIntegrate.org is a free, non-commercial classroom for people writing their first database-backed app. Maybe you have built a page or a script that works, and now you need it to remember things. Maybe a bootcamp has just introduced SQL and it felt like a lot at once. Either way, this site takes things slowly: one idea per page, a picture where it helps, and a tiny piece of code you can run yourself. This hub is the map of the classroom. It groups the lessons into six clusters, in the order most beginners find easiest.
You do not need to read everything. Each cluster starts with the lesson to read first, and later lessons in a cluster build on earlier ones. If a word is unfamiliar, the beginner glossary explains it in plain English. There are no paid courses here and nothing to sign up for.
A tip before you start: keep a practice database open while you read. SQLite is ideal because it is a single file and needs no server, and every lesson's example can be typed into it in a minute. Reading about a JOIN is useful; watching one return the rows you predicted, or surprise you, is how it actually sticks. If something breaks, that is part of the lesson too, and cluster 4 explains the most common errors.
Two new lessons for this hub
We wrote two longer lessons to sit at the centre of the classroom. The first explains the site's five-step learning path and what you should be able to do at the end of each step. The second takes a small app idea, a recipe box, and turns it into a first set of tables, showing every decision along the way.
- The five-step learning path, explained step by step
- From an app idea to your first tables: planning a small schema
Cluster 1: What a database is
Start here if the word "database" still feels vague. These lessons explain what a database does that a text file cannot, how relational and NoSQL databases differ, and which beginner-friendly database to install first.
- A six-part beginner course on what a database is
- Why your app should not just save to a text file
- A plain guide to relational and NoSQL databases
- SQLite, PostgreSQL or MySQL for a first project?
- How to create your first SQLite database
Cluster 2: Tables, rows and keys
Everything in a relational database lives in tables. These lessons cover rows and columns, data types, primary keys that identify each row and foreign keys that link tables together.
- Practice unit: tables, rows and columns
- Understanding SQL data types as a beginner
- Practice session: picking a good primary key
- How to add a foreign key between two tables
- A picture guide to keys linking two tables
- NULL explained: the value that means unknown
Cluster 3: Asking questions with SELECT
Once data is stored, you need to get it back. This cluster introduces SELECT, filtering with WHERE, sorting, grouping and joining tables, one small step at a time.
- SELECT queries in five short modules
- Training notes on WHERE and ORDER BY
- Quick answers on GROUP BY and COUNT
- INNER JOIN and LEFT JOIN, one small step at a time
- Watching a SELECT query run, step by step
Cluster 4: Connecting your app
This is where the site's name comes from. These lessons show how an app talks to a database through a driver, how to write a connection string, and how to perform create, read, update and delete operations from your own code.
- How an app talks to a database, in pictures
- How to connect a Python script to SQLite
- Reading a connection string piece by piece
- How to keep a connection string in an environment variable
- A four-week plan for CRUD from your own code
- Diagnosing your first "can't connect" error
Cluster 5: Staying safe
Beginners' apps are a common target for SQL injection, and it is easy to prevent once you know how. This cluster explains the attack, shows the fix with placeholders and covers other safe habits such as backups.
- SQL injection on one page
- Break and fix a login form: SQL injection hands-on
- How to use placeholders in Node.js queries
- Back up your practice database before experiments
Cluster 6: Designing tables well
When your app grows, table design starts to matter. These lessons introduce normalisation, relationships between tables and how far to take design rules in a first project.
- Inside normalisation: why we split data up
- One-to-many and many-to-many, drawn out
- How far to normalise a first project
- Constraints as safety rails: NOT NULL, UNIQUE, CHECK
When you are ready for more
After working through these clusters, you will be able to design a small set of tables, query them and connect them safely to an app. That is a real milestone. When your app starts to feel slow or you want to learn about indexes and query plans in depth, our sister site for working developers, databaseintegrate.com, picks up where this classroom ends. Until then, take your time. Every expert started with a single table.
Questions beginners ask next
Once your first tables are working, three questions tend to come up: how to remove data safely, how to keep users' passwords safe, and how to combine results from two queries. Each lesson answers one question with a small example you can run.
- DELETE vs TRUNCATE vs DROP: what each one removes
- How should an app store passwords in a database?
- UNION vs UNION ALL: stacking two query results
How these lessons are written and checked is explained in our editorial standards.