- DB Browser for SQLite is installed on this computer — your teacher has done this for you. You do not need to install anything yourself.
-
You have the database file for your current lesson — download it from the lesson page. The file will be named something like
films.sql. - You know where it saved — by default, downloads go to your Downloads folder. Keep that in mind for Step 4.
Setup steps
Open DB Browser for SQLite
DB Browser for SQLite is already installed. Here is how to find and open it on Windows 11:
-
a
Click the Start button — the Windows logo icon in the centre of your taskbar at the bottom of the screen.
-
b
Start typing DB Browser — you do not need to click a search box first, just start typing and Windows will search automatically.
-
c
You will see "DB Browser for SQLite" appear in the results. Click it once to open it.
Recognise the DB Browser window
When DB Browser opens, it will look something like this — mostly empty until you import a database:
The four tabs you will use in this unit:
- Database Structure — shows your tables and their fields. Start here to check the import worked.
- Browse Data — shows the actual data in each table, row by row.
- Execute SQL — where you will type and run SQL queries from DDD5 onwards.
- Edit Pragmas — settings you won't need to change.
Download the database file from your lesson page
Go to your current lesson page (e.g. DDD1) and click the Download database file button near the top of the lesson. The file will save to your Downloads folder automatically — you will navigate to it in the next step.
.sql file, not a .txt file.
Import the SQL file into DB Browser
This creates a new database from the SQL file. You only do this once per file.
-
a
In DB Browser, click File in the menu bar at the top.
-
b
Hover over Import — a submenu slides out to the right.
-
c
Click Database from SQL file…
-
d
A standard Windows Open dialog appears. Navigate to your Downloads folder (look in the left panel of the dialog under "This PC"). Click the
.sqlfile once to select it, then click Open. -
e
A Save As dialog now appears — DB Browser is asking where to save the new database file (
.db). Navigate to your H drive > N5 Computing Science > Databases folder. Name the file films and click Save. -
f
DB Browser may show a small message saying "Import completed" or similar. Click OK to dismiss it.
.sql. If the file picker shows "All Files (*.*)" in the file-type dropdown, change it to show SQL files, or make sure you can see the file extension in the filename.
Check the import worked — Database Structure tab
After importing, you should be taken straight to the Database Structure tab. If not, click it now.
You should see two tables listed:
-
a
If you see Tables (2) with
directorandfilmlisted underneath — the import worked. Move on to Step 6. -
b
Click the small triangle (▶) next to a table name to expand it and see its fields listed below.
-
c
If you see 0 tables or nothing at all — the import did not work. Go back to Step 4 and try again, or raise your hand.
films.db file is now saved on your H drive in H: › N5 Computing Science › Databases. Next lesson, open DB Browser and use File > Open Database to re-open it from there — you do not need to import the SQL file again.
Browse the data
Click the Browse Data tab to see the actual data in the tables.
-
a
At the top of the Browse Data tab there is a Table dropdown. Click it to switch between
directorandfilm. -
b
The
directortable should show 15 rows (one per director). -
c
The
filmtable should show 52 rows (one per film). You may need to scroll right to see all 8 fields. -
d
Some cells in the
runtime_minscolumn will show NULL — this is intentional and is something you will learn about in DDD1.
A quick look at the Execute SQL tab (you'll use this later)
Click the Execute SQL tab. You won't use this until DDD5, but it is worth knowing what it looks like:
- The large text area in the middle is where you type SQL queries.
- The Run button (a blue triangle ▶, or press F5) executes whatever you have typed.
- Results appear in the panel below the text area.
- If your query has an error, a red error message will appear at the bottom instead of results.
Troubleshooting
.sql file using File > Open SQL in that tab, and press F5 to run it..sql file (not the .db file you created in a previous attempt). If the problem persists, raise your hand..sql file again from the lesson page and repeat the import.