Jump to content

table set up and relationship query question


lilryansd

Recommended Posts

Hello and thank you for taking the time read my post. I have a very simple datbase design question. I have a section on a wbsite that list properties. I am seting up a simple CMS to create add and modify the properties.

 

the site is currently static html but the record sets will be layed out the same here is a reference url for the layout.

 

http://prioritysuites.com/listings_archstone_san_diego.php

 

I am going to set up a table a call it properties and this table will have the

 

following fields:

pID - primary ID

pName - name of property

pDiscript - description

pAddress - address

pCity - city

pMainImg - the large main img

pSmallImg - smaller thumbnail pics

pAmentities - list of amenties

pComFeatures - list of cummunity features

pApi - api number for google maps

 

I have not worked with any relationships yet but I have read a lot on the subject.

 

the three fields pSmallimg, pAmentites, pCommFeatures, will be link to other tables. I will create three new tables tbl_smalImg, tbl_amentites, and tbl_CommFeatures.

 

Each table will have the following fields

 

---------------------------

tbl_smalImg

---------------------------

 

smlImgID -priamry key

pID -property id number

image_sml - file anme of the image

----------------------------

===========================================

 

 

---------------------------

tbl_amentites

---------------------------

 

amentID -priamry key

pID -property id number

amentField - file anme of the image

----------------------------

===========================================

 

---------------------------

tbl_comFeat

---------------------------

 

comFeatID -priamry key

pID -property id number

featComField - file anme of the image

----------------------------

===========================================

 

 

now my question is,

 

is this the correct way to set up the database tables?

 

 

if I wanted to list all the properties in the database what would the SQL code be to pull info form each table so each property will list all the small images, amenities and community features.

 

 

once again I thank you for looking this over I will forward to any help that you have.

 

RB

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.