liveBook · Manning

SQLite

As explained in Grokking Statistics

SQLite is a self-contained, serverless relational database engine that stores an entire database in a single file.

SQLite is a relational database that requires no server and can be set up in seconds. It stores data for SQL queries and local analysis. section 10.5

It makes data retrieval more self-service: instead of waiting for someone else to extract records, you can query tables directly with SQL. section 10.5

Useful SQL operations include:

  • SELECT and WHERE retrieve selected columns and records. section 10.5
  • GROUP BY, ORDER BY, and CASE organize and transform query results. section 10.5
  • INNER JOIN, LEFT JOIN, subqueries, common table expressions, and windowing functions connect or extend analyses. section 10.5

A local data workaround

When a vendor connection repeatedly timed out, batches were downloaded to SQLite with Python. The script resumed from the last completed batch, eventually producing a local database that the team could use daily. section 10.13

import urllib.request
import sqlite3
import pandas as pd

db_url = 
"https://github.com/thomasnield/training-data-repository/raw/refs/heads/main/storm_chasers.db"

urllib.request.urlretrieve(db_url, 'storm_chasers.db')
conn = sqlite3.connect('storm_chasers.db')

sql = "SELECT * FROM TORNADO_TRX"
df = pd.read_sql(sql, conn)

print(df)

Download a SQLite database, connect with Python, query a tornado-transaction table, and load the results into pandas. section 10.5

How Grokking Statistics covers it

How deep it goes
Introduces SQLite’s role and basic workflows but stops short of database internals or detailed implementation guidance.
Examples
Uses a flight-schedule query, a pandas tornado database workflow, and a resumable batch-download workaround.
What you can do after
Apply it via Python and SQL to retrieve data, load results into pandas, and build simple local workflows.
How it connects
Connects SQLite with SQL, relational databases, Python, pandas, data pipelines, dashboards, and scheduled processes.

Also explained in

Compare how 15 books explain SQLite →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Statistics. The section links point to the parts of the book it draws on.