Web Design and Programming Pt 15 MySQL

Here I show you how to create Normalized Tables in MySQL.
First Rule of Normalize Tables: Each column can only contain one value and you can’t have repeating columns.
Second Rule of Normalized Tables: You can’t have repeating values in a field
Third Rule of Normalized Tables: Eliminate any fields from a table if they don’t directly relate to the primary key

Article is Here






6 responses to “Web Design and Programming Pt 15 MySQL”

  1. Mark Lovett Avatar

    Hi Derek,
    Nice MySQL review! I was hoping you would have insert code available that I can copy and paste to save time creating database. Oh well, next time.
    Mark Lovett

  2. Paul DeVito Avatar

    Derek, how would you suggest laying out a table where one wanted to have multiple phone numbers for an individual?  Since you can't have multiple primary keys for the phone ID entered in the phoneID field, I would think it would require another level of depth.  I didn't see it another video, but I'm sure I could have missed it so feel free to point me there if it's been covered.  Thanks

  3. Martin Gonzalez Avatar

    So how would the city state and zip code tables look like? What columns would it have? and I'm guessing then in the customer table you would have state_id, city_id, and zipcode_id? am I close?

  4. Derek Banas Avatar

    If you define table type as InnoDB, you can use transactions. You will need set AUTOCOMMIT=0, and after you can issue COMMIT or ROLLBACK at the end of query or session to submit or cancel a transaction.

    See this dev. mysql. com/doc/refman/5.0/en/commit. html

  5. Jeff Lever Avatar

    Let's say you enter a line item, is there a way to edit it after you hit enter, or do you just have to cancel out the whole command?

  6. Derek Banas Avatar

    @setzner yes I could have normalized things more and probably should have. i may get back into this subject soon. Glad you liked it 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *