Course overview
The SQL for Data Science Training Workshop equips participants with practical skills to extract, clean, transform, analyse and interpret data stored in relational databases. SQL is an essential skill for data scientists, data analysts, business intelligence professionals and machine learning practitioners who need to work efficiently with structured data.
The workshop progresses from SQL fundamentals to advanced querying, multi-table analysis, data cleaning, statistical aggregation, window functions, analytical subqueries, Common Table Expressions (CTEs), database optimisation and the preparation of datasets for Python-based data science and machine learning workflows.
Course objectives
- Develop practical proficiency in SQL syntax, relational database concepts and data retrieval using SELECT statements, filters, sorting and aggregation.
- Integrate SQL with Python, pandas and visualisation tools to build reproducible data preparation, exploratory analysis and machine learning workflows.
- Apply analytical SQL techniques, including window functions, conditional aggregation, ranking, cohort analysis and time-based analysis, to solve real-world data science problems.
- Clean, validate, transform and profile datasets using SQL to identify missing values, duplicates, inconsistencies and anomalous records.
- Extract and combine data from multiple tables using joins, subqueries, CTEs and advanced relational query techniques.
Who should attend
Data scientists, data analysts, business intelligence analysts, machine learning practitioners, database administrators, research officers, monitoring and evaluation specialists, financial analysts, statisticians, reporting officers, software developers, business analysts, postgraduate students, ICT professionals and professionals seeking to strengthen their data analytics capabilities.
Course content
- Module 1: Introduction to SQL and Relational Databases Data science workflows and the role of SQL, relational database concepts, tables and records, columns and data types, primary and foreign keys, relationships between tables, relational schemas, datab
- Module 2: SQL Environment Setup and Database Fundamentals Installing and configuring PostgreSQL, using SQL Server Management Studio (SSMS), introductory MySQL environments, SQLite for lightweight analytics, database connections, creating databases and sc
- Module 3: SQL Data Retrieval and Filtering SELECT statements, selecting specific columns, column aliases, DISTINCT values, WHERE conditions, comparison operators, logical operators, BETWEEN, IN, LIKE and pattern matching, NULL handling with IS NULL and I
- Module 4: Data Types, Expressions and Conditional Logic Numeric, text, date, time and Boolean data types, implicit and explicit type conversion, CAST and database-specific conversion functions, arithmetic expressions, string manipulation, date extraction
- Module 5: SQL Aggregation and Descriptive Analytics COUNT, SUM, AVG, MIN and MAX, GROUP BY, HAVING, conditional aggregation, counting distinct customers or transactions, calculating totals and averages, frequency distributions, percentage calculations, g
- Module 6: Joining Multiple Tables for Data Analysis INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN where supported, self-joins, joining three or more tables, joining on primary and foreign keys, joining tables using multiple conditions, identifying u
- Module 7: SQL Data Cleaning, Validation and Quality Assessment Identifying missing and NULL values, detecting duplicate records, standardising text fields, trimming whitespace, correcting inconsistent categories, validating date and numeric fields, detec
- Module 8: Subqueries, Common Table Expressions and Advanced Query Design Scalar and correlated subqueries, subqueries in SELECT, FROM and WHERE clauses, EXISTS and NOT EXISTS, CTEs using WITH, multiple CTEs, recursive CTE concepts, breaking complex analy
- Module 9: Window Functions and Advanced Analytical SQL OVER and PARTITION BY, ORDER BY within window functions, ROW_NUMBER, RANK and DENSE_RANK, LAG and LEAD, running totals, cumulative averages, moving averages, percentage of total, ranking customers or
- Module 10: Time-Series, Cohort and Trend Analysis Using SQL Date truncation and date functions, daily, weekly, monthly and quarterly aggregation, year-on-year and month-on-month comparisons, period-over-period growth, rolling-window calculations, custome
- Module 11: Data Transformation and Analytical Dataset Preparation Creating derived columns, standardising categories, conditional transformations, pivoting and unpivoting concepts, reshaping data using conditional aggregation, combining datasets with UNI
- Module 12: SQL for Business Intelligence and Performance Measurement Defining business and operational metrics, KPI calculations, revenue and profitability analysis, customer segmentation, sales performance, inventory analysis, financial ratio calculatio
- Module 13: SQL Integration with Python and Data Science Tools Connecting Python to databases, using SQLAlchemy and database drivers, executing SQL queries from Python, loading query results into pandas DataFrames, using pandas.read_sql and parameterised
- Module 14: Query Performance, Database Security and Responsible Data Access Understanding query execution plans, indexes and their role in query performance, avoiding unnecessary full-table scans, filtering and joining efficiently, selecting only require
- Module 15: Integrated SQL Data Science Project and Practical Assessment Defining a data science problem, exploring a realistic relational dataset, profiling data quality, joining multiple tables, cleaning and transforming data, writing analytical SQL que
General notes
- Participants will work with realistic datasets and practical business scenarios covering banking, finance, healthcare, retail, telecommunications, government and development projects. The course also introduces modern analytical workflows integrating SQL with Python, pandas, Jupyter Notebook and business intelligence tools.
- Practical Exercises and Hands-On Activities Query a retail database to identify top-selling products, monthly revenue and underperforming product categories. Clean a customer dataset by identifying missing values, duplicate records and inconsistent demographic categories. Join customer, orders, products and payments tables to create a consolidated analytical dataset. Analyse banking transactions to calculate customer activity, transaction volumes, account-level summaries and unusual patterns for further investigation. Use window functions to rank customers by spending, calculate running totals and compare monthly performance. Conduct cohort analysis to measure customer retention and repeat-purchase behaviour. Analyse healthcare records to calculate patient attendance, service utilisation and trends across facilities. Use SQL and Python to extract data into pandas and prepare a dataset for exploratory analysis. Optimise a slow analytical query by reviewing its structure, filtering logic and indexing opportunities. Complete a capstone project using SQL to answer a business or development question and present the findings.
- Tools and Technologies PostgreSQL, Microsoft SQL Server, SQL Server Management Studio (SSMS), MySQL, SQLite, DBeaver, pgAdmin, Python, pandas, NumPy, Jupyter Notebook, SQLAlchemy, Microsoft Excel, Power BI, Tableau, Git and GitHub.
- The workshop uses a selected database platform for the core practical exercises, with demonstrations of relevant differences across SQL dialects. Some functions and syntax vary between database systems.
- Expected Practical Outputs A relational database practice environment, a collection of reusable SQL scripts, data profiling and quality assessment reports, cleaned analytical datasets, multi-table join queries, advanced SQL queries using CTEs and window functions, customer or transaction segmentation analysis, time-series and cohort analysis outputs, a Python-connected SQL data extraction notebook, dashboard-ready summary tables, an optimised analytical query, and a completed SQL-based data science capstone project.
- SQL Data Analysis Course, Advanced SQL Training, SQL for Data Scientists, SQL for Data Analysts, SQL Data Cleaning, SQL Window Functions, SQL and Python Training, Database Analytics Workshop, SQL for Machine Learning, Relational Database Training.
Frequently asked questions
1. 2. Do I need prior SQL programming experience?
No. The workshop starts with SQL fundamentals and progressively introduces advanced analytical techniques. Basic computer literacy is sufficient, although familiarity with spreadsheets or data analysis is helpful.
2. 3. Which database platforms will be covered?
The core exercises can be delivered using PostgreSQL or Microsoft SQL Server. SQLite and MySQL may also be demonstrated. Participants will learn transferable SQL concepts while understanding important differences between database platforms.
3. 4. How is SQL used in data science?
SQL enables data scientists to retrieve relevant records, combine information across tables, clean and transform datasets, calculate analytical features and prepare structured data for statistical analysis, visualisation and machine learning.
4. 5. Will the workshop cover Python integration?
Yes. Participants will learn how to connect Python to a relational database, execute SQL queries, load results into pandas DataFrames and prepare datasets for exploratory analysis and machine learning workflows.
Schedule & fees
| Dates | Location | Duration | Fee (USD) |
| 04/01/2027 - 08/01/2027 |
Nairobi,kenya or Virtual |
5 Days |
$1,500 |
| 08/02/2027 - 12/02/2027 |
Mombasa,Kenya |
5 Days |
$1,500 |