← All Kits · SQL Kit

Database Setup for Analysts: Which One, Installed How, and What to Do First

Michael Nocito · Updated August 2026 · Every number on this page was worked before it was published

Every analyst eventually needs a database of their own: somewhere to put a file that outgrew Excel, somewhere to practise, somewhere to keep a table that four spreadsheets currently disagree about.

What you do: pick by how fast you need to be querying, not by which name looks most professional on a CV. The SQL is nearly the same in all of them.

The short version. Start with SQLite. Add DuckDB when the files get big. Learn Postgres when a job asks for it.

The four options

OptionMinutes to first queryGenuinely forCost
SQLite5Learning, personal projects, one-file datasetsFree, no install on most systems
DuckDB5Analytical queries over large CSV and ParquetFree
PostgreSQL45Anything with users, or a real applicationFree, but it is a server
Hosted free tier15Sharing with someone else, or a portfolio pieceFree tier, then paid

SQLite

A database is a single file. No server, no account, no port. Python ships with it, so import sqlite3 works with nothing installed, and DB Browser for SQLite gives you a free graphical client if you would rather click than type.

The SQL is standard enough that everything you learn transfers. The things it does not have are the things a learner does not need yet: user accounts, concurrent writers, strict types.

DuckDB

Also a single file, also no server, and built for exactly the work analysts do: aggregate a lot of rows. It reads CSV and Parquet directly, so a large file can be queried before any import happens at all. If a file has beaten Excel, this is usually the shortest route to an answer, as in opening a large CSV.

PostgreSQL

A proper database server. Users, permissions, concurrency, extensions, and the closest free thing to what a company runs. It is the right choice if you are working towards analytics engineering, and it is more setup than a beginner needs on day one. Step by step in installing PostgreSQL.

A hosted free tier

Supabase, Neon, Railway and similar give you a Postgres instance in a browser. Useful when something else needs to reach the database, or when a portfolio project should have a live link. The cautions are the ordinary ones: free tiers pause or expire, and anything you upload leaves your machine, so nothing confidential goes there.

Almost nobody needs to install MySQL or SQL Server to learn. Both are excellent and both are servers, with the same setup cost as Postgres and no advantage for a person learning alone. Install the one your employer uses when your employer uses it.

The five-minute SQLite start

python
>>> import sqlite3
>>> con = sqlite3.connect('analysis.db')
>>> con.execute("CREATE TABLE orders(order_id INT, region TEXT, amount INT)")
>>> con.execute("INSERT INTO orders VALUES (101,'North',120)")
>>> con.commit()
>>> con.execute("SELECT COUNT(*), SUM(amount) FROM orders").fetchall()
[(1, 120)]

commit() is the line beginners miss. Without it the insert is not saved, and the table looks empty next time you connect.

For a graphical route: install DB Browser for SQLite, File, New Database, then File, Import, Table from CSV file. That covers the whole loop without typing any SQL, which is a reasonable way to start.

The first five things to do once it runs

  1. Load one real file you actually care about. Practice data teaches syntax; your own data teaches analysis. The load step is in loading your first CSV.
  2. Count the rows and compare with the source. Every project starts here.
  3. Check the types. A column of numbers imported as text will sort 100 before 20 and sum to nothing.
  4. Write five questions in English before writing any SQL, then answer them one at a time.
  5. Save the queries in a file, with comments. A query you cannot find again was practice, not work.

Where the data goes

Three habits that save a bad afternoon later:

How to apply this to your own work

  1. Install SQLite today and load one CSV you already use. Twenty minutes end to end.
  2. Add DuckDB the first time a file is too big for Excel, rather than the third time.
  3. Check the job adverts you are aiming at, and learn Postgres if they name it.
  4. Keep a queries file per project from the start, so nothing has to be rewritten from memory.
  5. Reconcile every load against a row count. It is the check that catches everything else.

The one habit to keep

Load your own data early. A database with practice data in it teaches syntax. A database with your own data in it starts answering questions somebody is asking you, which is the point at which the tool stops being homework.

What is the file you would load first, if you had a database this afternoon?

Written from the tools as they ship. Python includes sqlite3 in the standard library; DB Browser for SQLite, DuckDB and PostgreSQL are all free downloads.
The database that gets used is the one that was installed in ten minutes.

SQL for Analysts is 458 pages that read queries line by line in everyday words, so a result that came back wrong has somewhere to be traced instead of being retyped until it looks better.

SQL for Analysts, $19 →
Get a table in, then start asking questions.

Setting up a SQL database walks the SQLite route step by step, which database to install compares them further, and sample databases gives you data to practise on.

Set Up a SQL Database →