how to handle dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have a education database that store courses and participants, i want to
know if there is a better way to handle dates

the courses can be anything from one day to five days

Tables

Courses

Attendees


Registration

in the courses table i have fields for Day1 day2 etc

i just dont think this is an elegant way of dealing with the dates how would
other people store this data
 
One Subject (course choices) is offered many times (in different semesters).
One Class (course instance in a semester) has many enrolments (students).
One Student enrols in many classes.
For one enrollment, there are many attendances.

So, the tables you need are (at minimum):

Student table: one record for each student, with these fields:
StudentID AutoNum
Surname Text
...

Subject table: one record for each course e.g. Math101.
SubjectID AutoNum
SubjectName Text
...

Class: One record for each instance of a course
ClassID AutoNum
SubjectID foreign key to Subject.SubjectID
StartDate when this subject was run
TeacherID foreign key to Teacher.TeacherID

Enrol: One record for each student in a class:
EnrolID AutoNum
ClassID foreign key to Class.ClassID
StudentID foreign key to Student.StudentID

Attend: One record for each time a student attends an enrolled class:
AttendID AutoNum
EnrolID foreign key to Enrol.EnrolID
AttendDate Date the student attended the class they were enrolled in.
 
It is according to how you will be using the data. You might store the date
of the first day and then in another field the number of days of the course.
 
thanks for the help,
KARL DEWEY said:
It is according to how you will be using the data. You might store the date
of the first day and then in another field the number of days of the course.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top