Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 14th, 2003, 05:08 PM
mr slim mr slim is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 mr slim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 14 sec
Reputation Power: 0
mysql db design question

There's one aspect of a small MySQL db I'm building that's confusing me and I'd like to ask about it. It's for a website that displays a series of articles on various subjects. PHP writes the articles and menus dynamically based on the contents of the db.

One table has the following columns:

article_id (primary key, auto increment)
title (for article title and title bar of browser title)
author (links to another table with info about author, such as first name, last name, some other biographical data...)
text (body of article)
theme (there are five submenu of articles. Each represents a particular theme)
source (first place of publication)
country (country of publication - may go with 'source' to a separate table)
date (date the article was written)

My question relates to the 'theme' column. There are currently 5 different themes. When the user clicks 'themes' in the main menu, the site links to a theme page where the five themes are listed. There, the user can click to go to a specific theme. On that page, I'll list all articles where that particular theme is indicated in the db.

2 of these themes also have subthemes. There are 4-6 subcategories of them that are also reflected on the webpage. So in those pages, I need to break down the list of articles into these subcategories. The other pages can just list all the relevant articles without further classification.

I could just add subtheme as a column in the db described above, but there'd be a lot of NULL entries. I'm not clear on what's a good, clean way to put together a table that deals with the subthemes. I need to be able query for the menus with subtheme breakdowns that gets all articles where theme=thisPageTheme and subtheme=thisSectionSubtheme, so the table must be set up accordingly.

I realize this isn't complex and there are a few ways to do it. But though I can come up with ideas that work, they don't feel right.

Anyone with more db design experience than me (I don't have much) have any ideas on how to address this?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > mysql db design question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway