// Use DBML to define your database structure
// Docs: https://dbml.dbdiagram.io/docs

Table Class {
  id integer [primary key]
  name varchar
  created_at timestamp
}

Table Student {
  id integer [primary key]
  name varchar
  sex varchar
  class_id integer [ref: < Class.id]
  group_id integer [ref: < Group.id]
  grader varchar
  created_at timestamp 
}

Table Lecture {
  id integer [primary key]
  title varchar
  points integer
  class_id integer [ref: < Class.id]
  created_at timestamp
}

Table Submission {
  id integer [primary key]
  student_id integer [ref: < Student.id]
  lecture_id integer [ref: < Lecture.id]
  class_id integer [ref: < Class.id]
  points float
  created_at timestamp
}

Table Group {
  id integer [primary key]
  name varchar
  project varchar 
  has_passed boolean
  presentation varchar
  class_id integer [ref: < Class.id]
  created_at timestamp
}


