PostgreSQL vs MySQL vs SQLite: Which Should You Learn?
How PostgreSQL, MySQL and SQLite differ, where each is used, the syntax differences that matter, and which one to learn first.
By Learn SQL Online ·
PostgreSQL, MySQL and SQLite all speak SQL, and the queries you’ll write most often (SELECT, WHERE, JOIN, GROUP BY) work the same way in all three. So the honest answer to “which should I learn?” is: learn SQL, using whichever one is in front of you, then pick up the differences when you need them.
Here’s how they differ, and where those differences actually show up.
At a glance
| PostgreSQL | MySQL | SQLite | |
|---|---|---|---|
| What it is | Full database server | Full database server | A database in a single file, built into the app |
| Typical use | Web apps, analytics, data engineering | Web apps, content management systems | Mobile and desktop apps, browsers, small sites, prototypes |
| Setup | Install and run a server, or use a hosted service | Install and run a server, or use a hosted service | Nothing to run: it’s a library |
| Known for | Standards support, advanced features, JSON, extensions | Wide hosting support, speed for simple workloads | Zero setup, tiny footprint, everywhere |
| License | PostgreSQL License (open source) | GPL open source, plus commercial editions from Oracle | Public domain |
PostgreSQL
PostgreSQL is a powerful, standards-focused database. It has rich data types (including JSON and arrays), strong support for window functions and CTEs, and a large ecosystem of extensions. It’s a common choice for new web applications and for analytics work. If you’re aiming for data analyst or data engineering roles, you’re likely to meet it.
MySQL
MySQL powers a huge number of websites, including many built on WordPress. It’s simple to host and fast for typical web workloads. MariaDB is a closely related fork with very similar syntax. Modern MySQL (version 8 and later) supports CTEs and window functions, which older versions lacked.
SQLite
SQLite isn’t a server at all: the whole database is one file, read and written by a small library inside your application. It runs in phones, browsers and countless desktop apps, which makes it one of the most widely deployed databases in the world. It’s ideal for learning, because there’s nothing to install or configure. Learn SQL Online’s lessons run on SQLite in your browser for exactly that reason.
The syntax differences that actually matter
Day-to-day differences are small and mostly about functions:
| Task | PostgreSQL | MySQL | SQLite |
|---|---|---|---|
| Join text | a || b |
CONCAT(a, b) |
a || b |
| Case-insensitive match | ILIKE |
LIKE (default collation) |
LIKE (English letters) |
| Today’s date | CURRENT_DATE |
CURRENT_DATE |
date('now') |
| Format a month | TO_CHAR(d, 'YYYY-MM') |
DATE_FORMAT(d, '%Y-%m') |
strftime('%Y-%m', d) |
| Auto-increment id | GENERATED ALWAYS AS IDENTITY |
AUTO_INCREMENT |
INTEGER PRIMARY KEY |
| Insert or skip | ON CONFLICT DO NOTHING |
INSERT IGNORE |
ON CONFLICT DO NOTHING |
The core of every query is identical. This runs unchanged on all three:
SELECT category, COUNT(*) AS products, ROUND(AVG(price), 2) AS avg_price
FROM products
GROUP BY category
ORDER BY avg_price DESC;
| category | products | avg_price |
|---|---|---|
| electronics | 4 | 93.75 |
| office | 3 | 93 |
| stationery | 3 | 6.83 |
Our tutorials note dialect differences where they matter, for example in string functions, date functions and LIMIT.
Which should you learn first?
- Just starting out: any of them. SQLite or an in-browser course gets you writing queries in minutes, with no setup.
- Aiming for analyst or data roles: learn standard SQL, then spend a little time with PostgreSQL, which many analytics teams use.
- Building websites: use whatever your hosting or framework favours; often PostgreSQL or MySQL.
- Building mobile or desktop apps: SQLite.
Whichever you choose, the skills transfer. Someone fluent in JOIN, GROUP BY and window functions on one database can be productive on another within a day.