This topic is locked

database design questions

1/24/2008 10:26:52 PM
PHPRunner General questions
W
wfcentral author

this will be an easy question for most but I am stuck - new to database design...
I am creating a database of places in our city - restaurants, attractions, hotels, etc.
I originally created a table called "category" and put into it things like "hotel, restaurant, park, lake, mexican food, italian, etc"
Then I ran into situations where a "place" such as a restaurant was really three things - a coffee shop, a restaurant, and a wifi hotspot.
What I would like to do is create a table that I can create "labels" in such as (dining, wifi, italian, ...) and then if I have a listing that matches more than one item I could just pick every item that goes with it...
would I do this with three tables?
places, labels, place-to-label relationship?
or with two tables?
places - labels
and how do I link the master - child setup?
thanks for any help...
If any of you are familiar with gMail - that is where I got this idea (the way they let you apply labels to your emails and you can have multiple labels for each email if more than one label applies)
thanks,

Robert

W
wfcentral author 1/25/2008

an update on what I'm doing... I did some research and found that what I am trying to create is a many-to-many relational database.
So, has anyone here done that using PHPrunner?
The scenario goes like this...
Table A = list of places in town

Table B = keywords or labels to apply to places
Table X = a table used to join Table A and Table B together (consists of two fields A_ID and B_ID)
Robert

J
Jane 1/25/2008

Robert,
you can create custom view on the Datasource tables tab and join two tables in this view on the Edit SQL query tab.

Then use this view in the master-detail relationships.

W
wfcentral author 1/25/2008

don't I need a third table to hold the relationships in? like table X in my second post?

Robert,

you can create custom view on the Datasource tables tab and join two tables in this view on the Edit SQL query tab.

Then use this view in the master-detail relationships.