Practice dataset
Org Lab dataset
Org Lab is a fictional SQL Trail data world used for hierarchy, constraints, transactions, repairs, and beginner plan reasoning. It includes visible data and hidden check variants for practice.

Purpose and provenance
Org Lab is a fictional-domain SQL Trail dataset used for hierarchy, constraints, transactions, repairs, and beginner plan reasoning.
The data is intentionally small, deterministic, and designed to expose nulls, ties, missing relationships, and fan-out traps.
- Creator/publisher: SQL Trail. Dataset revision/version: org-lab-2026-06-21.
- License/distribution policy: SQL Trail original educational content; public reuse and citation policy are documented in Content Standards.
- Schema image: /illustrations/datasets/org-lab.webp. The accessible relationship summary below is the canonical text alternative.
Tables, grains, keys, relationships, and row counts
Each table has a stated grain, primary key, foreign-key summary, row count, and column count so learners can reason about joins before writing SQL.
| Table | Grain | Primary key | Foreign keys | Row count | Columns |
|---|---|---|---|---|---|
| assignments | one row per role assignment interval | assignment_id | employee_id -> employees.employee_id; role_id -> roles.role_id | 4 | 5 |
| audit_events | one row per local audit event | event_id | none | 2 | 5 |
| departments | one row per department | department_id | none | 3 | 2 |
| employees | one row per employee record | employee_id | department_id -> departments.department_id; manager_id -> employees.employee_id | 6 | 5 |
| project_members | one row per employee membership in a project | project_id, employee_id | employee_id -> employees.employee_id; project_id -> projects.project_id | 3 | 2 |
| projects | one row per internal project | project_id | none | 2 | 2 |
| roles | one row per role label | role_id | none | 3 | 2 |
| salary_changes | one row per salary history event | change_id | employee_id -> employees.employee_id | 3 | 4 |
Intentional edge cases and relationship summary
Relationship summary is provided as text so the page remains useful without inspecting the schema image.
Relationships: assignments.employee_id -> employees.employee_id; assignments.role_id -> roles.role_id; employees.department_id -> departments.department_id; employees.manager_id -> employees.employee_id; project_members.employee_id -> employees.employee_id; project_members.project_id -> projects.project_id; salary_changes.employee_id -> employees.employee_id.
Intentional edge cases include nulls, ties, missing relationships, boundary rows, and fan-out traps when the domain can teach them.
| Table | Relationship check |
|---|---|
| assignments | employee_id references employees.employee_id; role_id references roles.role_id |
| audit_events | source or lookup table with no outgoing foreign key |
| departments | source or lookup table with no outgoing foreign key |
| employees | department_id references departments.department_id; manager_id references employees.employee_id |
| project_members | employee_id references employees.employee_id; project_id references projects.project_id |
| projects | source or lookup table with no outgoing foreign key |
| roles | source or lookup table with no outgoing foreign key |
| salary_changes | employee_id references employees.employee_id |
Downloadable distributions
Downloadable SQL distributions are published as deterministic seed files for visible, boundary, null, tie, and project variants.
CSV distributions are not published in this release; result-grid CSV export is separate from dataset landing-page downloads.
Do not invent or link a CSV package until the product actually exposes one.
- SQL distribution asset: /sql-datasets/org_lab/visible.txt
- SQL distribution asset: /sql-datasets/org_lab/boundary.txt
- SQL distribution asset: /sql-datasets/org_lab/nulls.txt
- SQL distribution asset: /sql-datasets/org_lab/ties.txt
- SQL distribution asset: /sql-datasets/org_lab/project.txt
Modules, projects, and update history
Use this inventory to trace where the dataset appears and changes.
- Modules that use this dataset include Module 1, Module 2, Module 12, Module 21, Module 22, Module 26, and more.
- Projects that use this dataset: Organization Data Repair and Schema Hardening.
- Update history: org-lab-2026-06-21 is the launch revision for this public dataset page and generated SQL seed files.
- Workspace Orientation and First Run
- Tables, Rows, Columns, Keys, and Grain
- Scalar Functions, Types, and Casting
- Fan-Out, Pre-Aggregation, Self Joins, and Non-Equi Joins
- Scalar and Set Subqueries
- Dates, Timestamps, Time Zones, and Half-Open Ranges
- Organization Data Repair and Schema Hardening
- Course catalog
- Project catalog
Page highlights
- Versioned table grain, key, row-count, and relationship inventory
- Intentional edge-case map
- Accessible relationship summary
- SQL distribution and CSV availability statement
- Module and project usage map