Skip navigation links

MySQL Forums :: Database Design & Data Modelling :: Simple Database Design Problem


Advanced Search

Simple Database Design Problem
Posted by: Filip Nedyalkov ()
Date: June 09, 2011 08:49AM

Hi, I am trying to figure out how to solve this little problem:

I have this table structures:

1) Themes -> 2) Theme Templates -> 3) Theme Page Templates
So 1 Theme can have some Theme Templates and each Theme Template can have some Theme Page Templates

4) Page Templates
A table with Page Templates which do not depend on the selected Theme.

5) Pages
Imagine you have a control panel and you can select for page About Us a Theme Page Template OR Page Template.

The question is how do I structure the table pages?


I imagined the table to look like:
1) page_id template_type template_id
1 theme_page 1
2 page 1
...
Basicly the template_type is like a marker that points to look for id in the correct table.

2) page_id page_template_id theme_page_template_id
1 1 0
2 0 1
Here both ids cannot be set, one of them is always 0 the other is pointing to the id in the correct table.

Is there a third option or some other better way to organize this? If no then which of these options makes more sense?

Thanks in advance!

Options: ReplyQuote


Subject Written By Posted
Simple Database Design Problem Filip Nedyalkov 06/09/2011 08:49AM
Re: Simple Database Design Problem Rick James 06/10/2011 11:48PM
Re: Simple Database Design Problem Filip Nedyalkov 06/11/2011 02:04AM
Re: Simple Database Design Problem Filip Nedyalkov 06/11/2011 02:07AM
Re: Simple Database Design Problem Rick James 06/11/2011 09:18AM
Re: Simple Database Design Problem Filip Nedyalkov 06/11/2011 04:56PM
Re: Simple Database Design Problem Rick James 06/11/2011 09:46PM
Re: Simple Database Design Problem Filip Nedyalkov 06/12/2011 03:23AM
Re: Simple Database Design Problem Rick James 06/12/2011 09:01PM
Re: Simple Database Design Problem Filip Nedyalkov 06/13/2011 03:04AM
Re: Simple Database Design Problem Rick James 06/13/2011 10:33AM
Re: Simple Database Design Problem Filip Nedyalkov 06/13/2011 04:53PM
Re: Simple Database Design Problem Rick James 06/13/2011 08:42PM
Re: Simple Database Design Problem Filip Nedyalkov 06/14/2011 03:28AM
Re: Simple Database Design Problem Rick James 06/14/2011 08:09PM
Re: Simple Database Design Problem Filip Nedyalkov 06/15/2011 02:22AM
Re: Simple Database Design Problem Filip Nedyalkov 06/15/2011 06:15AM
Re: Simple Database Design Problem Rick James 06/15/2011 07:31PM
Re: Simple Database Design Problem Sachin Gupta 09/27/2011 11:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.