Keys in RDBMS
HTML-код
- Опубликовано: 25 июл 2024
- DBMS: Keys in RDBMS
Topics discussed:
1. Explanation about the need for having keys in tables.
2. Various keys involved in DBMS.
3. Super key with example.
4. Candidate key with example.
5. Primary key with example.
6. Alternate key with example.
7. Unique key with example.
8. Foreign key with example.
Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
Contribute: www.nesoacademy.org/donate
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy.org/recommend...
Website ► www.nesoacademy.org/
Forum ► forum.nesoacademy.org/
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#DBMSByNeso #DBMS #KeysInDBMS
1000 times better explanation than our college teachers.. 👍
Which university
True
Such a great teacher with clean and clear explanation! thank you!
The session is too engaging ,Sir. Got cleared with all the concepts🙂.Thankyou sir
Precise And to the point.Well done 👍
Beautifully explained, thank you!
you explained it 10/10, thank you so much!
thank you for speaking clearly, finally found a video in which i can understand what its said
Nicely explained , Thnxx alot 💙
Thanks NESO academy for this! Indeed and infromative video !
Great lacture thank you for making such wonderful video .
Thank you for the explanation. Your explanation really helped in clearing the concepts regarding the keys.👍Great work!
I m from non tech background and this topics comes in my Mba course and you explain it very smoothly. thank you !
from where are u pursuing mba? is it mba in IT?
@@debasisnath9951 yes, From GL Bajaj institute greater Noida
Clear explanation indeed .
very clear explanation. thank you
Thank you for giving the knowledge about DBMS Keys ❤
Well understood, Thanks❤
Oh my goodness. You explained the complex Lecture to a lay_man's view. I subscribed right away. Sending love from Zambia
🇿🇲🇿🇲🇿🇲🇿🇲🇿🇲
excellent work sir, thank you!
Very very clear, really useful, wonderful explanation.great mentor u r sir, pls put more videos regarding dbms sir 🙏🙏🙏
Simple and effective explanation. Thank you
Great Explaination Sir !!!!
Thank you so much!
Thank you sir 😊
Thanks very clear explanation
Thank you so much sir 😃😃👌
Fantastic... Teaching..Great Sir Thank you sir
Very nicely explained
Nice explanation 💥💥💯
clears all the concept about keys
thank you i learnt alot from your work
😃😃😃😃😃😃
Wow, appreciate you for this.
You are a great teacher
Great teacher !!!
seriously better than my professor!!!
Thank you sir for nice explanation ❤️
great teacher😊
Thank you !
It is not that difficult , it was just clarity i needed. Thank you
Thanks
Thank You
Super explanation 👌👌👌
really! understood very clearly , mainly this session has been too engaging without lag.
Thanks for a lot
Thankyou sir ❤❤❤❤😊😊😊
Thankyou sir ✨
Thanks !
Thanks bro
Is it possible for a unique and composite key to be something other than a candidate key?
Thank you
Can someone please explain what is a unique key because it seemed same as alternate keys
Where is the tutorial of Normalization? I need it right now hehe, were done at keys in rdbms
@nesoacademy, are you sure that (Name, Phone) can be super key and candidate key?
In "super key" part you've mentioned that you can not force an employee to have a phone number, so it can be null.
What if we have in DB three employees named John without assigned phone number? 🤔🤔🤔
we need an answer to this, @funkiel-nowka if you found out can you explaine to me aswell ?
@Neso Academy
Even (Name, email) can't be a superkey coz what if email is Also null and the name might have repeated too...
You're right! I have the same doubt. Most probably, that part of the explanation is wrong.
wonderful!!thanks,i understand it 100%😂
Thank you very much for the video. I have a question, why are we picking {Name, phone} and {email} as candidate keys instead of {Name, email} and {Phone}?
Which one was the foreign key ??? Dept. Code or any other ??
why is salary on the table if you dont make use of it? Why is it not an alternate key?
Great
100/10 ❤
one thing i would like to add is that...
(name + phone) cannot be a candidate key because they can have null values and the primary motive of candidate key is to uniquely identify a tuple. (name + phone) cannot be a primary key as well because primary key can't have null values.
(Name, email) what if the email is Null but the name alone cannot identify uniquely a tuple? In my opinion in this case it cannot be a superkey
Yess....even (Name, phone) can't be a super key...the phone no. Can also be null and the name can be repeated too...ig we hv to assign these attributes with certain keys separately....
So, the unique key, must support null values apart from being unique ?
In a candidate key what if one attribute values are not unique and other attributecan have a null value, How can we identify it...For example there are 3 john in the table and if two have no phone numbers then how can we identify the specific tuple
If one name is repeated twice and both the rows have null as their phone number then how will {name, phone} be a super key?
{name, phone} is not a key because u can't identify a unique tuple by using this in that condition
@@Kanna12377for the super key u said like we can use name, phone as key right … that eg is coming for all candidate key primary key and alternative key.. then how come u r saying it’s not a keys
It is candidate key
First you should make name and phone number as a key because it's not null but it's not not unique also
Am also confused😢
super key is like super set.but actually it is power set of keys
how name and phone can be super key if there are 2 employees with same name and having null in their phone number field.
Thank you for the very clear explanation. Just a question: at 11:50 you are considering among candidate keys also {Name, Phone} but according to definition, candidate key is a minimal set of attributes to be key. Since we have already considered {ID} and {SSN} as keys, minimal set of attributes to be key is 1, while in the case {Name, Phone} set of attribute is 2, which is greater. So why do we consider {Name, Phone} still as candidate key?
"minimal set of attributes" it implies that if you remove an attribute from it, it's no longer a key. minimal doesn't mean number of attributes, implies no extra attributes
Sir could you post SQL tutorial
12:41 here , (salary and phone) too.
You can add one thing here that is unique key allow only one null value....not more than one
So, super key is set of all possible combinations of attributes that can uniquely identify tuples. Is it right?
Composite key at 19:28
If a column does not uniquely identify a tuple..it can't be a key...then how can u say email I'd can be a super key while it can contain null value
can a candidate key have null values?pls anyone reply
Yess...Candidate key attribute can contain null values.
Also know that it does not allow the same value in the attribute field.
nandri thale
😂😂
Mass bro nee 😂
Lecturer key loves names like yusuf, alya, John , Robin etc.
How can {Name, Phone} uniquely identify a tuple? Phone is nullable, right?
I think we can set it to NOT NULL
l think Name and Phone togather cant be a super key, cause we can have two Johns that dont have phone numbers! please correct me if im wrong
phone no is unique also it is can be null so it is super key i think
In the super key what if two employees having same name both don't have phone number , how will you uniquely edit their data
Then it is not a super key, a super key should have attributes that are uniquely identifiable for each entry
bro in 12:42 {name,email } will come or not ?
No...becoz name attribute has already appeared ...in {Name, phone} so u can't have repeated attributes in candidate keys... same goes for email...see this part again 12:17 ...as u can see the email has also appeared once{Email} so u can't hv it again.
Unique key can b id or ssn right.. how come name, phone will be unique key
I have the same question how the phone number can be a unique key? There could be multiple nulls.
1.75 X club
salary also can't be a superkey, right?
Yupp
🎉🎉
How can the set {Name, Phone} be a super key if multiple people can have the same name and not every person has a phone number?
Super key is possible of all combinations even null attributes can be used
Phone number alone and with others can be made super key but name won't !
Ask ChatGpt after providing some attributes to it
Let's assume a airplane reservation system. What can be a primary key? Flight Number or Flight Number+Date
I think both can act as a primary key but according to lecture " primary key should never and rarely be changed " 15:55 So there may be chance of date not mentioned (null) so flight number will definitely be a primary key.
yramirp yek dne: 14:32
at 19:19 name is not a unique key phone is a unique key and you are saying that set of name and phone is unique key, what if two employee of same name don't have phone number.
only phone number is also not a key. multiple employee might have no phone....2ndnot- employees with same name might also have no phone. so 'only name', 'only phone number', 'both name and phone number' are not keys...forget which type...those are not key first
8:16
12:28
why email is not unique key> as it is unique and null value
some companies allow employees to have multiple email addresses, or they might have an email alias system where multiple employees share the same email domain. Additionally, allowing null values means that not all employees are required to have an email address, which further complicates setting it as a unique key.
Evatiki keys chepdam Saritha radhu ra😂😂😂😂😂
Primary key --> PK
PK is unique, NOT NULL, required , never duplicate and used for uniquely identify the data in table.
every table have a max 1 PK.
create table empinfo(
id number primary key,
ename varchar2(20),
deptid number
);
Unique key --> UK
UK is unique, required, never duplicate and used for uniquely identify the data in table.
table can have more than 1 unique key.
UK allows null.
every null is unique, we can not compare null to another null. thats why UK allows null, because it treats every null as unique.
10+null = null
10- null = null
null is unknown and undefined, we do not know the value, so it always gives us null
2.4 mil oof
Who’ll say composite key? Me?
it is there at 19:40
Lol
OMG, no no no no!
Why
Koi BCA 2nd Sem se hai