← All Kits · SQL Kit

How to Set Up a SQL Database for Beginners

Free tools, no server, about 15 minutes · Part of the Analyst Prep Kit

You downloaded a dataset as a CSV file. Every SQL tutorial assumes your data is already "in a database." Nobody explains the step in between. This guide is that step: you'll create your first real database on your own computer, load your CSV into it, and run your first query — using two free tools and zero server setup.

What you'll do
  1. Understand what you're actually building (60 seconds)
  2. Install DB Browser for SQLite (free)
  3. Create a database file
  4. Import your CSV as a table
  5. Verify the import with one query
  6. Fix the two most common import problems

First: what are you actually building?

A database sounds like a big scary server in a data center. For learning and portfolio projects, it isn't. With SQLite, a database is just one file on your computer — like mygames.db sitting in your Documents folder. Inside that file live one or more tables, and a table is just a grid of rows and columns, like a spreadsheet sheet.

So the whole job is: make the file, put your CSV inside it as a table, confirm nothing got lost. That's it.

Why SQLite and not MySQL or Postgres? Those need a server installed and running before you can do anything. SQLite needs nothing — and the SQL you write on it (SELECT, WHERE, JOIN, GROUP BY) is the same SQL you'll use on the job. Start here; switch later if a job requires it.

Step 1 — Install DB Browser for SQLite

Where you'll type everything in this guide is a free desktop app called DB Browser for SQLite. It gives SQLite a friendly point-and-click window plus a tab where you can type SQL.

  1. Go to sqlitebrowser.org/dl
  2. Download the installer for Windows or Mac and run it (all defaults are fine)
  3. Open the app — you'll see a mostly empty window with buttons like New Database and Open Database

Step 2 — Create your database file

  1. Click New Database (top-left)
  2. Pick a folder you can find again, name the file something like portfolio.db, click Save
  3. A "Create Table" dialog pops up — click Cancel. You don't need it; the CSV import in the next step builds the table for you.

That's a real database. It's empty, but it exists — one file, no server.

Step 3 — Import your CSV as a table

  1. In the menu: File → Import → Table from CSV file…
  2. Pick your CSV file
  3. In the import dialog:
    • Table name: give it a name ending in _raw, like steam_games_raw. The _raw suffix is an analyst habit: it marks this table as the untouched original. Any cleaning happens later, in a copy — never in the original.
    • Tick "Column names in first line" — otherwise your header row gets imported as a data row.
  4. Click OK, then press Ctrl+S (Cmd+S on Mac) to save the database. DB Browser doesn't write changes to the file until you save.
Working with a large dataset? If your file is hundreds of MB, has millions of rows, or won't open in Excel, the import takes longer and needs a couple of extra tricks (unzipping, indexing, sampling). See How to Handle Large Datasets.

Step 4 — Verify it with your first query

Click the Execute SQL tab. This is where you type SQL from now on. Type this and press the ▶ (play) button:

SELECT COUNT(*) FROM steam_games_raw;

It returns one number: how many rows are in your table. Compare it to the row count of the source CSV (open the CSV in Excel and check the last row number, minus 1 for the header). If they match, every row arrived. Then eyeball a few rows:

SELECT * FROM steam_games_raw LIMIT 10;

If the columns look right and the count matches — you're done. You have a working SQL database, and every SQL lesson you take from here on applies to your own data.

The two problems that bite everyone once

1. Numbers imported as text

If a price column contains values like $4.99 or 1,299, the dollar sign and comma force it to import as TEXT — and SUM(price) returns garbage. The fix is to clean those values into a new numeric column (in a new table — never edit the _raw one). The SQL Kit's cleaning lessons cover exactly this.

2. Row count doesn't match

Off by exactly one? You probably forgot "column names in first line." Off by more? The CSV likely has quoting or delimiter problems (commas inside un-quoted text fields are the classic). Re-check the separator and quote settings in the import dialog.

Cheat sheet

StepWhereAction
Create databaseDB BrowserNew Database → save a .db file → Cancel the table dialog
Import CSVFile menuImport → Table from CSV → name it something_raw → tick "column names in first line"
SaveDB BrowserCtrl+S — changes aren't in the file until you save
VerifyExecute SQL tabSELECT COUNT(*) vs the CSV's row count, then LIMIT 10 to eyeball

Same idea, bigger databases

On the job you'll meet MySQL (LOAD DATA INFILE) and Postgres (COPY). The tools change; the workflow you just learned doesn't: create → import → verify, and keep an untouched _raw copy.

And if the file itself is huge (millions of rows, gigabytes on disk), the same database still works, you just add a few habits: see How to Handle Large Datasets.

Now make the SQL itself second nature.

The free SQL Kit teaches SELECT, WHERE, JOIN, and GROUP BY with worked examples, practice, flash cards, and a mock exam — all in your browser, nothing to install.

Open the SQL Kit →