Skip to content

ITEC-445 โ€” Advanced Database Management: Labs

All 13 labs use Neon PostgreSQL โ€” the same platform used in SCIA-340. Students already have accounts. Each lab creates a named branch (lab-01 through lab-13) and ends with a verify_labXX() function that Dr. Chen runs to grade automatically.


Lab Overview

# Lab Week Topic Key Tools Difficulty
01 Advanced SQL โ€” Joins, Subqueries & Set Ops 1 Ch01 PostgreSQL, psql โญโญ
02 Window Functions, CTEs & Analytical Queries 2 Ch02 Window functions, Recursive CTEs โญโญโญ
03 Stored Procedures & PL/pgSQL Control Flow 3 Ch03 PL/pgSQL, cursors โญโญโญ
04 User-Defined Functions & Triggers 4 Ch04 UDFs, BEFORE/AFTER triggers โญโญโญ
05 Data Import, Export & ETL 5 Ch05 \copy, JSON, Python psycopg2 โญโญ
06 Index Design & Query Performance 6 Ch06 EXPLAIN, B-tree, partial indexes โญโญโญ
07 Query Execution Plans & Optimization 7 Ch07 EXPLAIN ANALYZE, pg_stat_statements โญโญโญโญ
08 Database Views โ€” Security & Reporting 8 Ch08 Views, materialized views, WITH CHECK OPTION โญโญ
09 Security โ€” Authentication & RBAC 9 Ch09 Roles, RLS policies, SQL injection โญโญโญ
10 Encryption, Auditing & Compliance 10 Ch10 pgcrypto, audit triggers, GDPR โญโญโญ
11 Database Scripting & Automation 11 Ch11 Python, shell scripts, migrations โญโญโญ
12 Backup, Recovery & Neon Branching 12 Ch12 pg_dump, Neon branches, PITR โญโญโญ
13 Capstone โ€” Frostburg Course Registration System 15 Ch15 All tools โญโญโญโญโญ

Difficulty Key

Rating Meaning
โญ Introductory
โญโญ Intermediate โ€” guided with scaffolding
โญโญโญ Advanced โ€” independent reasoning required
โญโญโญโญ Expert โ€” integrates multiple concepts
โญโญโญโญโญ Capstone โ€” all skills combined

The Frostburg University Schema

All labs share the same base schema โ€” fsu โ€” set up in Lab 01 and extended in subsequent labs. The schema models Frostburg State University's academic data:

departments โ”€โ”€< instructors
departments โ”€โ”€< courses โ”€โ”€< sections โ”€โ”€< enrollments >โ”€โ”€ students
departments โ”€โ”€< students

Tables: departments, instructors, courses, students, enrollments
Extended in later labs: grade_audit_log, gpa_history, staging_students, scholarships, audit_log, schema_migrations


Grading Pattern

Every lab ends with a verify_labXX() function. Dr. Chen grades by running:

SELECT check_id, description, result,
       CASE WHEN result = 'PASS' THEN points ELSE 0 END AS earned
FROM verify_labXX()
ORDER BY check_id;

No "trust the screenshot" โ€” the database state is the proof.


Branch Naming Convention

Lab Branch Name
Lab 01 lab-01
Lab 02 lab-02
... ...
Lab 13 (Capstone) lab-13

Each branch is independent. For labs that build on a previous lab's data, instructions specify which branch to fork from.


Prerequisites

  • Neon account (free tier at neon.tech)
  • psql installed locally
  • Python 3.10+ with psycopg2-binary (Labs 05, 09, 11, 12)
  • pg_dump / pg_restore (Lab 12 โ€” ships with PostgreSQL client)

Cumulative Skill Map

Lab 01 (SQL) โ”€โ”€โ–บ Lab 02 (Analytics) โ”€โ”€โ–บ Lab 03 (Procedures)
     โ”‚                                         โ”‚
     โ””โ”€โ”€โ–บ Lab 04 (Functions/Triggers) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
                                               โ”‚
Lab 05 (ETL) โ”€โ”€โ–บ Lab 06 (Indexes) โ”€โ”€โ–บ Lab 07 (Optimization)
                                               โ”‚
Lab 08 (Views) โ”€โ”€โ–บ Lab 09 (RBAC) โ”€โ”€โ–บ Lab 10 (Encryption)
                                               โ”‚
Lab 11 (Automation) โ”€โ”€โ–บ Lab 12 (Backup) โ”€โ”€โ–บ Lab 13 (Capstone)