A newbie question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jontas
Forum Newbie
Posts: 2
Joined: Thu Feb 23, 2006 4:03 pm

A newbie question

Post by jontas »

Although this is a real newbie question, I think a little guidence is all I need to get going on my own..

I'm designing a program to track and analyize budget allocations for multiple projects across multiple categories. For example:
Project 1: New York
Categories: Print, TV, Radio, etc.

Project 2: Los Angeles
Categories: Print, TV, (can be same as project 1)

Within each category is multiple campaigns, for exmaple, in TV for New York:
ABC
NBC
etc.

And within each campaign are multiple data I need to track:
ABC Coupons: ABC1, ABC2
ABC Coupon uses: ABC1 had 10 uses, ABC2 had 20 uses

How do I structure my DB to contain all this data. I'm having some trouble wrapping my head around it.. for example, do I need a DB for each project and a table for each category with a field for each campaign? Or can I use 1 db with a table for each project, a field for each category... and then.. what?

Thanks for your help,

Jon
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Here's what I can see

Basic Tables
Projects
Categories
Campaigns
Coupons

Basically, you have a table for each "type" of data you have, in a general sense, not necessarily specific.

Then there are linking tables when there is many-to-many relationships between types. For instance, between Projects and Categories, there can be many Projects that are associated with many Categories.

Something to research:
http://en.wikipedia.org/wiki/Database_normalisation
jontas
Forum Newbie
Posts: 2
Joined: Thu Feb 23, 2006 4:03 pm

Thanks!

Post by jontas »

I knew there was a word for what I needed to do, but due to my lack of experience I would have never come across normalization. I'll look into it immediately--thanks for your help!

Jon
Post Reply