Skip to content

Hidden Tables

You'll find the SQLite databases already sitting on your computer, in your browser, your photo library and your chat apps, copy one, and ask it what it knows about you.

About

SQLite is the most widely installed database there is, and you already have dozens of them. Firefox keeps your history in places.sqlite, Chrome in a file called History, Apple Photos and Messages in their own .db files, and most phone apps carry one around. Opening a copy is harmless and allowed when it's your own account on your own machine (a work laptop is not yours, so leave it alone), and it's the fastest way to see that databases aren't an abstraction. Always work on a copy, because the app holds the original open and locked, and never post a screenshot with URLs, names or message text in it. What counts is a database you found rather than made, and queries that answer something about your own habits.

At a glance

Per requirement
15 XP
Completion bonus
75 XP
Requirements
5
Takes
One evening
Skill level
Beginner (done it a few times)
Cost
Free
Supplies
Nothing special
Where
At home
Other people
On your own

Requirements

  1. 1
    Find three SQLite files on your machine and write down where each one lives. On a Mac, look in ~/Library/Application Support under Firefox or Google/Chrome, and in ~/Library/Messages. On Linux, try ~/.mozilla and ~/.config. On Windows, %APPDATA% and %LOCALAPPDATA%. The file command on Mac or Linux prints 'SQLite 3.x database' for any file you suspect, and on Windows the first 16 bytes of the file in any hex viewer read 'SQLite format 3'. Take a screenshot of the three paths with the file type confirmed. Photo
  2. 2
    Copy one of them to a working folder and open the copy read-only. The app has a lock on the original, and poking the original while it's running can corrupt it, so copy first. Then open the copy in DB Browser with the Read Only box ticked, or with sqlite3 -readonly. Take a screenshot of the table list of the copy. Photo
  3. 3
    Read the schema and sketch how three of the tables relate. The .schema output or the Database Structure tab shows you columns you'd never guess were there. Browser history, for example, keeps URLs in one table and visits in another, so a page you opened 400 times is one row in the first and 400 in the second. Draw the boxes and the lines between them on paper. Take a photo of the sketch. Photo
  4. 4
    Write a query with a join that tells you something about your own habits. Most visited sites per month, the hour of the day you message most, the week you took the most photos. You'll meet a timestamp in a strange unit: Chrome counts microseconds since 1601 and Firefox microseconds since 1970, and a search for the app name plus 'timestamp sqlite' gives you the conversion. Take a screenshot of the query and an aggregated result with no URLs, names or message text in it. Photo
  5. 5
    Post one aggregated result and say what surprised you. Screenshot the sorted table, or export it and chart it in a spreadsheet if you'd rather. Post it with two sentences on what you expected and what the table said instead. Photo