Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Database design Questions?

Database design Questions?

Scheduled Pinned Locked Moved Database
questiondatabasedesignsysadmintutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sepel
    wrote on last edited by
    #1

    I have some question about design my database. I want to design a database for a Advertisement web site. there are some ads in my site such as:car,shirt,mobile,house,etc... any ads saved by a member of site and belong to it. any ads visited by some member . any ads have it's property .for example car has model,color.mobile has weight,have cam,have tollbooths. house has infrastructure ,stage and .... in FUTURE many ads may add to my site with their specific properties. i want know should i store all of my ads in my table or save them separately?

    sepel

    B 1 Reply Last reply
    0
    • S sepel

      I have some question about design my database. I want to design a database for a Advertisement web site. there are some ads in my site such as:car,shirt,mobile,house,etc... any ads saved by a member of site and belong to it. any ads visited by some member . any ads have it's property .for example car has model,color.mobile has weight,have cam,have tollbooths. house has infrastructure ,stage and .... in FUTURE many ads may add to my site with their specific properties. i want know should i store all of my ads in my table or save them separately?

      sepel

      B Offline
      B Offline
      bcozican
      wrote on last edited by
      #2

      I would recommend you have a Member table and an Advertisement table on with a memberid field which is the member's id who uploaded the advert. A VisitHistory table that contains the Advert id, member id and maybe datetime with foreign keys to the member and Advertisement tables. A table with main categories like cars, mobiles, houses etc and then a table with subcategories with a parent id on it which will be the foreign key to the categories table that filters the subcategories for each category. That way you can have all these main categories with all their subcategories and easily add new ones if you want diffirent kinds of adds. This is obviously high level without any indexes or anything but I hope you get the idea. Hope this helps.

      M 1 Reply Last reply
      0
      • B bcozican

        I would recommend you have a Member table and an Advertisement table on with a memberid field which is the member's id who uploaded the advert. A VisitHistory table that contains the Advert id, member id and maybe datetime with foreign keys to the member and Advertisement tables. A table with main categories like cars, mobiles, houses etc and then a table with subcategories with a parent id on it which will be the foreign key to the categories table that filters the subcategories for each category. That way you can have all these main categories with all their subcategories and easily add new ones if you want diffirent kinds of adds. This is obviously high level without any indexes or anything but I hope you get the idea. Hope this helps.

        M Offline
        M Offline
        Mark Churchill
        wrote on last edited by
        #3

        Use inheritance in your database, so you can add different subclasses of Advert later. From our docs:

        In this example, a ServiceProduct and a StockProduct table are defined. Both primary key columns are also declared as foreign keys referencing the Product.Id column. These relationships guarantee that for every ServiceProduct or StockProduct record there will be a corresponding Product record with the same Id. Effectively these two tables inherit from the product table...

        Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
        Alpha release: Entanglar: Transparant multiplayer framework for .Net games.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups