The SQL and Databases Guide
By Flavio Copes
Learn SQL and databases: database theory, SQL fundamentals like SELECT and joins, plus practical guides to PostgreSQL, SQLite and MySQL.
Almost every app needs to store data. And when it does, chances are there’s a database behind it, and SQL is how you talk to it.
SQL has been around for decades. It survived every hype cycle because it works. Learn it once and you’ll use it for the rest of your career.
This page organizes my database tutorials into a learning path: theory first, then SQL fundamentals, then the specific databases you’ll actually use.
Where to start
A little theory goes a long way. These posts explain what a database is and how relational databases think:
- What is a Database? And a DBMS? defines the terms
- Relational Databases explains the model behind SQL
- Introduction to the ER Data Model shows how to design your data
- Introduction to SQL is where the hands-on part begins
- Do you always need a database for your app? is worth reading before you reach for one
SQL fundamentals
The core operations, in the order you’ll learn them:
- SQL, creating a table
- SQL, adding data to a table
- SQL, how to use SELECT
- SQL, how to update data
- SQL, how to delete data and tables
- SQL, Unique and Primary keys
- SQL Joins
- SQL Views
- SQL, Handling empty cells
PostgreSQL
Postgres is my recommendation for most projects. Start here:
- Introduction to PostgreSQL
- How to install PostgreSQL on macOS
- How to create a PostgreSQL database
- PostgreSQL User Permissions
- Where to host a PostgreSQL database
- How to use Supabase as your PostgreSQL hosting
SQLite and MySQL
SQLite is perfect for small apps and local development. MySQL is everywhere in existing projects:
- How to install SQLite on macOS
- How to create an empty SQLite database
- How to install MySQL on macOS
- PostgreSQL vs MySQL, a comparison
Working with databases from code
Two topics that come up in every real project:
- How to use Prisma covers my favorite ORM for Node.js
- How to store passwords in the database is security you can’t skip
Go deeper
I collected the SQL fundamentals in the free SQL Handbook. It’s a compact reference you can read in an afternoon.
Every database post is on the database tag page.
Related posts about database: