Intermediate level · Module 4 of 6 · 13 guided hours
Stored Logic and Data Import
Import and clean real-world data, export results and use functions, procedures and triggers where they genuinely help.
Learning objectives
- Import CSV and spreadsheet data and clean it with SQL
- Write simple functions and triggers
- Export data for reports and other systems
Topics
- importing CSV
- staging tables
- cleaning with UPDATE, TRIM and CASE
- detecting duplicates
- functions and procedures
- triggers and audit logs
- exporting results
Lessons
-
Lesson 1 Importing and Cleaning Data
Load CSV data into a staging table, clean it with SQL and move it into the real tables.
staging tableCSV importTRIM, UPPER and REPLACEstandardising values
-
Lesson 2 Finding Duplicates
Detect exact and likely duplicate records and decide how to handle them.
exact duplicatelikely duplicatenormalised keysreview before merge
-
Lesson 3 Functions, Triggers and Exports
Use database functions and triggers for small, well-defined jobs, and export data for others.
SQL functiontriggeraudit logexport to CSV
Practical activity
Import a messy beneficiary spreadsheet into a staging table, clean and deduplicate it, load it into the real tables and add an audit trigger.
Expected outcomes
- Clean data from messy sources
- Sensible use of stored logic
Assessment
Practical: clean a provided data set; marked on remaining errors, duplicates detected and documented steps.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.