I’m trying to create a small website in ASP.NET MVC that uses twitter. I want to be able to pull some information about twitter users and store it in a database, which I will update periodically.
I am using the following tables:
Users
user_id – uses the twitter id (int)
twitter_name – nvarchar(255)
last_updated – datetime
TwitterData
user_id
date
num_tweets
num_favorites
num_lists
Unfortunately I’m not really good with databases, so is this a good design? Can I use one table instead?
Thanks in advance,
Sasha
If there is a 1-1 relationship between a record in Users and a record in TwitterData, then you could use a single table. If you were going to have other kinds of data (FacebookData, for example), then you’d keep the two tables, but probably move twitter_name to TwitterData.
Read this for an introduction to Normalization, which will help you get started in designing tables.
http://en.wikipedia.org/wiki/Database_normalization