Keys in RDBMS
Вставка
- Опубліковано 30 лип 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!
Precise And to the point.Well done 👍
The session is too engaging ,Sir. Got cleared with all the concepts🙂.Thankyou sir
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 .
you explained it 10/10, thank you so much!
Beautifully explained, thank you!
thank you for speaking clearly, finally found a video in which i can understand what its said
Oh my goodness. You explained the complex Lecture to a lay_man's view. I subscribed right away. Sending love from Zambia
🇿🇲🇿🇲🇿🇲🇿🇲🇿🇲
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!
very clear explanation. thank you
Very very clear, really useful, wonderful explanation.great mentor u r sir, pls put more videos regarding dbms sir 🙏🙏🙏
Thank you for giving the knowledge about DBMS Keys ❤
Well understood, Thanks❤
excellent work sir, thank you!
Thank you so much sir 😃😃👌
Thanks very clear explanation
Fantastic... Teaching..Great Sir Thank you sir
Thank you sir 😊
Wow, appreciate you for this.
Thank you so much!
clears all the concept about keys
thank you i learnt alot from your work
😃😃😃😃😃😃
Simple and effective explanation. Thank you
Great Explaination Sir !!!!
It is not that difficult , it was just clarity i needed. Thank you
@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.
Is it possible for a unique and composite key to be something other than a candidate key?
Very nicely explained
You are a great teacher
really! understood very clearly , mainly this session has been too engaging without lag.
Where is the tutorial of Normalization? I need it right now hehe, were done at keys in rdbms
Nice explanation 💥💥💯
Can someone please explain what is a unique key because it seemed same as alternate keys
seriously better than my professor!!!
Great teacher !!!
Thank you sir for nice explanation ❤️
great teacher😊
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😢
why is salary on the table if you dont make use of it? Why is it not an alternate key?
Thanks for a lot
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}?
(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....
Thank you !
Thanks
Super explanation 👌👌👌
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
Which one was the foreign key ??? Dept. Code or any other ??
Thankyou sir ❤❤❤❤😊😊😊
Thankyou sir ✨
wonderful!!thanks,i understand it 100%😂
So, super key is set of all possible combinations of attributes that can uniquely identify tuples. Is it right?
Thanks !
Thank You
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
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
Thanks bro
Thank you
how name and phone can be super key if there are 2 employees with same name and having null in their phone number field.
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
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.
super key is like super set.but actually it is power set of keys
100/10 ❤
Great
How can {Name, Phone} uniquely identify a tuple? Phone is nullable, right?
I think we can set it to NOT NULL
You can add one thing here that is unique key allow only one null value....not more than one
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
12:41 here , (salary and phone) too.
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.
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
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.
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.
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
Composite key at 19:28
salary also can't be a superkey, right?
Yupp
Sir could you post SQL tutorial
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.
nandri thale
😂😂
Mass bro nee 😂
Lecturer key loves names like yusuf, alya, John , Robin etc.
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.
1.75 X club
yramirp yek dne: 14:32
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
8:16
🎉🎉
12:28
Evatiki keys chepdam Saritha radhu ra😂😂😂😂😂
2.4 mil oof
OMG, no no no no!
Why
Who’ll say composite key? Me?
it is there at 19:40
Lol
Koi BCA 2nd Sem se hai