That's what I'm talking about! This guy is giving an example while showing how it works inside the Database itself! Great job!
@mattchew22035 жыл бұрын
You even fast forward yourself writing on the chalkboard... not all heroes wear capes...
4 жыл бұрын
Thank you! This is easier to understand than most website's explanation out there!
@kevinmarmet63235 жыл бұрын
I just learned about multicolumn/composite keys this morning and this video explained it perfectly. Well done!
@陳翰儒-d5m3 жыл бұрын
Man you just explain things so well, thnaks for your explaintation ! You've saved me a lot !
@tsilb4 жыл бұрын
1:50 This design shows a lack of foresight on behalf of the analyst who provided the requirements. A student could fail a given class and have to retake it again the following semester or year. Therefore that student would get a duplicate row. A unique key might be { ClassID, StudentID, Year, SemesterID). However, enrollment details may not be needed from one year to the next so we may be able to drop that Year column. I'd also name the table something more intuitive, like "StudentSchedule". Not "Schedule" by itself, because teachers also have schedules, and that would be ambiguous. "ClassStudents" is not a good name because there's no such thing as a ClassStudent. All students are Class Students; without a class, they would no longer be students. "StudentsToClasses" or "ClassesToStudents" would be my preferred naming convention for N:N mapping tables. Someone completely unfamiliar with your application should be able to tell what it does just by looking at the tables; and should be able to tell what the table contains just by its name.
@TheIntentionalMan2 жыл бұрын
You're not wrong. Additionally, I'm sure you realize this isn't a video on data modeling and it's intended to be an explanation of how Composite Key works. Including your comment in the video would start to integrate more information into this video, likely making those of us trying to learn, distracted from the point; which is incredibly simple and therefore an effective lesson on the general comprehension of Composite Key. What you've pointed out seems to speak about data modeling, which would fall into another video and could be broken down into an entire series. However, if your comment was merely to provoke thought for anyone who might not be aware of your point, then you've accomplished it.
@fdg-rt2rk Жыл бұрын
Thank you very much. Finally understood what a composite key means.
@throwaway-lo4zw8 ай бұрын
Thanks mate, great explanation!
@samjaipal6 жыл бұрын
suscribed and the knowledge you have is greater man.. Hats off..
@WaldoTheWombat2 жыл бұрын
But if the values in a specific row are the ones I used to find that row in the first place, then what would I even need that row for? I realize the table could have more columns, but it looked like a classic many-to-many table, and as far as I know, a table of that type only has two columns since its sole function is to connect between two other tables.
@daniabaouche63273 жыл бұрын
just a quick question... When drawing an ER diagram and we have to indicate the relationships between the entities how do we know where to draw the bars on the relationship lines? to indicate the composite UID
@gerietanabe80243 жыл бұрын
Unique Constraint man
@michaeleichner7522 Жыл бұрын
As usual, a very helpful video. Below is a semi fictitious example of a question that I have. Supposing that I have a table with only two fields: Username and User Status that form a composite index. Is there a way to make sure that for some combination of values my composite key the index is unique, but not for other combinations? Here's an example of what I am trying to create Username='Superman' User Status = 'Active' Username='Superman' User Status = 'In Active' Username='Superman' User Status = 'In Active' Username='Superman' User Status = ''In Active' Username='Superman' User Status = ''In Active' Based on the values in the composite key I want some combinations to allow duplicates and other combinations not to allow duplicates. In the above example I want to allow duplicate In active users with the name of Superman or whatever username the user chooses, but only one active record with that same username. Can this be accomplished? If so, how? Someone told me that I could create a Unique filtered index to accomplish this, but he didn't explain how. I am not sure if he is correct. Can it be done with a Unique filtered index as I was told? I hope this makes sense. Thanks
@francisjolin68267 жыл бұрын
Clear and Concise! Ty!
@Me-ik9pj11 ай бұрын
What's the problem with using sequential number as primary key ?
@martiapal3 жыл бұрын
شكرا لك على الترجمة! ♥️
@rahhaexia51712 жыл бұрын
It helps me so much! Thank you!!
@tumi4our2843 жыл бұрын
How to insert into composite primary key?
@subbarao89633 жыл бұрын
Well explained
@srv14evr6 жыл бұрын
Excellent presentation!
@Asimov167 жыл бұрын
Wow been using mysql for a while and didn't know you could have two columns in a key
@barlovesnoop4 жыл бұрын
You are great! Thank you! I'm trying to find information about Candidate Keys and what are they, but it seems to be very hard. Are Composite Key or Compound Key other names for a Candidate Key?
@ngjulius70233 жыл бұрын
Nope. Candidate keys qualify to be used as primary keys but are not used
@briandacallos42345 жыл бұрын
it explains very well
@timbennjah4091 Жыл бұрын
Thanks man!!
@WildZesty6 жыл бұрын
Great explanation!
@jazzrabbite523 жыл бұрын
Thank you !!
@vogeti38397 жыл бұрын
Helpful. Thank for the upload.
@wendyspear7 жыл бұрын
Great Video!
@Moossey6 жыл бұрын
thank you caleb
@cedricseb12087 жыл бұрын
Thank you !
@Pulkit__76 жыл бұрын
Wow thanks man, subed
@wadanasherani74863 жыл бұрын
You are great
@el75173 жыл бұрын
You're the best
@vjglucky75 жыл бұрын
Aha? I could not figure out a database that put 300 students into 15 min appointments with mentors, over a 2 or 3 day period, uniquely. I did it all by hand (made students choose a time/room/mentor) but fear remained of booking one student twice, two different mentors, or a time/room twice. From this I figure, if I had given each time/room-slot a UNIQUE id? Hm. (I was also ignorant on how to print it. Better keep going here ...)
@etiennebrand66224 жыл бұрын
Its difficult to say by not knowing your exact situation. But I think you could solve it like this: Student(ID, name) Mentor(ID, Name) Room(ID, Name) then you make a reference table wich holds your appointments. Appointments(Student_ID, Mentor_ID, Room_ID, DateTimeOfAppointment, Description) you could use student_id, mentor_id, room_id & datetimeofappointmen as composite keys so they're unique. The conditions can be checked in your application. Check if entrys exist in the table "Appointments" for the following combinations: Student & datetime / mentor & datetime / room & datetime if a combination exists one of the combinations has to be changed. if you need further help dont hesitate to contact me.
@milandukic69597 жыл бұрын
Great!
@Kleinlew3 жыл бұрын
Many thanks for posting this video! BTW, honestly, you can improve your hand writing (I know it's a totally different topic from SQL, etc. :-D )