Database Design 18 - Designing Many-to-Many Relationships

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

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

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

    come for the informative database design info, stay for the wholesome cringiness. This series is great! Thank you!

  • @VTS-lelovsky.
    @VTS-lelovsky. 7 หลายเดือนก่อน +3

    Almost 10 years later - you are an amazing teacher. I've started with the first video and you've explained so many concepts in such a clear way. Thank you!

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

      Same here. I'm at Western Governors University, majoring in Cybersecurity, taking Data Management - Foundations - D426. This video series is awesome.

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

    I cannot thank you enough .. After 5 years still useful content ..

  • @stuartrobinson9647
    @stuartrobinson9647 9 ปีที่แล้ว +27

    Those lines you drew at 12:46 were fucking crisp.

  • @JoeBigSh0w
    @JoeBigSh0w 8 ปีที่แล้ว +55

    Totally helped me grasping the concept of intermediary tables and what they're for. The only question left for me to ask is: Who's Claire?

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

      feel like Claire his ex, and he wrote down 666 just because he hates her so much

    • @muhammadyusoffjamaluddin
      @muhammadyusoffjamaluddin 4 ปีที่แล้ว +3

      @@lasloven4279 Owh I can C there Clairely.

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

    Thank you for the video- I subscribed over one year ago- and my professor added you as a example in our class- thank you so much for the video- thank you for being smart!

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

    Thank you so much for this!! I'm a front end developer who just got a back end based code challenge and this was a wonderful jumping off point.

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

    After 5 hours searching, finally I found the best explanation! Thanks Caleb

  • @trendsetter37
    @trendsetter37 9 ปีที่แล้ว +18

    Serious SQL swag going on in this video!

  • @Jerriehomie
    @Jerriehomie 6 ปีที่แล้ว +3

    Finally I am not sleeping during learning. Thank you.

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

    You’re genius in teaching. Literally i learned a lot from you.

  • @iworshipjesus1597
    @iworshipjesus1597 7 ปีที่แล้ว +10

    By His stripes we were healed indeed. Amen.

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

    I am exactly like you. You are exactly like me. Your way of speaking and goofy funny ways. I really identify with you. I am left handed and my hand writing looks exactly like yours. I think it is so cool that you made this video so long ago and you are so young. (I feel old now) Great Job on this entire series!!!!!! You are some one I look up to for the way you just get up there and speak off the cuff and from your actual knowledge. You Rock!!

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

    Why I Came: my professor told us to so my class could understand this concept.
    Why I Stayed: Caleb is adorable and dorky.

  • @sasadal066
    @sasadal066 7 ปีที่แล้ว +3

    You sir, deserve a special place in heaven! THANK YOU!

  • @BahramGhebray
    @BahramGhebray 10 ปีที่แล้ว +8

    Thank you for the series. Really good explanation. God bless you

  • @oussamasallak9490
    @oussamasallak9490 ปีที่แล้ว

    thank you so much for the effort, still useful after 8 years

  • @j0hnnycache
    @j0hnnycache 6 ปีที่แล้ว

    I still can't believe how much more I'm learning here compared to my instructor in my db design course.
    Thank.
    You.
    Good.
    Sir.

  • @assahmalios4486
    @assahmalios4486 3 หลายเดือนก่อน

    Bro thanks for the tutorials. Really helped on my basic database design. Thank u very much from Papua New Guinea 🇵🇬

  • @regulator5
    @regulator5 10 หลายเดือนก่อน

    Here is 2024! Thanks for making this. Its better content than my text book.

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

    Learn about Designing Many-to-Many Relationships by watching this new video! Please watch my other videos, "like" and subscribe!
    buff.ly/1o64SAU

  • @ranjanadissanayaka5390
    @ranjanadissanayaka5390 2 หลายเดือนก่อน +1

    this was a very confusing topic for me. But thanks to you it's not confusing any more.

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

    Do you need to give primary key to the rows of junction table?

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

      You can have a surrogate id field or a compound primary key on two+ columns. I prefer the surrogate id

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

    Guys I need to confess right here right now.
    I love to read Comments Section, especially this vid in this series.
    Thanks past Caleb Curry, may the force with you.

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

    This was very helpful. My question was actually, in the case of me making a database that stores different shows that i have watched, I wanted to know how I can give each show in the database multiple genres without having null values in some of the columns, the intermediary table solves that perfectly. thank you Caleb

  • @junianohjj4602
    @junianohjj4602 7 ปีที่แล้ว

    I like your choice of examples, it made it easy for me to understand the concepts. Thanks a mill

  • @GabrielTobing
    @GabrielTobing 3 ปีที่แล้ว +2

    Wow...
    You've changed so much in 6 years XD

  • @jakegti3
    @jakegti3 10 ปีที่แล้ว +1

    Aw dude, I was so close to figuring this out, thanks for drawing it so I could get a grip on it~ I was kinda losing my mind~

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

    I was doing ER diagrams, after watching this it clicked fully. I think what did it for me was the real life example.

  • @partspieces8165
    @partspieces8165 ปีที่แล้ว

    Bro thank u so much TT. U are a game changer!! Goodness, this really helped me a lotttttt

  • @UhelUhel
    @UhelUhel 7 ปีที่แล้ว

    Bruv, this is best tutorial mix i've seen. U got my sub and large respect.
    Hope it will save my exams!

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

      Thanks so much! Good luck!

    • @edisionadle1409
      @edisionadle1409 7 ปีที่แล้ว

      IKR his explanation was amazing. The best explanation I have heard of for one to many relationships. It was so good I too subscribed.

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

    Thank you Caleb.

  • @dgetzin
    @dgetzin 6 ปีที่แล้ว

    It's funny because classes are _classes_ so students are objects. You're OBJECTIFYING students!

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

    thanks mate you are a life saver

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

    I'm working on Apex, so can I assume intermediary table as a view in Apex? so I can build 2 separated tables and connect then together by a view??

  • @florenceokhajaguan2558
    @florenceokhajaguan2558 ปีที่แล้ว

    Thanks for the video
    My question is will the intermediary table have a primary key and if it does what do you suggest it is for the example you used

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

    I LOVE your videos! So helpful and love the humour too!

  • @confounded_feline
    @confounded_feline 10 ปีที่แล้ว +1

    Hey Caleb your videos are a god send man thanks!! Got a question or two though. What would you suggest for naming conventions for intermediary tables? My other question is - If for example you had additional many to many relationships, do you just build as many intermediary tables as necessary? In this case you had a class with many students. What if you had a class with other multiplicities such as teachers and assistants for instance? Would we have 3 intermediary tables for each of these cases?

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

      kaschax a combination of the two table names. so table user, table comment, and table user_comment. That makes it very clear that it is an intermediary table.
      Your other question is more complicated. we would have a class_student table, a class_instructor table, and a class_assistant table. The reason they are not connected in one table is because it is not structurally a ternary relationship or a higher n-ary relationship. (which I haven't even discussed in this course yet).
      In a ternary relationship the connection between 3 entities is required in one table for things to make sense.
      let's look at your question with some example data:
      student_id teacher_id class_id
      1 1 1
      2 1 1
      4 1 1
      10 1 1
      The way that is set up is with 1 intermediary table for both the student-teacher relationship, the teacher-class relationship, and the class-student relationship. The way we have it set up WOULD work but there would end up being a lot of repeating unnecessary foreign key references (some classes could have hundreds of students and for every row the teacher_id stays the same because the class_id stayed the same).
      it might make more sense to do this:
      student_id class_id
      1 1
      2 1
      4 1
      10 1
      teacher_id class_id
      1 1
      This solves the problem because the teacher_id depends upon the class but not the student. We took it and put it in a many-to-many relationship with just the class. For a given example of a student taking a class, we do not need the instructor_id in that row because we know who instructs the class because of the class_instructor table....
      Yeah...I'll probably just make a video explaining it. haha. Thanks!

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

    Thank you sooooooooo much! my professor never taught me how to handle this many to many. She just said nah having many to many in your ER D is not good ...

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

    does row in Intermediary table will have ID ?

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

    ZZZZZZZZZZOMG YAAAAAAAAS! I finally understand this concept! Thank youuuuuuuuuu!

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

    Do you still recommend using a Surrogate Key inside the composite table or having two Foreign Key is enough?

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

      I think the composite key is fine but some people prefer a surrogate key. The answer is there is no correct answer :P

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

    Should I be watching in order?

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

    I think I get it.
    In a many to many situation a student can follow the same course twice or more.
    So we make a third table with the PK from the two table to prevent that ?

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

    Great explanation, thank you.

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

    Thank you!! (sorry about Claire)

  • @kadenzxc
    @kadenzxc 9 ปีที่แล้ว +11

    No, not Claire! Anyone but Claire!!

    • @kmc6165
      @kmc6165 8 ปีที่แล้ว +1

      +Kaden Burgart LOL 666

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

      Claire fucking ruined it again!

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

      Did you forget about Karen?

  • @drfizzisian874
    @drfizzisian874 9 หลายเดือนก่อน

    my university is using these 9 years after you made them

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

    Clear and Simple,keep it up :)

  • @prriyka
    @prriyka ปีที่แล้ว

    thank you!!

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

    Hi Caleb, Your videos are very helpful to me. Could you help me figure out what relationship is in the following set of entities:
    1. Students and Teachers
    2. Customers and Orders
    3. Employees and basic Salary Information
    4. Employees and Payroll Transactions
    5. Words and Meanings
    6. Countries and capitals
    7. Items and Item Locations
    8. Movies and Categories
    9. Medicine and Illness
    10. Patients and Doctors
    Hope you reply soon. Thank u Caleb. Gobless :)

    • @VivekGawande1
      @VivekGawande1 6 ปีที่แล้ว +3

      1 m:n
      2 1:n
      3 1:1
      4 1:n
      5 m:n
      ....
      I'm not sure if you need the answer now. It's been 2 years

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

      @@VivekGawande1 you can't just stop in the middle, at least finish it.

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

      @@deadman4222 haha :D i was bored

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

      6. 1:n (some countries have more than 1 capital, but one capital can only belong to 1 country)
      7. m:n
      8. 1:n (assuming 1 movie can only belong to one category, if you have comedy-horror, it'll be M:N)
      9. m:n
      10. m:n (1 patient can go to multiple doctors & doctors have multiple patients)
      The easiest way to solve this is to check if either side can ONLY have a single relation:
      For Example: 1:n (Husband-Wife) assumes that the husband can have multiple wives & assumes that wives can only have 1 husband. In order to give the best response proper documentation need to be written with all the assumptions & restrictions, hope this helps someone.

  • @starvisor751
    @starvisor751 9 ปีที่แล้ว

    Thanks a lot...you're a great instructor!

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

    But if we get rid of John - then does all his information delete?

  • @ladedadedaschlobonmeknob7850
    @ladedadedaschlobonmeknob7850 8 ปีที่แล้ว

    thanks man, I love you

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

    what will happen if we delete any value from parents table to its child table ?

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

      keshab aryal
      You can have it do a couple of different things. I recommend you watch my video about it:
      th-cam.com/video/rOyZtFo4qaU/w-d-xo.html

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

    Very helpful

  • @london-paris
    @london-paris 9 ปีที่แล้ว

    Thank you Caleb for the wonderful explanation :-)

  • @KatharsisderWelt
    @KatharsisderWelt 9 ปีที่แล้ว +2

    there is a class called fashion?
    Nice video

  • @colettepitamba8623
    @colettepitamba8623 8 ปีที่แล้ว

    Dude...thank you!!!!

  • @Fractal80Y
    @Fractal80Y 7 ปีที่แล้ว

    Thanks Nice Teaching! :)

  • @PigeonscompanNk
    @PigeonscompanNk 8 ปีที่แล้ว

    i am getting confusd in one to one and one to many realtionshps will someone help me out to clear it

    • @thoms1986
      @thoms1986 7 ปีที่แล้ว

      Noroz Khan one to one means there is never the possibility that there is more than one answer to the question. So if we want to store credit card nr. It must be sure that there is only one answer possible. Then this info can go in the parent table and is one on one.
      If you have multiple answers possible. So for example comments. Then you cant store this in one row(draw it yourself). So we store this on a separate table where every comment can now have a row in the new table.

  • @wolfferoni
    @wolfferoni 7 ปีที่แล้ว

    So basically what would've been an associative entity?

  • @yusefskaff2601
    @yusefskaff2601 8 ปีที่แล้ว

    ur awesome !!

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

    Hahahah 5:36 to 5:39 = Mind blown!

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

    Parent vs Parent complication concept is very approachable. Thank you Caleb. btw, 2018 here?

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

    "Not Claire!" lol

  • @afghanboy4022
    @afghanboy4022 9 ปีที่แล้ว

    sometimes you make mistakes baby in during lesson keep training for being more efficient ;) a master advice ;)

  • @GUDDAisHere
    @GUDDAisHere 9 ปีที่แล้ว

    what about many employees to many sales???

  • @princeraheja6423
    @princeraheja6423 8 ปีที่แล้ว

    great video

  • @dinakarmaurya8000
    @dinakarmaurya8000 7 ปีที่แล้ว

    Good explanation

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

    Database design 18? So there’s 17 more videos 👀

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

    Long but interesting video.

  • @MrNaufan
    @MrNaufan 7 ปีที่แล้ว

    I was about to search "Genesis - Many To Many" then this video appears

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

    Foreign keys?

  • @tzezc
    @tzezc 8 ปีที่แล้ว

    thanks

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

    Everything gets id’s/👌🏽

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

    3 tables?

  • @PigeonscompanNk
    @PigeonscompanNk 8 ปีที่แล้ว

    like husband and wife relationship
    now which relationship is it one husband can have many wife and one wife can have one husband so which relationship is it

  • @branch1231
    @branch1231 7 ปีที่แล้ว

    brother use white board and marker

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

    I don't get it...why can't we just write many to many...M:M ? N for many is so dull 😄

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

    Why not Claire?

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

    I thought it was funny when you said i hope you can clearly see and then he walks in front of the camera and it blurs.

  • @Niko-zl5hn
    @Niko-zl5hn 4 ปีที่แล้ว

    5:35 lmao

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

    Wait wait wait

  • @afghanboy4022
    @afghanboy4022 9 ปีที่แล้ว

    heyyy and you are cleaning the board with your hand, that will hurt you ;) :P

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

    Bloody Claire...

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

    I know these videos are posted 2014 but i hope you will see my Comments, as i am the PARENT sending' AS YOU ARE THE CHILD receiving. HAhaha.. lol. Great! tutor thanks Bro!

  • @monero.jeanniton
    @monero.jeanniton 7 ปีที่แล้ว

    How old are you?

  • @nelguzman6990
    @nelguzman6990 7 วันที่ผ่านมา

    so who' s claire? ;)

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

    70 Claires clicked thumbdown lol

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

    👌🏽

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

    this was before you hit puberty lol

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

    Class students?

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

    Classes/class students/students

  • @fidangill8781
    @fidangill8781 7 ปีที่แล้ว

    Can you use my name in the videos?. Fidan. :p

  • @dengan699
    @dengan699 7 ปีที่แล้ว

    I am not sure if you are 15 or 25 y.o, it's disturbing...

  • @UhelUhel
    @UhelUhel 7 ปีที่แล้ว

    1.25x doe

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

    😂