Intermediate level · Module 6: Intermediate Database Project · Lesson 2 of 3
Building and Loading
Create the database, import and clean the data and prove that the constraints work.
In this lesson you will
- Build the database from scripts
- Load cleaned data and test constraints
Key concepts
schema scriptsimport pipelineconstraint testsaudit trail
The lesson
Create the database entirely from versioned scripts so it can be rebuilt at any time.
Import the messy data through staging, clean it, review duplicates and load it. Record numbers at each step: rows imported, cleaned, flagged and loaded.
Prove the constraints with a set of statements that must fail, and add the audit trigger.
Step by step
- Run the schema scripts on an empty database.
- Import, clean and load the data.
- Run the constraint tests.
- Record the import statistics.
Practice activity
Build and load the NGO database.
Expected result: A database rebuilt from scripts, loaded with clean data, with import statistics and passing constraint tests.
Check your understanding
-
Why build the database from scripts?
Show answer
So it can be recreated reliably at any time.
-
Why record row counts at each import step?
Show answer
To check that no rows were lost unexpectedly and to explain the results.
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.