Database Normalization in SQL - 1NF, 2NF, 3NF, 4NF - SQL Training Online

Поделиться
HTML-код
  • Опубликовано: 12 июл 2024
  • Database Normal Forms with Examples.
    In this video I show you how to normalize your relational database.
    What is covered:
    --1st Normal Form and Atomic Values
    --2nd Normal Form and Partial Dependence
    --3rd Normal Form and Transitive Dependence
    --4th Normal Form and Multi-Value Facts
    I start with smaller examples for 1NF, 2NF, 3NF, and 4NF. Then I move into a more comprehensive example that uses all of the normal forms together.
    TABLE OF CONTENTS
    00:00 - Intro
    01:07 - 1st Normal Form
    4:18 - 2nd Normal Form
    9:44 - 3rd Normal Form
    13:50 - 4th Normal Form
    17:33 - Normalizing Customer Orders
    20:35 - Customer Table (2NF)
    21:55 - Product Table (2NF)
    24:20 - Order Header vs Order Lines
    29:05 - Product Table (3NF)
    31:25 - Customer Table (1NF, 4NF)
    DOWNLOAD THE EXCEL FILE HERE
    www.sqltrainingonline.com/SQLN...
    READ THE ORIGINAL ARTICLE WITH EXCEL FILE HERE
    www.sqltrainingonline.com/sql-...
    RUclips NEWS UPDATES
    / sqltrainingonline
    VISIT SQLTRAININGONLINE.COM FOR VIDEOS & TIPS
    www.sqltrainingonline.com
    SUBSCRIBE FOR OTHER SQL TIPS AND NEWS!
    ruclips.net/user/subscription_c...
    SUBSCRIBE TO OUR EMAIL LIST!
    www.sqltrainingonline.com
    LET'S CONNECT!
    Facebook: / sqltrainingonline
    Twitter: / sql_by_joey
    Linkedin: / joeyblue
    SQLTrainingOnline: www.sqltrainingonline.com
  • НаукаНаука

Комментарии • 141

  • @joeyblue1
    @joeyblue1  3 года назад +11

    TABLE OF CONTENTS
    00:00​ - Intro
    01:07​ - 1st Normal Form
    4:18​ - 2nd Normal Form
    9:44​ - 3rd Normal Form
    13:50​ - 4th Normal Form
    17:33​ - Normalizing Customer Orders
    20:35​ - Customer Table (2NF)
    21:55​ - Product Table (2NF)
    24:20​ - Order Header vs Order Lines
    29:05​ - Product Table (3NF)
    31:25​ - Customer Table (1NF, 4NF)

  • @deepashankar08
    @deepashankar08 3 года назад +27

    That's brilliant, confused by a textbook but fully normalised now!

  • @organiz-izedtravis6411
    @organiz-izedtravis6411 5 лет назад +39

    This video will top the search results in youtube on "DB Normalization" going forward.

  • @girls_game_as_well4397
    @girls_game_as_well4397 2 года назад +3

    I have been struggling with this concept all week in class. I finally get it. Thank you so much.

  • @4FrogsStacked
    @4FrogsStacked 2 года назад +4

    Great explanation! It's obvious that you actually understand the topic well, and you're not just spewing out definitions. I've had some difficulty understanding these concepts until now

  • @MaxProskoff
    @MaxProskoff 3 года назад +4

    Thank you for explaining this so clearly. I like the focus and the delivery.

  • @KC-zn4gt
    @KC-zn4gt 5 лет назад

    Excellent video and clear explanation. Can't get better than this!

  • @vladyslavvlasenko4372
    @vladyslavvlasenko4372 3 года назад

    Thanks a lot!
    Your explanation is absolutely easy to understand, examples are perfect.

  • @alexandercato7400
    @alexandercato7400 5 лет назад +6

    You did a great job teaching a complex topic in an understandable way! Just subscribed to your channel and expect you to get many more in the coming months because you’re producing quality content-it really stands out from the other videos on normalization. Keep up the great work!

  • @harjos78
    @harjos78 Год назад

    Best explaination i have seen so far in any book or video!. Hats off. Great example and walk thourgh

  • @montrealbudd2831
    @montrealbudd2831 2 года назад

    I really like this video. It was so much easier for me to understand normal forms by watching this video instead of reading my book. Thank you so much!

  • @uzairkhan8953
    @uzairkhan8953 4 года назад

    Really useful information. Helped me with my concepts. Thank you so much Joey.

  • @hectord.7107
    @hectord.7107 5 лет назад +3

    I'm a total noob on this topic and watched many videos about database normalization, this is the simplest explanation on the topic and the one that helped me the most improving my database structure. Thanks a lot!

  • @samiramir91samor78
    @samiramir91samor78 2 года назад

    Thank you so much, you just make it easy for me to understand, that what a perfect teacher looks like.

  • @chaslutterloh1309
    @chaslutterloh1309 4 года назад +6

    Thank you! This was an excellent format for a visual learner like me!

  • @wanroslinawanmusa7532
    @wanroslinawanmusa7532 3 года назад

    Thanks. Very easy to digest explanation on normalization.

  • @EphemeralMemory
    @EphemeralMemory Год назад

    Great, concise video! Thank you

  • @raytierney6342
    @raytierney6342 5 лет назад +1

    The absolute best !!!! Saving me from the land of total confusion!!!

  • @fealgu100
    @fealgu100 Год назад

    Simply great!

  • @michalroesler
    @michalroesler Год назад

    Great video Joey.

  • @kishorearr6639
    @kishorearr6639 2 года назад

    love this one very much!!!!

  • @shubhamsharma-ne2ke
    @shubhamsharma-ne2ke Год назад

    awesome video. Great explanation.

  • @jenh3183
    @jenh3183 5 лет назад

    You're a great teacher - thanks for making this available to everyone.

  • @kanbisama
    @kanbisama 3 года назад

    Thank you so much for this video.

  • @ironicxd6994
    @ironicxd6994 4 года назад

    Thank you so much , this helped me a lot , keep it up plz

  • @GregoryKodolanyiRitter
    @GregoryKodolanyiRitter 4 года назад

    Great, thank you!

  • @mohammadkashkooly1987
    @mohammadkashkooly1987 5 лет назад +1

    Joey, Thank you so much for helping us the little guys.

  • @dylang9790
    @dylang9790 3 года назад

    Thank you so much. your video is really useful for me

  • @basharatmir4025
    @basharatmir4025 3 года назад

    Brilliant ,,,,,lecturer

  • @Devruwan
    @Devruwan 5 лет назад +3

    Great explanation of the topic. Thank you for teaching us :)

  • @johnesraelo4614
    @johnesraelo4614 3 года назад

    excellent work Joey

  • @richod9635
    @richod9635 3 года назад +5

    Very well explained. This video tied up a loose ends for me. I already knew how to break apart one table into other tables, but this explanation really helped me to 100% confdent. Wouldn't it be a good idea to put 'Product Manufacturer Address' into it's own table in case the product is manufactured in multiple locations? If so, then what would be the key to the 'Product Manufacturer Address' table?

  • @yahiabajbouj2818
    @yahiabajbouj2818 3 года назад

    Thanks for this video

  • @helovesdata8483
    @helovesdata8483 3 года назад

    This is good. I'm new to this therefore, I'll need a week to design my first database...lol

  • @chojuj4533
    @chojuj4533 4 месяца назад

    Very well explained

  • @wehshijutt6537
    @wehshijutt6537 4 года назад

    Excellent job

  • @skv4611
    @skv4611 Год назад

    Good explanation. After seeing the video, I felt like using pivot tables in Excel could speed up the process.

  • @ekaterinavolkova4348
    @ekaterinavolkova4348 Год назад

    Great! Thanx!

  • @lokmanboukhoulda4496
    @lokmanboukhoulda4496 4 года назад +1

    Thank you! the best explanation I have found on the net!!

  • @Hevletica
    @Hevletica 2 года назад

    I cannot thank you enough.

  • @htji4
    @htji4 4 года назад +1

    Thanks Joey, you're a great teacher.

  • @usmcpound
    @usmcpound 5 лет назад

    Thanks so much for the informative video. This is much more clear and concise than the slides and book I've received from my database class.

  • @IrishDean1000
    @IrishDean1000 3 года назад

    Thanks for this

  • @dawitworku821
    @dawitworku821 3 года назад

    Thank you a lot, you are different!

  • @johnsonmuppasani2208
    @johnsonmuppasani2208 3 года назад

    Excellent

  • @hamedahmadi1382
    @hamedahmadi1382 2 года назад

    thanks answered my question🙂

  • @dagmawihaddish3235
    @dagmawihaddish3235 4 года назад

    Pls tutor java,c#,assembly. Only one ofcourse. I only saying this
    b/c u helped me a lot thank you very much.

  • @davidholguin6243
    @davidholguin6243 5 лет назад

    That was Excellent ! I guess I’ve been lucky with not having so complicated data. Thanks, Sgt. Dave

  • @justinemsquare883
    @justinemsquare883 2 года назад

    nice tutorial

  • @saltech2024
    @saltech2024 2 года назад

    Your tutorials are of no doubt ....
    Kindly make video(s) on "Entity Diagrams"

  • @fatefulwall3010
    @fatefulwall3010 5 лет назад

    Extremely helpful! Thank you Joey!!!

  • @ronyniv22
    @ronyniv22 4 года назад

    The best one that i have seen!!

  • @helheimrgaming2547
    @helheimrgaming2547 5 лет назад

    Thank you Joey, very helpful!

  • @Mind_Worm
    @Mind_Worm 5 лет назад

    THANK YOU this helped so much!

  • @brenthalbach3645
    @brenthalbach3645 2 года назад

    Great stuff.
    How would you deal with price changes over time? Do you need a separate Price table with dates or something?
    Would be great to get your input.
    Thanks, appreciate your content.

  • @NoWhiteGullibility
    @NoWhiteGullibility 5 лет назад

    Awesome

  • @vasilis8488
    @vasilis8488 5 лет назад

    @Joey Blue Thank you for your videos. They are very helpful. Now about this specific video. Is it necessary to have a separate Customer order lines table? If we had an orders table with the product id as a 2nd FK and the quantity, wouldn't we also be in 4NF?

    • @joeyblue1
      @joeyblue1  5 лет назад

      It all depends on what else you are storing in the orders table. Many times there are things that you want to store at the Order level. Maybe a flat Handling Fee that doesn't depend on the Product. You would need to figure out where to store that information without repeating it on every product line. There are many ways to do it, you just want to keep in mind the grain of the table and if you are unnecessarily repeating data.

  • @kanduriveeresh9568
    @kanduriveeresh9568 5 лет назад

    It was very well explained with example, thank you

  • @Martin-lf9se
    @Martin-lf9se 5 лет назад

    Nicely done Joey! Thank you...

  • @osmankhaled4565
    @osmankhaled4565 5 лет назад +1

    Excellent Video.

  • @nyanyaa8043
    @nyanyaa8043 4 года назад

    Hi Joey,
    Do you offer training beside the online videos? you are good at this.

  • @Adeshiomedia
    @Adeshiomedia 2 года назад

    waw impressive

  • @rayhanrana6773
    @rayhanrana6773 5 лет назад

    Just awesome man!!!

  • @shaidoeseverything
    @shaidoeseverything 5 лет назад

    Great video, Thanks!

  • @vesselofrecovery
    @vesselofrecovery 4 года назад

    You’re amazing!

  • @shingtome2179
    @shingtome2179 3 года назад

    Thanks for the video!

  • @alemtewodros2131
    @alemtewodros2131 4 года назад +1

    I am the luckiest to be here.Thanks Sir

  • @giorgiodealcantara8374
    @giorgiodealcantara8374 5 лет назад +2

    Thanks for the video, Joey! Pretty good explanation. I got with one doubt in the end. What is the PK for the Customer mail catalog and the customer email subscription tables?

  • @BijouBakson
    @BijouBakson 4 года назад

    Thank you, that was helpful

  • @sukanyachauhan9653
    @sukanyachauhan9653 5 лет назад +1

    Joey, please help with the download link for SQL server. I am starting SQL learning from your video.

  • @LenaDobrinova
    @LenaDobrinova 3 года назад

    1. Thanks for your video!
    2. One of the "Basketball-SP" records under the "Products" table needs to be deleted.
    3. Price for "Basketball-SP" needs to be updated in the original table ( @16:49). It should be either $23 or $25.
    4. Order Totals for "Customer Order ID" #1 and #4 don't look correct ("Customer Orders" table).

  • @michaelhunter4891
    @michaelhunter4891 4 года назад

    Our teacher showed us this video.

  • @blaze117
    @blaze117 5 лет назад +6

    In 8:30 your product table contains
    basketball-Spaulding
    basketball- titleist
    and ypu just deleted basketball titleist and the supplier titleist supplying basketballs suddenly disappeared from the database.
    im quite confused there

    • @adityakolte2599
      @adityakolte2599 5 лет назад

      Having 2 basketball products in Product Table would no longer keep the Primary Key Unique

    • @nickbull7278
      @nickbull7278 3 года назад +2

      @@adityakolte2599 But he loses information by doing so - how can you know that Titleist produces basketballs? This is a bad choice of primary key. Clearly other manufacturers can produce basketballs, and manufacturers can produce more than one product. The solution would be a new product ID column, or a composite primary key of both columns. Thinking forward, a product ID would be better, as the same manufacturer could make the same product, with additionally added columns for e.g., descriptions (e.g., different colors, sizes)

    • @ReisQuarteu
      @ReisQuarteu 3 года назад

      @@nickbull7278 The author corrected the above table in 8:36, so that basketballs are produced only by Spaulding in the simple example. That way, the 2NF was correctly applied. But you right: if two different manufactures can produce the same product, there was no dependency in the above table; therefore, the products table should not have been created.

  • @nolanhartwick4862
    @nolanhartwick4862 5 лет назад

    This video is quite good. It would be great if you could keep doing more of these Database theory videos.

  • @stevenchen807
    @stevenchen807 4 года назад +1

    Hi Joey, Thanks for the very instructional video. I do have a question. What do we do with the two ProductID Basketball-SP with different prices?

    • @steeleye2000
      @steeleye2000 4 года назад

      I think that was an oversight. They should either be the same price and then one of the rows would be deleted or the basketballs should be named to differentiate them (in the product column) like Basketball-yellow and Basketball-Orange.

    • @edgarsvilums1550
      @edgarsvilums1550 4 года назад

      You just add a different Product ID for the differently priced one.

    • @LenaDobrinova
      @LenaDobrinova 3 года назад

      one of 2 records needs to be deleted

  • @jetmartin9501
    @jetmartin9501 2 года назад

    Great stuff! Very helpful. Not to be picky but in trying to understand the "solution" I noticed (in the original large table) that Bob Smith made two purchases on 8/9 and the Order Total didn't add up to the total of the two lines. The total in the chart is $70...shouldn't it be $60 or am I missing something? Also should the "Customer Email Subscriptions" and "Customer Mail Catalogs" tables be JOIN tables? It seems that there is a Many-to-Many relationship between these tables and Customers (e.g.,, Customers can subscribe to Many Email subscriptions and an Email subscription can belong to many Customers). Seems like the classic situation for a Join table. Also currently the way you have it defined there is no primary key for these Email and Mail tables (as there are duplicates). Not sure if that is an issue. Thoughts?

  • @AlarLill
    @AlarLill 5 лет назад

    Big thanks from Dublin, Ireland! :)

  • @HaiNguyen-vu9cj
    @HaiNguyen-vu9cj 4 года назад

    Thank you very much.

  • @prasanthrajappan4401
    @prasanthrajappan4401 2 года назад

    Do we need to split the Customer address in example 1 to make it in 1st normal form as address seems to be composite attribute?

  • @gooon666
    @gooon666 3 года назад

    Isn't the Order Total field a Calculated field? Can it have a place in a table? If yes, how was it calculated here to show the results it exhibits here? Newbie here, thank you :)

  • @jkirkwold
    @jkirkwold 4 месяца назад

    In the section explaining 2NF, when deduping the Product Table, you got rid of two rows. The first I understand (Bat, Louisville Slugger) because it was a duplicate. However, you also got rid of (Basketball, Titleist) even though it wasn't a duplicate. Why? Great video!

  • @marko-lazic
    @marko-lazic 4 года назад +1

    But how are Dozen, Pack, Inch and $ atomic when they are combined with numbers?

  • @AusieGamer834
    @AusieGamer834 2 года назад

    That's how you explain normalisation.

  • @jeetsoni672
    @jeetsoni672 2 года назад

    hows does the qualntity depend on the order date? Can we just notpull the quantities using customer id and product?

  • @adityagorre
    @adityagorre 24 дня назад

    In this video 20:16 how did you sort product key. if we double click on that will it save all the rows

  • @mikesdailygaming
    @mikesdailygaming 2 года назад

    Normalization might as well have been mandarin before now, thank you!

  • @joylm9108
    @joylm9108 2 года назад

    Could the customer order table be further normalised to the 4nf by pulling out the customer order and order date?

  • @ruixue6955
    @ruixue6955 5 лет назад +3

    4:19 2nd normal form
    5:05 *partial dependence*
    6:55 resolve partial dependency
    9:45 3rd normal form
    11:46 transitive dependency
    13:51 fourth normal form
    17:12 demo example
    17:34 1.

  • @dosdeviant
    @dosdeviant 3 года назад

    Glad I found this.

  • @user-jz9rm8xn9n
    @user-jz9rm8xn9n Год назад

    ذاكر الكويز يابطل…

  • @umairjibran7
    @umairjibran7 5 лет назад +5

    those who haven't watched this video and searching for "DB Normalization" are even dumber than I am. This is a Life saver.

  • @nickt423
    @nickt423 4 года назад +1

    @26:24
    You have the OrderTotal for OrderID 1 as $70 (in the Customer Orders table) but didn't bsmith1 order two $70 products. Shouldn't the OrderTotal for OrderID 1(in the Customer Orders table) be $140?

  • @syedasundas1556
    @syedasundas1556 4 года назад

    Thankyou so much

  • @rendonrendon8538
    @rendonrendon8538 4 года назад

    thank you.

  • @kaym2332
    @kaym2332 5 лет назад

    In the example for third normal form where you break out product manufacturer and adress to avoid redundancy and then declare manufacturer as foreign key in the original table, does that still not result in redundancy in the first table? The column of Product Manufacturer that you colored as foreign key still seems to have repeating values in the rows. I know the transitivity has been dealt with though.
    Happy if somebody could explain this for me.

    • @TakingItCasual
      @TakingItCasual 5 лет назад +1

      It is not possible (at least in this case) to completely eliminate redundancy. The goal is merely to reduce redundancy. The main goal in any case was to make it so a manufacturer's address is only specified in one place. Instead of repeating both the manufacturer and its address, it's much better to just repeat the manufacturer.

  • @sulemanmasood1382
    @sulemanmasood1382 2 года назад

    sir my db is in mysql using MYISAM.... No foreign keys implemented with some columns repeating in tables as well... i have approximatelly 40 tables and all containns approx 500 rows.... but 5 or 6 tables contains above one million rows each....db is not normalized.....but it is still working fine...on LAN and on cloud as well ... what will be fuiture of my db...

  • @dafuq3122
    @dafuq3122 4 года назад

    Hi sir for the 8:30 part the basketball are spaulding and Titleist, but where is the Titleist after u delete those stuff, and the customer order twice, then the price should be 2x isn't it? but when you separated it, it is still the same price for one, I am confused. By the way thanks for the video😊😊😊.

  • @AggTheMag
    @AggTheMag 2 года назад

    which application are you using for this lesson?

  • @jbighitter
    @jbighitter 2 года назад

    Bob Smith on bottom two rows changes to Bill Smith later

  • @markbrad123
    @markbrad123 4 года назад

    "Nothing but the key"
    An approximation of Codd's definition of 3NF, paralleling the traditional pledge to give true evidence in a court of law, was given by Bill Kent: "[every] non-key [attribute] must provide a fact about the key, the whole key, and nothing but the key".[7] A common variation supplements this definition with the oath: "so help me Codd".[8]
    Requiring existence of "the key" ensures that the table is in 1NF; requiring that non-key attributes be dependent on "the whole key" ensures 2NF; further requiring that non-key attributes be dependent on "nothing but the key" ensures 3NF. While this phrase is a useful mnemonic, the fact that it only mentions a single key means it defines some necessary but not sufficient conditions to satisfy the 2nd and 3rd normal forms. Both 2NF and 3NF are concerned equally with all candidate keys of a table and not just any one key.