I’m writing a lesson observation system for the school I work at.
The database structure looks like this:

I’m currently developing the input form for the Observations table and quite a few of its fields require tick-boxes. For example, the Focus field can be any number of twelve options; the Positive and Negative field can each be any number of nearly twenty options.
In the image above, I’ve used VARCHAR to allow for a serialize‘d array.
However, I’m starting to wonder if this is the best route to go down, especially considering I may want to do some semi-complex analysis of the data such as top 5 staff for a specific positive attribute such as behaviour (which would involve counting the number of behaviour attributes each member of staff had under the Positive field in the Observations table).
Two questions here;
- Should I be using extra tables? For
FocusI would imagine the first table to have three fields –ID(key and auto-increment),Observation_IDandFocus_ID. TheFocus_IDwould correlate with another table calledfociior something which would simply have two fields –Focus_IDandTitle. I would need two tables forFocusand three tables forPositive/Development(same options but different logging). - If I use these extra database tables, what would my SQL statement look like when trying to retrieve the information from the
Observationstable including all associatedfocuses,positivesanddevelopments?
Thanks in advance,
Yes, you should always normalise in this kind of situations. Storing serialised data is hellish if you wanna do calculations or even modifications. (How are you gonna remove the 3rd element?)
Example of a query:
This would give you the number of ‘focus records’ belonging to each observation.