Thursday, 29 August 2013

Postgres: How to implement a flexible table

Postgres: How to implement a flexible table

I am a novice database user (not designer). I would like to implement the
following item in the postgres database.
I would like to implement a database which contain the following information
Table1
Classroom | Classroom Type | Student1 | Student2 | ... | Student36
1A | 'Square' | 'Anson' | 'Antonie'| ... | 'Zalda'
1B | 'Rectangle' | 'Allen' | 'Andy' | ... | 'Zeth'
There is another table to store the seating plan for each student, that's
why I created another table
Table2
Classroom Type | Student1 Position | Student2 Position | ... | Student36
Position
'Square' | (1,1) | (1,2) | ... | (6,6)
'Rectangle' | (1,1) | (1,2) | ... | (4,9)
The reason of this implementation is to draw a seating plan. However I
don't think this is a good implementation. Therefore I would like to find
another way which will give me some flexibility when I want to scale it
up.
Thanks in advance.

No comments:

Post a Comment