Database Design 26 - Should I use Surrogate Keys or Natural Keys?

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ธ.ค. 2024

ความคิดเห็น • 25

  • @Professor__Cow
    @Professor__Cow 7 หลายเดือนก่อน

    Caleb - Your theatrics were adorable and make these videos entertaining!

  • @PravinJanjal92
    @PravinJanjal92 8 ปีที่แล้ว +6

    Your explanation is the best!

  • @MariuszKlinikowski
    @MariuszKlinikowski 6 ปีที่แล้ว +4

    Yes, you're saving some space with natural keys, but surrogate keys, like just number (integer) are faster during comparisons. Like you need to compare 4 bytes of integer versus 10-11 for string "CelebCurry\0". Databases grows big, so it's more and more important to use numbers, because actualy indexes are usually smaller with integers than strings. :)
    Anyway - good videos.

    • @TheSkepticSkwerl
      @TheSkepticSkwerl 5 ปีที่แล้ว

      TBH i think it comes down to the size. I bet Facebook would be best with user names. But a smaller database, say a few million, would be better with id's

  • @codebreakthrough
    @codebreakthrough  10 ปีที่แล้ว

    Should you use Surrogate Keys or Natural Keys? Watch this video to find out!
    buff.ly/V1CEvh

  • @ScottDamery
    @ScottDamery 9 ปีที่แล้ว +3

    Would you say that you should use Natural Keys for User interfaces and 3rd party services. Use Surrogate for internal db keys. I am looking at creating a trigger that creates a surrogate key when the columns for a natural key change...because I am also creating a type 2 scd table.

  • @cassondrad2280
    @cassondrad2280 3 ปีที่แล้ว

    Thanks Caleb, Great way of breaking it down for better understanding.

  • @VelevGeorgi
    @VelevGeorgi 8 ปีที่แล้ว +2

    regardless this kid looks pretty much high at the beginning of this video I like the way explanation.
    Nice and simple

  • @Ejun0
    @Ejun0 2 ปีที่แล้ว

    Hi Caleb, you got to go back to the chalk board or white board. These videos are great and love your humor throughout them!
    Much love from NC

  • @Andrew300082
    @Andrew300082 7 ปีที่แล้ว +1

    Your videos are very helpful to me for doing my homework. Thank you!

  • @davygriffiths8581
    @davygriffiths8581 7 ปีที่แล้ว +2

    Hi Caleb, thanks for your videos. V helpful. I'm a bit confused around the difference between Natural and Surrogate key. A natural key is basically a collection of columns that if concatenated would yield unique rows in table, which is effectively the same as adding a unique ID as a proxy for those columns. Wouldn't you always need to know what the natural key would be to establish a surrogate key?
    Thanks

    • @codebreakthrough
      @codebreakthrough  7 ปีที่แล้ว +1

      +davy Griffiths Hi! You can just add a surrogate 🔑 if you do not have enough data to make a natural one.

  • @PravinJanjal92
    @PravinJanjal92 8 ปีที่แล้ว +2

    Surrogate key is the best! Only limited to the application and it will not deal with the client in real business world

  • @Cheece777
    @Cheece777 7 ปีที่แล้ว +9

    Hey Caleb, awesome video series, really helped me understand the basics of Database management systems.
    However... Seriously do you only have t-shirts with stars and stribes?! :D

  • @VeraxMusic
    @VeraxMusic 6 ปีที่แล้ว +1

    What was that noise at 3:16?

  • @sajadsh8260
    @sajadsh8260 4 ปีที่แล้ว

    thank you , very good

  • @s-w
    @s-w 3 ปีที่แล้ว

    Wow, this video has surrogacy ads on it, cause I'm obviously interested in surrogacy lol.

  • @lazykitten4356
    @lazykitten4356 5 ปีที่แล้ว +5

    omg, you are so cute. I wish my bf in highschool was as cute as you :P

  • @AssassinLab
    @AssassinLab 3 ปีที่แล้ว

    Very cool video but i thing that you need a little social culture. DB & developering is not all in your live.

  • @tibretin
    @tibretin 7 ปีที่แล้ว +15

    Sorry Caleb, at speed 0.5 you are on drug bro. Make me laughs...sorry, I'm out. Keep up the good work

    • @wesleybarnes5376
      @wesleybarnes5376 6 ปีที่แล้ว +1

      Whaha at 09:05 especially!

    • @sufiyaanrajput7533
      @sufiyaanrajput7533 4 ปีที่แล้ว +1

      Actually you should try . 25

    • @kuruchan69
      @kuruchan69 4 ปีที่แล้ว

      lol

    • @mohammedfalih8713
      @mohammedfalih8713 3 ปีที่แล้ว

      @@sufiyaanrajput7533 😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂