Skip to content

Course enrollments

Students, courses and their enrollments.

related volume small EducationPeopleRelationships
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table students rows 12 (
  id    int64 autoincrement primarykey
  name  text same(person) fullName()
  hobby text hobby()
)

table courses rows 6 (
  id    int64 autoincrement primarykey
  name  text words(maxWords: 3)
  level text enum(values: ["beginner", "intermediate", "advanced"])
)

table enrollments rows 30 per(students, 1, 4) (
  id          int64 autoincrement primarykey
  student_id  int64 fk(students.id)
  course_id   int64 fk(courses.id)
  enrolled_on date date(min: "2023-01-01", max: "2024-12-31")
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Course enrollments

A multi-table recipe that generates course enrollments: students, courses and their enrollments.

What it demonstrates

  • Relationships — enrollments references students and courses.
  • Student profile — each students row has a name and a hobby.
  • Row distribution — per(students, 1, 4) gives each student one to four enrollments.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output.

The recipe outputs CSV files: students.csv, courses.csv and enrollments.csv.

Guarantees

Every foreign key names an existing parent row and per(...) grouping holds. Values are synthetic.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

fullNamehobbywordsenumdatefkpersame:personautoincrementprimary-key