Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2007
    Posts
    2

    Hardware compatibility database

    Hi there good people.

    One of my tasks at my new job is to make a computer configuration program. In short, people should be able to put together a computer of parts that work together. So if the user selects this type of motherboard, then these types of cpu's are available.

    I'm a relative beginner in database design and I have no clue as to how to contstruct my tables and the logic to accomplish this. I'm using mysql and php by the way.

    Please write if you know of a table(s) setup which I could use, and/or php code and/or a specific product/open source program which does this which I can take a look at.

    Thanks in advance, Victor

  2. #2
    Join Date
    Jul 2007
    Posts
    2

    A small add

    I forgot to mention, if a particular item that normally should be compatible really isn't, like some weird difference between manufacturers, that should also be incompatible.

  3. #3
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    Unfortunately you haven't even offered a partial solution to your own answer. Spend some time thinking about what makes each of the components dependent, and then on how you would model those components separately, and then together. After that feel free to ask for suggestions on your proposition. I don't feel that many people here will be willing to help you if you're not going to do any of the work yourself. Asking for a whole structure from someone else defeats the point of you doing the project in the first place surely?

  4. #4
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Why don't you post this in the database design/concepts forum - I'm sure you'd get a better response.

    Mike

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    up next to the post number is a little button that says "report bad post" when you hover over it

    click that and ask the thread to be moved the next time you spot one in the wrong forum

    this thread now moved to concepts & design forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    Here's a quick solution that may work for you. You'll still have to code the SQL around it but at least it's a start.

    Tables
    Code:
    -- store all your basic details for hardware in here
    create table Hardware(
       id                    varchar(20),
       name               varchar(100),
       description        varchar(255),
       hardwareType       varchar(20),
       price                float,
       supplier             varchar(20),
       ...
    )
    
    -- motherboard, case, cpu, internal disk, etc
    create table HardwareType(
        hardwareType       varchar(20),
        description         varchar(255)
    )
    
    -- store standards available for each hardware type ie
    -- internal disk: SATA, IDE, 3.5", 2.5" etc
    create table StandardsAvailable(
        hardwareType        varchar(20),
        standardName        varchar(20)
    )
    
    -- a piece of hardware might comply with lots of standards ie
    -- a particular hard disk might store: SATA and 3.5"
    create table HardwareStandards(
        id                         varchar(20),
        standardName              varchar(20)
    )
    
    -- optional entries for when a particular item that normally should be
    -- compatible really isn't - the relationship might be "incompatible"
    -- You could have other entries for recommended etc
    create table HardwareSpecialRel(
        id_main                    varchar(20),
        id_sub                     varchar(20),
        relationship                  varchar(20)
    )
    
    -- lookup ie incompatible, recommended etc
    create table relationshipType(
        relationship              varchar(20)
    )
    Comments
    You might want a standard ie USB to apply to all hardware types so you could use some special logic here. I'm not sure if a standard applies just to one hardware type ie SATA applies just to internal disk drives or between two hardware types ie internal disk and motherboards. I'll leave it to you to do the indexing etc.

    Searching for hardware will need to include the hardware type fields and the standards table so users could search for SATA disk drives. Users may prefer a hierarchical menu where you start with hardware type and then pick a standard and then view all the items that match.

    Showing info on an item of hardware should also list the types of hardware that have common standards to the one you are viewing. So viewing a motherboard might list CPU, memory, disk drives etc.

    Selecting a related hardware type would just show the hardware that has common standards to the previous item.

    Another option is just to display all the standards that an item of hardware complies to and then let the user pick other items with the same standards ie the dabs site.

    Originally posted by victorius
    One of my tasks at my new job is ... I'm a relative beginner in database design and I have no clue as to how to contstruct my tables and the logic to accomplish this.
    I doubt you'll find code for this anywhere on the web. Is it a good idea to go for a job knowing you can't do it - it sounds like a stressful life to me!

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •