Repos for live workshop: Best of Both Worlds – Combining SQL & Python for Analytics
Location: ReDI-School Aarhus
Date: 2025-05-20 (May 20th, 2025)
By the end of the workshop, students will:
- Understand how Python connects and interacts with SQL databases.
- Know how to use Python to:
- Run direct queries.
- Call views, stored procedures, and functions.
- Pass parameters to queries.
- Work with result sets in pandas.
- Understand performance and maintainability considerations.
- Visual Studio Code - https://code.visualstudio.com/download
- Python (3.10 or newer) - https://www.python.org/downloads
- Git - https://git-scm.com/downloads
- A GitHub account - https://github.com
- Python by Microsoft
- SQL Server (mssql) by Microsoft
Ensure everyone has:
pyodbc, installed.- Connection string ready
- Confirm ability to run a basic query using Python in VS Code
- Quick review of how to use VS Code's Python and SQL extensions
Concepts:
- What is SQL good at
- What is Python good at
- When to use both
Concepts:
- Running simple queries
Concepts:
- Using SQL views for abstraction
- Parameterized queries with Python
- Avoiding SQL injection and dynamic query pitfalls
Concepts:
- Benefits of SQL stored procedures
- How to use
Concepts:
- Examples combining the two languages
- Next steps:
- Go home and reflect, then engage in Slack channel.
- Practice site: sqlpad.io
- Push all branches to GitHub