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 and hidden deterministic 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.
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.
The data is intentionally small, deterministic, and designed to expose nulls, ties, missing relationships, and fan-out traps.
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.sql
- SQL distribution asset: /sql-datasets/org_lab/boundary.sql
- SQL distribution asset: /sql-datasets/org_lab/nulls.sql
- SQL distribution asset: /sql-datasets/org_lab/ties.sql
- SQL distribution asset: /sql-datasets/org_lab/project.sql
Modules, projects, and update history
Modules that use this dataset include M00, M01, M11, M20, M21, M25, 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.