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 > Help me get over this bump

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-06-10, 18:49
tmcarstens tmcarstens is offline
Registered User
 
Join Date: Mar 2010
Posts: 8
Help me get over this bump

I'm struggling to figure this out. I was able to a few years ago, but my knowledge has slagged.

I'm create a practice run web-app to look for web hosting.

Database model:

Host -> Plans

Host can have many plans
Plans can be of different types (shared, reseller, VPS etc.)
Hosts can have reviews (just URLs)

Hosts are easy.
Plans is where I'm drawing dead.

Do I just need to create a table for each type or do I just have an "attribute" table and have one of the "plan" fields be "attributes".

Thanks for any help,
I hope I get MyIQ back.
Reply With Quote
  #2 (permalink)  
Old 05-06-10, 19:42
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by tmcarstens View Post
Do I just need to create a table for each type or do I just have an "attribute" table
at this point, neither

Quote:
Originally Posted by tmcarstens View Post
... and have one of the "plan" fields be "attributes".
nor this

each host will have separate plans, and to start out, you do not need the hassle of "pre-defining" a plan before you can add a host

just create the host_plans table using a 2-part PK, the hostid plus the plan name, and go ahead and use a VARCHAR for the plan name
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 05-07-10, 01:00
tmcarstens tmcarstens is offline
Registered User
 
Join Date: Mar 2010
Posts: 8
The problem I have (or difficulty getting my head around) is that in the host_plans table I'll have to define things like: space allocated, bandwidth, RAM etc. And for shared for instance a RAM value wouldn't be specified but for a VPS it would. Do I just leave them empty and not display the values that are null when throwing it at the reseller_result template (for instance)?

Thanks for the help!
Reply With Quote
  #4 (permalink)  
Old 05-07-10, 03:00
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by tmcarstens View Post
Do I just leave them empty and not display the values that are null when throwing it at the reseller_result template (for instance)?
yes, that seems like the way to do it
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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