This is general question about the best way I should setup a database, it is not specific to a software but for information it is MYSQL.
I am monitoring 1000 “houses” and how many people are present at that house at a given time to later be used in some statistics such as:
Which house is normally the fullest at a specific time range
Average capacity in general
Busiest time frame for all houses, and for a specific house.
I will be checking how many people are present every hour.
Whats the best way to setup this mysql table?
Looks like you would (optionally) want entries for each house (a house table to describe each location, with some sort of ID).
Then you would want a transactional table which would contain the house ID, the number of people and the sample date/time.
This way you can analyse what you need
e.g.
Queries for stuff like averages are easy enough
Which house is fullest for a specific time range
Disclaimer: some/all of these queries might not work 🙂
Edit: They do work! Here’s a SQL fiddle showing them in action
http://sqlfiddle.com/#!3/293e4/8