SupaMonkey
SupaMonkey

Reputation: 884

What is the most optimised way to store this data?

I am recording student results for various courses. Students attend various facilities and so they have various academic calendars. In other words, a student can have results in either:

So, should I store the data as a csv string and explode it then make any calculations to the data, etc:

year_results str
year_end tinyint

or just store it as I need it/as it is and have a bunch of null values for the types not required

semester_1 tinyint
semester_2 tinyint
trimester_1 tinyint
trimester_2 tinyint
trimester_3 tinyint
term_1 tinyint
term_2 tinyint
term_3 tinyint
term_4 tinyint
year_end tinyint

Advantages / disadvantages of both?

Upvotes: 0

Views: 53

Answers (1)

Strawberry
Strawberry

Reputation: 33935

I think I would have the following:

facilities(facility_id*,no_of_terms)

courses(course_id*,facility_id)

enrolment(student_id*,course_id*)

grades(student*,course_id*,term*,grade)

* = (component of) PRIMARY KEY

Upvotes: 1

Related Questions