# The SQL and Databases Guide

> Learn SQL and databases: database theory, SQL fundamentals like SELECT and joins, plus practical guides to PostgreSQL, SQLite and MySQL.

Author: Flavio Copes | Published: 2026-07-14 | Canonical: https://flaviocopes.com/sql/

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:

1. [What is a Database? And a DBMS?](https://flaviocopes.com/what-is-a-database/) defines the terms
2. [Relational Databases](https://flaviocopes.com/relational-databases/) explains the model behind SQL
3. [Introduction to the ER Data Model](https://flaviocopes.com/entity-relationship/) shows how to design your data
4. [Introduction to SQL](https://flaviocopes.com/sql-introduction/) is where the hands-on part begins
5. [Do you always need a database for your app?](https://flaviocopes.com/do-you-need-a-database/) is worth reading before you reach for one

## SQL fundamentals

The core operations, in the order you'll learn them:

- [SQL, creating a table](https://flaviocopes.com/sql-create-table/)
- [SQL, adding data to a table](https://flaviocopes.com/sql-insert-data/)
- [SQL, how to use SELECT](https://flaviocopes.com/sql-select/)
- [SQL, how to update data](https://flaviocopes.com/sql-update-data/)
- [SQL, how to delete data and tables](https://flaviocopes.com/sql-delete-data/)
- [SQL, Unique and Primary keys](https://flaviocopes.com/sql-unique-primary-keys/)
- [SQL Joins](https://flaviocopes.com/sql-joins/)
- [SQL Views](https://flaviocopes.com/sql-views/)
- [SQL, Handling empty cells](https://flaviocopes.com/sql-null/)

## PostgreSQL

Postgres is my recommendation for most projects. Start here:

- [Introduction to PostgreSQL](https://flaviocopes.com/postgres-introduction/)
- [How to install PostgreSQL on macOS](https://flaviocopes.com/postgres-how-to-install/)
- [How to create a PostgreSQL database](https://flaviocopes.com/postgres-create-database/)
- [PostgreSQL User Permissions](https://flaviocopes.com/postgres-user-permissions/)
- [Where to host a PostgreSQL database](https://flaviocopes.com/postgresql-where-to-host/)
- [How to use Supabase as your PostgreSQL hosting](https://flaviocopes.com/postgresql-supabase-setup/)

## SQLite and MySQL

SQLite is perfect for small apps and local development. MySQL is everywhere in existing projects:

- [How to install SQLite on macOS](https://flaviocopes.com/sqlite-how-to-install/)
- [How to create an empty SQLite database](https://flaviocopes.com/create-empty-sqllite-database/)
- [How to install MySQL on macOS](https://flaviocopes.com/mysql-how-to-install/)
- [PostgreSQL vs MySQL, a comparison](https://flaviocopes.com/postgres-vs-mysql/)

## Working with databases from code

Two topics that come up in every real project:

- [How to use Prisma](https://flaviocopes.com/prisma/) covers my favorite ORM for Node.js
- [How to store passwords in the database](https://flaviocopes.com/how-to-store-passwords/) is security you can't skip

## Go deeper

I collected the SQL fundamentals in the free [SQL Handbook](https://flaviocopes.com/ebooks/sql-handbook/). It's a compact reference you can read in an afternoon.

Every database post is on the [database tag page](https://flaviocopes.com/tags/database/).
