views:

43

answers:

1

I have an admin where users from multiple properties can enter in monthly statistics for twitter/facebook followers. We do not have access to the real data/db so this is why a manual entry. The form looks like this:

Type ( radio, select **one** only ):
 - Twitter
 - Facebook

Followers/Fans ( textfield ):

Property (dropdown): Hotel A, Hotel B

Date Start: mm/dd/yyyy (textfield)
Date End: mm/dd/yyyy (textfield)

Question 1.1: Since I am only keeping track of month per month, the date start/end fields which I have already created might be too specific. Would it be a better idea just to have a start month/year and and month/year if that's the only thing I care about?

Question 1.2: What schema could I use for month to month statistics if I were to change the date start and end textfields to start month/year and end month/year dropdowns?

+3  A: 

First of all, you're designing an application backassward. The data drives the UI, not the other way around.

it shouldn't matter at all if you have month/year dropdowns or not. WHAT DO YOU NEED TO CAPTURE?

If each value is for a single month, then why bother with start and end date? Use one date and a convention of either the first of the month or the last of the month.

6/1/2010 is the JUNE 2010 entry. The day is irrelevant. Do not use anything other than a date type.

If you normalize the schema, you need a table for the social media venue, a table of properties, a child table to both of those that has a date column for Count_for_month and an integer column for count_of_followers.

Response to Marjan

Your data is the only thing that matters. If Excel disappeared, would you care so long as the data in the files could be used in Google Docs?

But does that mean I recommend capturing lots of unnecessary data? Or designing one screen per table? (I'm just guessing what is meant by "table and CRUD centered") Nor am I saying that your datamodel isn't driven by requirements but the notion that OUTPUT is the sole reason for your system to exist is lunacy.

Stephanie Page
Yes, yes... to all the people who love to optimize a question rather than answer it... in the future, if he did, CHANGE his requirements to do weekly or daily values, then it maybe helpful to have from and to date. That's an easy fix later since the date range for existing values is easily deducible. $5 says someone posts that.
Stephanie Page
Data driving the UI? I would hope not. Many systems built on this premise are centered around tables and CRUD actions. A nightmare for any user to work with.The questions that need answering should drive both the data and the UI. From management information to any and all questions that arise while people are going about their business. So, start with the output, figure out the data you need to produce the output, then figure out what would be the easiest, least intrusive way for a user to supply the data needed to answer his/her and other people's questions.
Marjan Venema
I have no idea what that means, "centered around tables and CRUD". But I don't think that's what I'm recommending so stop with the strawman already. If your system is driven solely on answering the questions you have today that's all it will do.
Stephanie Page
Marjan-the data will exist long after the UI is gone and there are many non-UI things involved in database design that greatly affect the abilty to design queries, performance and data integrity. To design around the UI only is short-sighted and unprofessional. Databases need to be designed for performance, data integrity and scalibility, this is not something you can easily fix later when the whole data model is wrong and the users are screaming and you have to re-write everything. The database is the foundation of the house. Mess that up and nothing else will work well over time.
HLGEM