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!
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!
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
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.
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!!
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 ...
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?
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!
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 :)
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.
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 ?
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.
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!
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
come for the informative database design info, stay for the wholesome cringiness. This series is great! Thank you!
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!
Same here. I'm at Western Governors University, majoring in Cybersecurity, taking Data Management - Foundations - D426. This video series is awesome.
Those lines you drew at 12:46 were fucking crisp.
I cannot thank you enough .. After 5 years still useful content ..
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?
feel like Claire his ex, and he wrote down 666 just because he hates her so much
@@lasloven4279 Owh I can C there Clairely.
Serious SQL swag going on in this video!
Finally I am not sleeping during learning. Thank you.
Why I Came: my professor told us to so my class could understand this concept.
Why I Stayed: Caleb is adorable and dorky.
Learn about Designing Many-to-Many Relationships by watching this new video! Please watch my other videos, "like" and subscribe!
buff.ly/1o64SAU
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.
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!
10 years later. You are the best.
By His stripes we were healed indeed. Amen.
You sir, deserve a special place in heaven! THANK YOU!
You’re genius in teaching. Literally i learned a lot from you.
Here is 2024! Thanks for making this. Its better content than my text book.
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.
Thank you for the series. Really good explanation. God bless you
this was a very confusing topic for me. But thanks to you it's not confusing any more.
thank you so much for the effort, still useful after 8 years
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
Bro thanks for the tutorials. Really helped on my basic database design. Thank u very much from Papua New Guinea 🇵🇬
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.
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!!
I was doing ER diagrams, after watching this it clicked fully. I think what did it for me was the real life example.
It's funny because classes are _classes_ so students are objects. You're OBJECTIFYING students!
Bruv, this is best tutorial mix i've seen. U got my sub and large respect.
Hope it will save my exams!
Thanks so much! Good luck!
IKR his explanation was amazing. The best explanation I have heard of for one to many relationships. It was so good I too subscribed.
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~
Wow...
You've changed so much in 6 years XD
Bro thank u so much TT. U are a game changer!! Goodness, this really helped me a lotttttt
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 ...
I like your choice of examples, it made it easy for me to understand the concepts. Thanks a mill
thanks mate you are a life saver
Thank you Caleb.
my university is using these 9 years after you made them
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?
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!
I LOVE your videos! So helpful and love the humour too!
ZZZZZZZZZZOMG YAAAAAAAAS! I finally understand this concept! Thank youuuuuuuuuu!
Yay! You are very welcome! :)
fg
Should I be watching in order?
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 :)
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
@@VivekGawande1 you can't just stop in the middle, at least finish it.
@@deadman4222 haha :D i was bored
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.
Do you need to give primary key to the rows of junction table?
You can have a surrogate id field or a compound primary key on two+ columns. I prefer the surrogate id
No, not Claire! Anyone but Claire!!
+Kaden Burgart LOL 666
Claire fucking ruined it again!
Did you forget about Karen?
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
Great explanation, thank you.
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 ?
Parent vs Parent complication concept is very approachable. Thank you Caleb. btw, 2018 here?
Thank you!! (sorry about Claire)
Thanks a lot...you're a great instructor!
Clear and Simple,keep it up :)
thank you!!
thanks man, I love you
Thank you Caleb for the wonderful explanation :-)
Very helpful
Database design 18? So there’s 17 more videos 👀
Do you still recommend using a Surrogate Key inside the composite table or having two Foreign Key is enough?
I think the composite key is fine but some people prefer a surrogate key. The answer is there is no correct answer :P
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??
Thanks Nice Teaching! :)
there is a class called fashion?
Nice video
But if we get rid of John - then does all his information delete?
Dude...thank you!!!!
Hahahah 5:36 to 5:39 = Mind blown!
Long but interesting video.
does row in Intermediary table will have ID ?
I was about to search "Genesis - Many To Many" then this video appears
Good explanation
ur awesome !!
sometimes you make mistakes baby in during lesson keep training for being more efficient ;) a master advice ;)
thanks
great video
So basically what would've been an associative entity?
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.
Everything gets id’s/👌🏽
heyyy and you are cleaning the board with your hand, that will hurt you ;) :P
what will happen if we delete any value from parents table to its child table ?
keshab aryal
You can have it do a couple of different things. I recommend you watch my video about it:
ua-cam.com/video/rOyZtFo4qaU/v-deo.html
Why not Claire?
brother use white board and marker
Foreign keys?
what about many employees to many sales???
"Not Claire!" lol
3 tables?
i am getting confusd in one to one and one to many realtionshps will someone help me out to clear it
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.
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!
so who' s claire? ;)
How old are you?
Class students?
Bloody Claire...
Classes/class students/students
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
One to many
I don't get it...why can't we just write many to many...M:M ? N for many is so dull 😄
70 Claires clicked thumbdown lol
Wait wait wait
I am not sure if you are 15 or 25 y.o, it's disturbing...
this was before you hit puberty lol
5:35 lmao
Can you use my name in the videos?. Fidan. :p
👌🏽
1.25x doe
😂