Jump to content

Is this layout flawed?


aditya1990

Recommended Posts

Hi everyone,

 

I am developing a classifieds website using php and mysql and this is my first major project... I designed a layout for the database and the image is attached to this question, just have a look....

 

This is how the db works...I am telling this so that people will have an easier time understanding the layout:

1.'Listing Table' is the main table. This is the table I am going to depend upon to display and/or categorize my listings...

2. Using Listing ID, I'll be able to track the user info of the person who posted the listing, and the 'Type' of customer he is (Premium, Silver or Free)

3. I'll also be able to track which sub-category it belongs to, and to which category *that* sub category belongs to.

4. Also will be tracked the price range of the property (this is a real estate classifieds), and the 'Class' (Buying,selling or renting are classes).

5. Is this the right way to do it? Are there flaws in my layout? Please do answer these questions for me, as I dont have a know-it-all boss to guide me thru...I am pretty much on my own, and of course I gratefully depend upon angelic souls like you to help me out....

 

Please do have a look and tell me what you think about it....thanx...

 

[attachment deleted by admin]

Link to comment
Share on other sites

IMO you have unnecessary link tables in there.

 

For example, "listing_user_relation".

 

This implies:

 

- A user can have many listings (true)

- A listing can have many users (false)

 

Therefore this is not a many-to-many relationship, it's a one to many. Therefore you just need to put the userID in the listing table.

 

You only need those intermediate tables for many-to-many relations

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.