SQL Guide
Opening the Dataset in SQL
The SQL guide is the practical starting point for students who want to work directly in the SQLite file. It shows the first tool, the first file, the first starter query, and the next move after a result set appears.
What File to Open
For SQL work, start with CharlesRiver.sqlite.
This file contains the dataset tables you need for joins, filters, summaries, and document tracing.
Recommended Tool: DB Browser for SQLite
The recommended starting tool is DB Browser for SQLite.
It works well for first-time SQLite work because it gives you:
- a simple install path
- a direct file-open workflow
- a visible table browser
- a built-in SQL editor
- a result grid that is easy to review and export
If you are new to SQLite, start here before moving to a more advanced tool.
How to Open the Dataset in DB Browser
- Download and install DB Browser for SQLite.
- Open DB Browser and choose
Open Database. - Select
CharlesRiver.sqlitefrom the files shared for your course. - Open the
Browse Datatab and inspect a few tables such asCustomer,SalesInvoice, orGLEntry. - Open the
Execute SQLtab so you are ready to paste a starter query.
At this point, you are ready to copy SQL from the analytics pages in the docs and run it against the dataset.
How to Run Your First Query
Start with this first-pass workflow:
- Open Financial Queries.
- In the starter SQL list, expand
Working-capital bridge by month. - Copy the SQL from the code block.
- Paste it into the
Execute SQLtab in DB Browser. - Run the query.
- Review the result grid and column names before you move on.
This gives you a complete first-use path: open the file, copy a real starter query, run it, and review a business result that already connects to a guided case.
How to Read the Result and Keep Going
After your first query runs, check four things before you write another one:
- the row grain: what one row represents
- the main dimensions: month, customer, item, cost center, or document
- the main measures: amount, quantity, hours, or count
- the business question: what the result explains
Then move to the next layer:
- stay on the topic page and run a second query in the same area
- open the paired case in Cases
- use Schema Reference when you need table and key help
- use GLEntry Posting Reference when the question reaches the ledger
The starter SQL is organized into three compact topic groups:
| Topic page | What it covers |
|---|---|
| Financial Queries | revenue, margin, working capital, accruals, payroll, close-cycle, and pricing review |
| Managerial Queries | budget, portfolio mix, labor, service levels, planning, replenishment, and pricing governance |
| Audit Queries | document-chain review, approvals, workforce controls, planning support, pricing governance, and anomaly review |
The topic pages surface these queries directly in the docs, so most students can work from the website without opening any repository folders.
Other Tools You Can Use
If you already use another SQL tool, the same workflow still works:
DBeaverSQLiteStudioVS Codewith a SQLite extension
Open CharlesRiver.sqlite, copy a starter query from the docs, run it, and review the result. DB Browser remains the recommended first tool because it is the simplest path for most students.
Secondary Workflows
If you prefer code-first work, you can also run copied starter SQL through Python or the sqlite3 command-line tool.
Python
import sqlite3
import pandas as pd
sql = """
-- paste a starter query copied from the docs here
SELECT *
FROM GLEntry
LIMIT 25;
"""
with sqlite3.connect("downloaded_dataset.sqlite") as connection:
df = pd.read_sql_query(sql, connection)
print(df.head())
sqlite3 CLI
sqlite3 downloaded_dataset.sqlite
Then paste a starter query copied from the docs into the prompt and run it directly.
Next Steps
- Use Financial Queries, Managerial Queries, or Audit Queries to choose your next query set.
- Use Cases when you want a guided business question after the first query.
- Use Excel Guide when you want to recreate a SQL result in the workbook.