Shalynne Orth's professional Python project: relational data and SQL analytics. This project uses SQLite, SQL, Python, and a reactive Marimo app to explore relationships among data stored in multiple tables.
Notebooks combine narration and code. This project works on related tabular data files using SQL and Python. It includes a reactive marimo app for interacting with the related data.
Note: With marimo, analysts can build interactive web apps! It's a whole new skill set, and not easy, but it does create engaging reports that showcase your analytic skills.
We've mostly worked with data stored in files. Organizations often keep larger collections of related data in databases, where we can ask for the information we need instead of loading everything at once.
In this project, we'll use SQL to ask questions of data stored in a database. We'll select useful records, filter and organize results, summarize groups, and combine related information so it can be used in further analysis.
This project is a MovieLens rating explorer created by Shalynne Orth. It uses SQLite, SQL, Python, and a reactive Marimo app to answer this question:
Which movies have the highest average user ratings when they have enough ratings to make the result meaningful?
The project loads two related CSV files:
movies.csvcontains one record per movie, including its title and genres.ratings.csvcontains one record per user rating.
SQL joins the tables using movieId, calculates each movie's average rating,
counts its ratings, and returns the top ten movies that meet a user-selected
minimum rating-count threshold.
From the project root folder in a VS Code terminal:
uv sync
uv run marimo run src/datafun/movies_notebook.pyOpen the local URL shown in the terminal. Use the slider to select a minimum number of ratings and watch the table and bar chart update automatically.
The notebook source is available in
src/datafun/movies_notebook.py.
At a minimum of 50 ratings, The Shawshank Redemption (1994) had the highest average user rating: 4.43 out of 5 from 317 ratings.
| Movie | Rating count | Average rating |
|---|---|---|
| The Shawshank Redemption (1994) | 317 | 4.43 |
| The Godfather (1972) | 192 | 4.29 |
| Fight Club (1999) | 218 | 4.27 |
When I increased the threshold from 50 to 100 ratings, Dr. Strangelove, Cool Hand Luke, and Rear Window no longer qualified because they had fewer than 100 ratings. They were replaced by movies supported by more user ratings.
This shows that the rating-count threshold changes the evidence required for a movie to appear in the ranking. A higher threshold favors results supported by a larger amount of audience feedback, although it does not prove that one movie is objectively better than another.
This project uses the MovieLens Latest Small Dataset. The dataset is used for educational analysis and includes movie information and user rating activity.
Before applying the project to MovieLens data, I changed the retail example's
SQL query and chart to sort stores from fewest employees to most employees.
This helped me learn how an SQL ORDER BY clause changes how results are
prioritized and interpreted.
- data/ - raw CSV input files
- artifacts/ - generated database files, logs, or reports
- docs/ - project narrative and documentation
- src/datafun/ - project logic
- zensical.toml - update documentation site metadata
Follow the step-by-step workflow guide carefully.
Challenges are expected. Sometimes instructions may not quite match your operating system. When issues occur, share screenshots, error messages, and details about what you tried. Working through issues is part of implementing professional projects.
The MovieLens Explorer runs successfully when Marimo opens a local URL, displays the rating-count slider, and updates the table and bar chart.
The commands below are used in the workflow guide above. They are provided here for convenience.
Follow the guide for the full instructions.
Show command reference
Open a machine terminal in your Repos folder,
change directory (cd) into the new folder,
and run code . to open only this example project in VS Code:
git clone https://github.com/ShayO47/datafun-05-sql
cd datafun-05-sql
code .These are listed for convenience. For best results, follow the detailed instructions in pro-analytics-02 guide.
Use VS Code menu option Terminal / New Terminal to open a VS Code terminal
in the root project folder.
Copy each command, paste into your terminal, and hit ENTER,
to run each command one at a time.
uv self update
uv python pin 3.14
uv python install
uv lock --upgrade
uv sync
uv run pre-commit install
uv run pre-commit autoupdate
git add -A
uv run pre-commit run --all-files
# repeat if changes were made by pre-commit tasks
git add -A
uv run pre-commit run --all-files
# run the Python module (optional - marimo is the main goal of this project)
uv run python -m datafun.app
# run marimo nb as a reactive app
# press Ctrl + C in the terminal to exit
uv run marimo run src/datafun/movies_notebook.py
# Or: run marimo nb as a notebook
uv run marimo edit src/datafun/movies_notebook.py
# do chores
uv run ruff format .
uv run ruff check . --fix
uv run ty check
uv run python -m pytest
uv run python -m zensical build
# save progress as you work
git add -A
git commit -m "your message here"
# repeat if changes were made (try the UP ARROW)
git add -A
git commit -m "your message here"
git push -u origin main- Use the UP ARROW and DOWN ARROW in the terminal to scroll through past commands.
- Use
CTRL+fto find (and replace) text within a file.
- You do not need to add to or modify
tests/. Tests are recommended and provided for example only. - Many files are silent helpers. Explore as you like, but most files are never touched.
- You do NOT need to understand everything; let understanding build over time.
If VS Code does not automatically use the new .venv environment:
- Open the Command Palette (
Ctrl+Shift+P). - Run Python: Select Interpreter.
- Select the interpreter from this project's
.venvfolder.
If VS Code still does not recognize the environment or newly installed tools:
- Open the Command Palette (
Ctrl+Shift+P). - Run Developer: Reload Window.
If you see something like this in your terminal: >>> or ...
You accidentally started Python interactive mode.
It happens.
Press Ctrl c (both keys together) or Ctrl+Z then Enter on Windows.
This project is licensed under the MIT License.
