SQL Server 15 - Composite Key

  Рет қаралды 48,832

Caleb Curry

Caleb Curry

Күн бұрын

Пікірлер: 42
@smbews
@smbews 7 жыл бұрын
your vids > my college honestly thank you !!
@sammclaren6965
@sammclaren6965 2 жыл бұрын
That's what I'm talking about! This guy is giving an example while showing how it works inside the Database itself! Great job!
@mattchew2203
@mattchew2203 5 жыл бұрын
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!
@kevinmarmet6323
@kevinmarmet6323 5 жыл бұрын
I just learned about multicolumn/composite keys this morning and this video explained it perfectly. Well done!
@陳翰儒-d5m
@陳翰儒-d5m 3 жыл бұрын
Man you just explain things so well, thnaks for your explaintation ! You've saved me a lot !
@tsilb
@tsilb 4 жыл бұрын
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.
@TheIntentionalMan
@TheIntentionalMan 2 жыл бұрын
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
@fdg-rt2rk Жыл бұрын
Thank you very much. Finally understood what a composite key means.
@throwaway-lo4zw
@throwaway-lo4zw 8 ай бұрын
Thanks mate, great explanation!
@samjaipal
@samjaipal 6 жыл бұрын
suscribed and the knowledge you have is greater man.. Hats off..
@WaldoTheWombat
@WaldoTheWombat 2 жыл бұрын
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.
@daniabaouche6327
@daniabaouche6327 3 жыл бұрын
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
@gerietanabe8024
@gerietanabe8024 3 жыл бұрын
Unique Constraint man
@michaeleichner7522
@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
@francisjolin6826
@francisjolin6826 7 жыл бұрын
Clear and Concise! Ty!
@Me-ik9pj
@Me-ik9pj 11 ай бұрын
What's the problem with using sequential number as primary key ?
@martiapal
@martiapal 3 жыл бұрын
شكرا لك على الترجمة! ♥️
@rahhaexia5171
@rahhaexia5171 2 жыл бұрын
It helps me so much! Thank you!!
@tumi4our284
@tumi4our284 3 жыл бұрын
How to insert into composite primary key?
@subbarao8963
@subbarao8963 3 жыл бұрын
Well explained
@srv14evr
@srv14evr 6 жыл бұрын
Excellent presentation!
@Asimov16
@Asimov16 7 жыл бұрын
Wow been using mysql for a while and didn't know you could have two columns in a key
@barlovesnoop
@barlovesnoop 4 жыл бұрын
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?
@ngjulius7023
@ngjulius7023 3 жыл бұрын
Nope. Candidate keys qualify to be used as primary keys but are not used
@briandacallos4234
@briandacallos4234 5 жыл бұрын
it explains very well
@timbennjah4091
@timbennjah4091 Жыл бұрын
Thanks man!!
@WildZesty
@WildZesty 6 жыл бұрын
Great explanation!
@jazzrabbite52
@jazzrabbite52 3 жыл бұрын
Thank you !!
@vogeti3839
@vogeti3839 7 жыл бұрын
Helpful. Thank for the upload.
@wendyspear
@wendyspear 7 жыл бұрын
Great Video!
@Moossey
@Moossey 6 жыл бұрын
thank you caleb
@cedricseb1208
@cedricseb1208 7 жыл бұрын
Thank you !
@Pulkit__7
@Pulkit__7 6 жыл бұрын
Wow thanks man, subed
@wadanasherani7486
@wadanasherani7486 3 жыл бұрын
You are great
@el7517
@el7517 3 жыл бұрын
You're the best
@vjglucky7
@vjglucky7 5 жыл бұрын
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 ...)
@etiennebrand6622
@etiennebrand6622 4 жыл бұрын
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.
@milandukic6959
@milandukic6959 7 жыл бұрын
Great!
@Kleinlew
@Kleinlew 3 жыл бұрын
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 )
@pylvr8021
@pylvr8021 6 жыл бұрын
why cant i whach the video with 1.5 speed ?
@AzizjanAyupov_leo
@AzizjanAyupov_leo 7 жыл бұрын
Thank you!
SQL Server 16 - Foreign Key
8:02
Caleb Curry
Рет қаралды 18 М.
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 6 МЛН
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
SQL Server 18 - Intro to Normalization
10:27
Caleb Curry
Рет қаралды 23 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 104 МЛН
Clustered vs. Nonclustered Index Structures in SQL Server
8:04
Voluntary DBA
Рет қаралды 664 М.
SQL Server 12 - Referential Integrity
5:16
Caleb Curry
Рет қаралды 50 М.
Primary & Foreign Keys
8:25
Eddie Woo
Рет қаралды 489 М.
When to Use Composite Keys in Database Development
4:55
Pharos Technology
Рет қаралды 3,1 М.
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 6 МЛН