...

Discussion in 'Software' started by koola, 13 May 2007.

  1. koola

    koola Minimodder

    Joined:
    11 Jul 2004
    Posts:
    2,401
    Likes Received:
    10
    ...
     
    Last edited: 16 Apr 2018
  2. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    personally, I'd make a composite key out of certain fields rather then always having an ID field. But that's just the way we do it in certain Databases at work.

    Also wouldn't your tbl_auctions be linked to tbl_user to say who made the listing?

    And have a bid table to mark who bidded on what, when and how much?
     
  3. koola

    koola Minimodder

    Joined:
    11 Jul 2004
    Posts:
    2,401
    Likes Received:
    10
    ...
     
    Last edited: 16 Apr 2018
  4. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    I found (personally) that adding prefixes can make stuff harder to understand, especially when doing joins, as JOIN <table> USING (id) is easier to maintain then JOIN <table> HAVING id1 = id2

    Foreign keys should have the same name, so your tbl_order has three foreign keys which are named differently to their origins.
     
  5. koola

    koola Minimodder

    Joined:
    11 Jul 2004
    Posts:
    2,401
    Likes Received:
    10
    ...
     
    Last edited: 16 Apr 2018
  6. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    Also, I'd personally put a start date or entry date on most of the tables, so you can track activity, make reports an so on.

    The USER table won't need an auction key as it should be on the order reference, someone may purchase multiple items and won't need to have a new record each time.
     
  7. eek

    eek CAMRA ***.

    Joined:
    23 Jan 2002
    Posts:
    1,600
    Likes Received:
    14
    Rather than giving foriegn/primary key fields the same name, i find using the postfixes _pid and _fid most useful - it keeps things clearer :)
     
  8. koola

    koola Minimodder

    Joined:
    11 Jul 2004
    Posts:
    2,401
    Likes Received:
    10
    ...
     
    Last edited: 16 Apr 2018
  9. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    The thing is that you're duplicating the auction ID, there's one in the auction table and one in the user table, it'll make it better in the long run to be able to track users activity.
     
  10. koola

    koola Minimodder

    Joined:
    11 Jul 2004
    Posts:
    2,401
    Likes Received:
    10
    ...
     
    Last edited: 16 Apr 2018

Share This Page