If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > New to databases, do I even need a relational database?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-09, 17:42
damselfish damselfish is offline
Registered User
 
Join Date: Jul 2009
Posts: 2
New to databases, do I even need a relational database?

Hello, I am new to this forum, and new also to databases (since relational database course in college long ago). I have mySQL set up and I'm OK with how to make a database and add tables, it's the structure that I'm not getting.

Here's what I'm trying to do:
I'm gathering sales data for several cities over time.

So right now for each city, I visualize this as a table, with the row names being the time periods, and the columns naming the pieces of data, such as units sold over the time period, average price, etc.

There would be one table for each city, I guess.

- I'm wanting to call various pieces of data for a single city into the relevant city page of my website.
- Later, I might want to query multiple tables and pull various numbers for all or several cities into different pieces of my site.

So I guess my question is: does this sound sensible? does it even sound relational (I don't necessarily think so)? do I need a mySQL database or should I just park this somewhere else?

Any suggestions or pointers to somewhere I can learn about best structure for something like this would be appreciated. To me, it seems like a bunch of stacked Excel sheets with a page for each city, but I'm an Excel person, so that's not surprising.

TIA!
Reply With Quote
  #2 (permalink)  
Old 07-02-09, 19:05
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 8,769
a row per sales period, or even a row per sale, soemwhere within that an identifier which acts as a foreign key pointing to a table city

you wouldn't have a table per city.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 07-02-09, 19:13
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,085
everything you said makes very good sense, except for one thing, and that was the idea of separate tables -- use a single cities table instead

and it's perfectly okay to think of data as an excel sheet

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 07-04-09, 22:09
damselfish damselfish is offline
Registered User
 
Join Date: Jul 2009
Posts: 2
Thanks, both of you. I will fuss with it a bit more and may be back with addtl ?s, but I think I understand the answers.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On