Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    1

    Have I created This databse Correctly

    I have only recently learnt about Normalisation (and I am still unsure about it).

    I have had a go at the attached bmp picture.

    I was hoping that someone could have a quick look and maybe suggest areas to improve the database and where I have gone wrong so far.

    The blue entries indicate what I think are the Primary Keys

    Cheers
    Attached Thumbnails Attached Thumbnails untitled.bmp  

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Company table...
    What happens when we reach 2010, are you going to add another column?

    No, of course not! You want to move the orders into a separate table! Remember; pretty much anything you can calculate (e.g. sales for a year) should not be stored; it should be calculated when needed.

    same goes for logincount -> create a login history table or something to save instances of logins.
    George
    Home | Blog

  3. #3
    Join Date
    Jul 2007
    Posts
    96
    Why use int(100000) for id's and varchar(200) for orders? Any particular reason that I might be missing?

    Also keep in mind that one of the purposes of normalization is to avoid data duplication, which in your case is still happening for the currency field (just to give an example).

    I strongly suggest that you take a couple of hours to search for normalization articles as well as normal forms, particulary 1NF, 2NF 3NF.

    EDIT: I've noticed that your password field is varchar(200). Since a hashed password has a fixed size I supposed that your are not hashing them? Furthermore, you should hash your passwords with a salt value. Please search about how to store passwords.
    Last edited by Diabolic; 01-24-08 at 07:43.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    INT(100000) means show 100000 digit positions

    fortunately, only if you're using ZEROFILL

    many people think this number in parentheses indicates the range of numbers which the column can hold

    but INT(100000) and INT(937) and INT(2) and INTEGER can all hold exactly the same range of numbers
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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