Lebon
Lebon

Reputation: 138

SQL database structure for week schedule

I've been looking for an answer for the following question, but I didn't find anything on it.

I would like to make a SQL database where I can store data per day (Mon-Sun), per hour (every 15 minutes). It's sort of an overview from Monday to Sunday only from the previous week, where I can add data per 15mins.

If handling a lot of data (read several 100k rows). Would it be better to make tables per day and then have columns per 15 minutes?

Upvotes: 1

Views: 1278

Answers (1)

Jay
Jay

Reputation: 2686

You can just have a table that takes the data at the 15 minute interval with a timestamp.

So only 3 columns (user, data, timestamp). The timestamp could be in seconds/milliseconds/nano what ever format you want.

Once displaying the data you can compute what week its in on the "fly".

Upvotes: 1

Related Questions