Database Keys Made Easy - Primary, Foreign, Candidate, Surrogate, & Many More

Поділитися
Вставка
  • Опубліковано 30 лип 2024
  • An easy-to-follow tutorial covering the whole gamut of RDBMS keys: primary keys, candidate keys, superkeys, alternate keys, foreign keys, surrogate keys, natural keys, simple keys, composite keys, compound keys, and intelligent keys. Featuring lots of examples and a focus on the design process.
    0:00 Introduction
    0:53 Primary Keys
    3:29 Candidate Keys
    6:09 Superkeys
    7:57 Alternate Keys
    8:49 Foreign Keys
    10:39 Surrogate vs. Natural Keys
    16:55 Composite vs. Simple Keys
    18:02 Compound Keys
    19:01 Intelligent Keys

КОМЕНТАРІ • 192

  • @decomplexify
    @decomplexify  2 роки тому +32

    CONTENTS
    0:00 Introduction
    0:53 Primary Keys
    3:29 Candidate Keys
    6:09 Superkeys
    7:57 Alternate Keys
    8:49 Foreign Keys
    10:39 Surrogate vs. Natural Keys
    16:55 Composite vs. Simple Keys
    18:02 Compound Keys
    19:01 Intelligent Keys

  • @Damnedindenial
    @Damnedindenial 10 місяців тому +16

    please add Ads to incentivize yourself to do this more the world needs this.

  • @craigwebber2270
    @craigwebber2270 Рік тому +120

    As a CS student, these videos are far superior to my uni learning material. well done

    • @joshualee7002
      @joshualee7002 Рік тому +12

      Same, what is it about universities and refusing to actually explain things in a relatable way? 😅

    • @namhlakhoza319
      @namhlakhoza319 Рік тому +5

      ​@@joshualee7002 question of the century

    • @KrigRaseri
      @KrigRaseri 10 місяців тому

      @@joshualee7002 Idk if it's the same everywhere, but in the US they already have your money what do they care if you don't understand the classes?

    • @KrigRaseri
      @KrigRaseri 10 місяців тому +1

      Common University L

    • @paulywalnutz5855
      @paulywalnutz5855 4 місяці тому

      They really are

  • @Tezla0
    @Tezla0 2 роки тому +94

    Why does this channel have so few subscribers? Your videos are very good

    • @GibsonCRG
      @GibsonCRG Рік тому +4

      100% agree. The content, pace, diagrams and examples are extremely well thought out and presented. Adding one subscriber now!

    • @rudiklein
      @rudiklein Рік тому +6

      I just increased the subscriber count.

    • @ianl1052
      @ianl1052 11 місяців тому

      ​@@rudiklein
      Me too!

    • @Ikilledthebanks
      @Ikilledthebanks 8 місяців тому

      Because its not Indian English

  • @albinkafexhiu9259
    @albinkafexhiu9259 5 місяців тому +5

    Even if my 10 year old brother watches these, he will understand the keys for sure. Please keep going and post more videos about database.

  • @rudiklein
    @rudiklein Рік тому +15

    I have been modeling databases for years, to help me generate reports. I'm an on-the-job trained database builder. For the first time the concepts of all the key types are now clear to me. Thanks.

  • @MrTomfooligans
    @MrTomfooligans 29 днів тому +1

    Exceptionally well made content from a naturally gifted instructor. You are helping people like me make it to the end of school in one piece and what you're doing is so valuable. Thank you.

  • @roman_mf
    @roman_mf Рік тому +17

    This is fantastic content! Would be great to see your take on a process of designing a database from start to end.

  • @SathyaPrakashMoparthi
    @SathyaPrakashMoparthi Рік тому +15

    This is easily going to be my recommendation to my friends and peers who need a recap incase of interviews. So well put together. Most people don't bother going into it with examples and caveats the way you did :)

  • @c5-36adhirajjadhav8
    @c5-36adhirajjadhav8 Рік тому +6

    Damn!
    I was so tensed about these concepts.
    YOU EXPLAINED IT REALLY WELL !
    I just can't express my thanks to you in words !

  • @ElOroDelTigre
    @ElOroDelTigre Рік тому +2

    You have a very easy-to-follow style and a concise, interesting way of explaining. You truly decomplexify this stuff. Thanks.

  • @wehbe8476
    @wehbe8476 5 місяців тому +4

    I thank the algorithm gods for putting you in my feed

  • @diptendumandal8354
    @diptendumandal8354 Рік тому +3

    Smooth. Seems like you framed a new key for learners - A key to success! Great video! 💯👏

  • @bungus6830
    @bungus6830 Рік тому +37

    All of your videos have been super helpful for me. You explain stuff really well and I've had a hard time finding good resources. Would you ever consider making a video on entity relationship diagrams and crow foot notation?

  • @mikefochtman7164
    @mikefochtman7164 Рік тому +2

    I've worked with computing for 40+ years, much of it with relational data in one form or another. And yet, I've learned some new things from your videos. Thank you for some great content presented in a clear and useful way.

  • @MethodOverRide
    @MethodOverRide Рік тому

    Fantastic video! Everything I've watched so far from your channel has been excellent.

  • @The_Iron_Yuppie
    @The_Iron_Yuppie Рік тому +1

    Really good breakdown. I really liked the illustrated tables to make the concepts clear.

  • @jeskaaable
    @jeskaaable Рік тому +1

    A flawless video on this topic, inspiring and exemplary. Well done.

  • @lukavelinov7419
    @lukavelinov7419 Рік тому +3

    Thanks so much for this video! I just started my first BI job after studying in a different field. Your videos have been super useful. :)

  • @thatguyadarsh
    @thatguyadarsh 6 місяців тому

    I watched the normal form clarification video by you and now I am here and havent yet finished it... but I am compelled to give you my gratitude for making all things DB so simple. Thank you for that!!! 🙏🙂

  • @fizzdevdesigns5699
    @fizzdevdesigns5699 Рік тому

    Thank you very much for this content! Very very clear and well explained. Fantastic introduction to these concepts!

  • @jacobdegeling
    @jacobdegeling 11 місяців тому +1

    A video on relationship types would be good 👍🏼 you have a great way of making a complex things seem easy. Thanks!

  • @expertcynos2123
    @expertcynos2123 2 роки тому

    Another great video with great examples, thanks a lot

  • @JorgeEscobarMX
    @JorgeEscobarMX Рік тому

    You are a good man. May god bless your soul.
    I hope this videos help a lot of people thats truggle to make good relational database designs.

  • @AdityaLakshmipathy.
    @AdityaLakshmipathy. 5 місяців тому +1

    Hi there, loved all you videos..Thank you .. Looking forward to more such videos.

  • @Nura853
    @Nura853 9 місяців тому

    Clear and precise explanation! Thank you!

  • @Devi0urS0ul
    @Devi0urS0ul Рік тому +3

    I like really the simple explanations :) Very well done, this stuff isnt easy. As suggestion for more topics: Design Patterns, and possibly anti patterns? Or if databases are more your thing (I've read some of your replies) Maybe some examples how to manage a lot of data? Various DB systems, or performance tricks and why those work? Or some 'under the hood' explanations as to *why* some things work like they do? Looking forward for more video's :)

  • @dannycollins5698
    @dannycollins5698 Рік тому +1

    Dang! These are wonderful and fantastic!

  • @webb-developer
    @webb-developer 5 місяців тому

    purely amazing.
    for sure I'm gonna rewatch this .

  • @srspearman
    @srspearman Рік тому

    I teach online classes on Cybersecurity and my students often get tripped up by these concepts. I have reviewed a lot of videos and this is by far the best one I have seen. Keep it up!

  • @subodhsharma905
    @subodhsharma905 Рік тому

    easy to follow , very well illustrated and crisp, with real world examples and applications and with associated pros and cons too.. comfortably demistifying👍🏻👍🏻 .

  • @samuelfeder9764
    @samuelfeder9764 11 місяців тому +1

    Really great video!

  • @jessicanielsen9265
    @jessicanielsen9265 2 роки тому

    This was really helpful! Explained it in an easy to understand manner, with great examples!

    • @decomplexify
      @decomplexify  2 роки тому +1

      Thanks! Yep, the idea was to make the explanations as easy and accessible as possible for people. Glad the video helped you.

  • @julianapereira5355
    @julianapereira5355 Рік тому

    I learn more with this way of teaching. Thanks. Greetings from Brazil

  • @balajir6670
    @balajir6670 Рік тому

    Perfectly explained. Thank you

  • @sarveshvazarkar6668
    @sarveshvazarkar6668 Рік тому

    Amazing and intuitive explanation

  • @ricardorien
    @ricardorien Рік тому

    Awesome job!

  • @thorstenl.4928
    @thorstenl.4928 Рік тому

    Thanks for this great bunch of well put together Information.
    For intelligent keys I have three rules I follow.
    - only use it, if there is a real (and known) value in the usage of the ID later
    - only use it, if you can‘t achieve this value on a better way (e.g. no suitable field in a given database available)
    - only use inherent and unalterable information in this id (as you mentioned e.g. date of birth.)
    If you have to use this method with a changable information, try to make it an unalterable property. E.g. if you put the information in a materialnumber if you buy it or manufacture it (m-123, b-739…), think of creating a new dataset when this changes (like a buy and a manufacture version) but keep in mind that you might have to maintain both datasets or think of setting an expired flag on the old one.
    As you can see this almost always opens a can of worms.

  • @user-ye9uh4jt2p
    @user-ye9uh4jt2p Рік тому +1

    can you create more content please? Your animation and way of explaining is superb!!!

  • @ken_nomz
    @ken_nomz 3 місяці тому

    Thank you so much for being able to explain these concepts in a succinct and clear manner. I wish you were my professor instead! Cheers

  • @thedavistheory7674
    @thedavistheory7674 Рік тому

    Keep uploading mate, we're all waiting for you :)

  • @dariosanchez5720
    @dariosanchez5720 Рік тому

    Thank you! Much appreciated!

  • @m-saaif
    @m-saaif 6 місяців тому

    I like this video, calm and informative… please more like it

  • @calebhill8475
    @calebhill8475 Рік тому

    Brilliant! Well said!

  • @flutflo
    @flutflo Рік тому +1

    Thank you for this very clear explanations. I like your videos! I would be interested to see a deep dive into (different kinds of) joins

    • @decomplexify
      @decomplexify  Рік тому +3

      Much appreciated! A video on joins is a good idea, I might create one of those at some point.

  • @user-jb4hp3iz9w
    @user-jb4hp3iz9w 9 місяців тому

    Thank you so for this. Remain blessed.

  • @HKM_0295
    @HKM_0295 Рік тому

    Your way of explanation is getting a new subscriber..

  • @Daniel.Urrutia
    @Daniel.Urrutia 11 місяців тому

    OMG! I finally found a great video explaining this. There are so many videos that they are far less effective.

  • @teacherrafael6705
    @teacherrafael6705 Рік тому

    Amazing!!! very good!! thanks!

  • @npc73x
    @npc73x 2 роки тому

    Thanks, it's very helpful to understand

  • @musicalsYS
    @musicalsYS Рік тому

    Upload more videos please, these are well-explicated even for a non CS background student to comprehend

  • @pizizhangsg1319
    @pizizhangsg1319 Рік тому

    I have learnt something, thank you.

  • @APlank
    @APlank 11 місяців тому

    Thanks. This is pretty good and interesting

  • @isaiahbundi7207
    @isaiahbundi7207 2 роки тому

    Have discovered you today in watching ur tutorials while previously i was struggling from others as i thought to myself that my understanding is so poor nearly i lost interest but now am happy have meet you

    • @decomplexify
      @decomplexify  2 роки тому

      That is great to hear - I'm pleased that these tutorials have helped you so much.

  • @che5738
    @che5738 Рік тому

    thank you very much...superb stuff

  • @saralightbourne
    @saralightbourne Рік тому

    this is extremely useful, thank you so much. my database flashcard collection has been replenished

  • @arkansharif5135
    @arkansharif5135 Рік тому

    thanks, you're awesome. May God bless you

  • @Messi-iy6lz
    @Messi-iy6lz Рік тому

    Thank you very much for explaining it in such beautiful way, waiting for your next videos and also can you please make a video on difference between model and schema, I've gone through many websites but unable to grasp the difference.i strongly believe u can decomplexify.
    Once again thanks for providing amazing content.

  • @oleksasirotinin1532
    @oleksasirotinin1532 Рік тому

    Thank you very much!

  • @houcinelachguar1884
    @houcinelachguar1884 2 роки тому

    Thanks , it's really helpful

  • @jonkemp9211
    @jonkemp9211 Рік тому

    Very Good!

  • @JadeGrey-uj3yo
    @JadeGrey-uj3yo Рік тому

    God bless you...i needed this for exams

  • @peiopascualhernando2236
    @peiopascualhernando2236 4 місяці тому

    such a great video

  • @stevanmomcilovic4469
    @stevanmomcilovic4469 Рік тому

    Suggestions - star schema, snow flake schema, conformed dimensions. Great videos!

  • @prabhakarmishra2182
    @prabhakarmishra2182 3 місяці тому

    Very well explained

  • @globaltrotter7830
    @globaltrotter7830 Рік тому

    Super awesome :)

  • @ZillaYT
    @ZillaYT 9 місяців тому

    Clearly explaining!

  • @YPartbee
    @YPartbee Рік тому

    You are too good!!!😃👍

  • @gabrielpamplonaseiffert3659
    @gabrielpamplonaseiffert3659 4 місяці тому

    You are awesome!

  • @orafasistemas
    @orafasistemas Рік тому

    Thank you!

  • @almerdavidsolis7287
    @almerdavidsolis7287 Рік тому

    Amaaazzziinng!

  • @Lljjii
    @Lljjii Рік тому

    Dude your videos are great, make more? :)

  • @mohamedazizlakhal9368
    @mohamedazizlakhal9368 Рік тому

    Thanks a lot!

  • @user-lz7iw1eu5e
    @user-lz7iw1eu5e 4 місяці тому

    This is a great video, I could understand a lot of things that I was seeing and never asked before because I thought they were that way at random. I would like to see more videos on DAX as I find it challenging but I have the conspiracy theory that giving trainings on DAX can infringe copyright somehow. .The complex thing about DAX is how DAX behaves depending on the context of where it's used within Power BI and it's differences from regular Excel Power Pivot DAX models

  • @karinahulka1486
    @karinahulka1486 Рік тому

    FINALLY I understood, thanks)

  • @bobby_bouche
    @bobby_bouche Рік тому

    very very good video. 👍

  • @user-xm6wi6rf3w
    @user-xm6wi6rf3w Рік тому

    Excellent video,waiting for the latest update

  • @dannycollins5698
    @dannycollins5698 Рік тому

    Thanks!

  • @frempongadarkwa2232
    @frempongadarkwa2232 Рік тому

    I just subscribed without delay

  • @illyamt6063
    @illyamt6063 Рік тому

    I hope that you will have more videos in the future.

  • @mattclayton2889
    @mattclayton2889 Рік тому

    Comment for algorithm - great content

  • @MANIKLATROBE
    @MANIKLATROBE 6 місяців тому

    Thank you

  • @user-yj9rv7us4x
    @user-yj9rv7us4x 10 місяців тому

    well explained

  • @2NormalHuman
    @2NormalHuman 2 роки тому +3

    amazing breakdown, good examples as well, thanks for putting your time into this. Just curious are you a backend developer? what did get you interested in the database design

    • @decomplexify
      @decomplexify  2 роки тому +10

      Thanks! Actually my background is in business / systems analysis, translating user requirements into solutions. Just purely by chance, I got assigned to a lot of "data" projects and ended up specializing, without ever really intending to, in data modelling and in writing extract/transform/load (ETL) functional specs - especially in the context of data warehouses. There's a side of me that's very logical and precise and also very focused on communicating meanings clearly, all of which maybe accounts for why I find database design to be an interesting pursuit (& also why I like the challenge of finding ways to explain the concepts to others!)

  • @WuddupDok
    @WuddupDok Рік тому

    So good!\

  • @beeboo5433
    @beeboo5433 Рік тому

    man they should just play your videos in my dbms uni course ahah

  • @boyxrichard
    @boyxrichard Рік тому

    a hero to all cs students

  • @IwoGda
    @IwoGda Рік тому

    Your last Intelligent Key example is basically national identity number in Poland called PESEL :)

  • @EmergencyChannel69420
    @EmergencyChannel69420 20 днів тому

    Came for the basic example, stayed for the quadcopters and sentient teddy bears

  • @elenagavrilova3109
    @elenagavrilova3109 6 місяців тому

    More videos pleaaase!!!!

  • @mehranbarahouei2346
    @mehranbarahouei2346 7 місяців тому

    very usefull

  • @yash1152
    @yash1152 7 місяців тому

    14:04 hmm niice example (of caution with surrogate keys)

  • @japneetsinghdadialabrutal7473
    @japneetsinghdadialabrutal7473 5 місяців тому

    can you make a video on different authorization in a database, on the basis of the work the user does. This confuses me when using an orm for my project. New to this and trying to understand more. Great video 👍.

  • @lucaliberato
    @lucaliberato Місяць тому

    hi, the video was very helpful. Btw, i'm not sure if i understood well the difference between superkeys and composite keys. Superkeys are a type of composite keys that can consist also of one attribute while the other must be 2+?

  • @jacobrawlings9893
    @jacobrawlings9893 Рік тому

    This man is single handedly saving my exam mark lol

  • @frempongadarkwa2232
    @frempongadarkwa2232 Рік тому

    Wow !

  • @mohamedazizlakhal9368
    @mohamedazizlakhal9368 Рік тому

    Have you already considered enabling the Super Thanks button? You totally deserve some extra credit!

    • @decomplexify
      @decomplexify  Рік тому

      Good suggestion - have enabled it now!

  • @sethu_k_r
    @sethu_k_r Рік тому

    Can we have a detailed visual explanation of Codd's 12 rules?

  • @pedropradocarvalho
    @pedropradocarvalho 2 роки тому

    I really enjoyed your videos, by the way, would you be so kind to provide all book sources you used for this? Thanks!

    • @decomplexify
      @decomplexify  2 роки тому +1

      Glad you've been enjoying the videos! Much of the video is based on information that's available from a variety of different sources so it's not always easy to attribute the info to any particular book or books. Having said that, a couple of books by Chris Date that I was flipping through around the time I made the video are "Database Dreaming Volume II: Relational Writings Revised and Revived" and "Database in Depth".

  • @danieldinnie5003
    @danieldinnie5003 Рік тому

    Thank you for a lovely video. You explained how keys work very well. Can you talk more about best practise? For example you spoke about using natural keys instead of surrogate keys. This is possible, but is it best practise?

    • @decomplexify
      @decomplexify  Рік тому

      Glad you liked the video! There are different schools of thought on this, but in my opinion you should try to use natural keys where possible ... the only problem is that it's very often not possible! So in practice, you'll find yourself using surrogate keys quite a lot of the time. A good example of a situation where you probably can and should use a natural key is in representing currencies (US Dollars, British Pounds, etc.) as these have official ISO Currency Codes (USD, GBP, etc.) Cases like this where there's a consensus standard natural key convention that you'll always be able to rely on are not that common, but when you do come across such a case, you should go for the natural key - that's my view, anyway. There are also times where you yourself are designing the whole system, including the front end, and can invent your own convention regarding codes to be displayed to the user that will represent instances a particular type of thing - like let's say 'O' for 'Open' and 'C' for closed. These are natural keys and it's fine and good to use them.

    • @danieldinnie5003
      @danieldinnie5003 Рік тому

      @@decomplexify Thanks for your feedback. What about in terms of speed. If you used ISO currency codes as a primary key, and then had to share that across multiple tables, would it have an impact on speed (and memory, as it might use more memory), as opposed to a primary key with just int's? What is your take on that?

    • @decomplexify
      @decomplexify  Рік тому +1

      @@danieldinnie5003 No, it wouldn't make a noticeable difference in modern database technology.