Module 1 Hands-On Lab: Python & SQLite Database Connectivity
Put your SQL connectivity skills into practice. In this lab, you will work directly with SQLite and SQLAlchemy inside a Jupyter notebook to execute secure CRUD operations, prove atomic transaction rollback, and safely stream large result sets in Pandas.
Download Starter Notebook: 01_python_sqlite_connectivity_starter.ipynb
Scenario & Business Context
You are tasked with building the secure database ingestion layer for an analytics platform. You must ensure that arbitrary user inputs are safely escaped, partial transactions are aborted if an error occurs, and table reads do not exhaust system memory.
What You Will Build & Demonstrate
| Task | Deliverable | Points |
|---|---|---|
| T05 ยท Secure SQLite CRUD and cursor retrieval | lab_conn, find_note(), bound parameterized queries, cursor fetch methods | 5 |
| T06 ยท Prove transaction rollback | rollback_before, rollback_after, atomic transaction abort in context manager | 4 |
| T07 ยท SQLAlchemy and pandas round trip | engine, warehouse_sales, warehouse_customers, index-free DataFrame writes | 5 |
| T08 ยท Process SQL in chunks & memory safety | stream_rows, stream_revenue, chunksize=200 generator iteration | 4 |
Total Points Available: 18 points (Pass: 80% / 15 pts)
Submission Guidelines
- Download the starter notebook
.ipynb. - Open in VS Code, JupyterLab, or Google Colab.
- Complete the
# TODOcells and pass all public assertions. - Restart your kernel and run all cells cleanly.
- Upload your executed
.ipynbfile below.