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}?
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
At 12:14 Wouldn't name ,email also be candidate key ...because name alone cannot be a key but when combined with phone number it become candidate key ....so I think name combined with email will also be candidate key ...... correct me if I am wrong
@@ezanatadesa2485 If Phone Number can be NULL, then (Name, Phone Number) cannot even be a candidate key can it? If John 101 and John 105 both have a NULL phone number then the key does not uniquely identify the tuple.
@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? 🤔🤔🤔
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.
its not mandatory chosen by DBA its depends on application developer which field is required and why so correct your knowledge DBA only responsible for permission related access not application related
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
One doubt : Super keys contain null values : {name,phone number} but if 1.{ john,null } and again in table we have 2.{john,null} than how we will identify the actual john than how it is valid…
Name and phone no can't be super key. Super key should able to uniquely identify tuple. It should have atleast one attribute which is able to uniquely identify tuple, along with it can continue additional attribute which are not helping to uniquely identify the tuple. Ssn,name and phone no can be super key
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
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....
@@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
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.
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.
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.
1000 times better explanation than our college teachers.. 👍
Which university
True
shruti memda
You are a data science student
My professor doesn't even know what he's most of the time, thankfully we have the help we can get here. Thank you very much!
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 .
@@Hey_Haroon Email in alone is superkeu? Because it has null row
Oh my goodness. You explained the complex Lecture to a lay_man's view. I subscribed right away. Sending love from Zambia
🇿🇲🇿🇲🇿🇲🇿🇲🇿🇲
The session is too engaging ,Sir. Got cleared with all the concepts🙂.Thankyou sir
Such a great teacher with clean and clear explanation! thank you!
Precise And to the point.Well done 👍
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
really! understood very clearly , mainly this session has been too engaging without lag.
Thank you for giving the knowledge about DBMS Keys ❤
It is not that difficult , it was just clarity i needed. Thank you
Thank you for the explanation. Your explanation really helped in clearing the concepts regarding the keys.👍Great work!
clears all the concept about keys
Good explanation 😊
Very very clear, really useful, wonderful explanation.great mentor u r sir, pls put more videos regarding dbms sir 🙏🙏🙏
Nicely explained , Thnxx alot 💙
Fantastic... Teaching..Great Sir Thank you sir
very clear explanation. thank you
seriously better than my professor!!!
Great Explaination Sir !!!!
You are a great teacher
Very nicely explained
Really use very usefull. Appreciated your efforts of sharing !!!
excellent work sir, thank you!
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}?
Beautifully explained, thank you!
Thanks very clear explanation
1.75 X club
Simple and effective explanation. Thank you
Well understood, Thanks❤
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
Great teacher !!!
Thanks NESO academy for this! Indeed and infromative video !
Great lacture thank you for making such wonderful video .
great ...explanation
Super explanation 👌👌👌
Wow, appreciate you for this.
At 12:14 Wouldn't name ,email also be candidate key ...because name alone cannot be a key but when combined with phone number it become candidate key ....so I think name combined with email will also be candidate key ...... correct me if I am wrong
You're right, If PhoneNumber and Email are not unique across tuples then both {Name, PhoneNumber} and {Name, Email} can be candidate keys.
@@ezanatadesa2485 If Phone Number can be NULL, then (Name, Phone Number) cannot even be a candidate key can it?
If John 101 and John 105 both have a NULL phone number then the key does not uniquely identify the tuple.
great teacher😊
Nice explanation 💥💥💯
Thank you so much sir 😃😃👌
Excellent!!
Thank you sir 😊
You can add one thing here that is unique key allow only one null value....not more than one
Where is the tutorial of Normalization? I need it right now hehe, were done at keys in rdbms
Damn good explanation
thank you i learnt alot from your work
😃😃😃😃😃😃
@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.
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.
wonderful!!thanks,i understand it 100%😂
Thank you so much!
Thank you sir for nice explanation ❤️
Sir Unique key means it accepted null values or not
its not mandatory chosen by DBA its depends on application developer which field is required and why so correct your knowledge DBA only responsible for permission related access not application related
Thank You
So, the unique key, must support null values apart from being unique ?
Composite key at 19:28
100/10 ❤
super key is like super set.but actually it is power set of keys
Thanks for a lot
Thank you !
Thanks !
Im getting a Neso Academy tattoo
12:16 why phone number isn't a candidate key
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
One doubt :
Super keys contain null values :
{name,phone number} but if
1.{ john,null } and again in table we have
2.{john,null} than how we will identify the actual john than how it is valid…
Name and phone no can't be super key. Super key should able to uniquely identify tuple. It should have atleast one attribute which is able to uniquely identify tuple, along with it can continue additional attribute which are not helping to uniquely identify the tuple. Ssn,name and phone no can be super key
Thanks
Email in alone is superkeu? Because it has null row
Lecturer key loves names like yusuf, alya, John , Robin etc.
Thankyou sir ❤❤❤❤😊😊😊
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
Can someone please explain what is a unique key because it seemed same as alternate keys
Thanks bro
Is it possible for a unique and composite key to be something other than a candidate key?
(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....
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😢
nandri thale
😂😂
Mass bro nee 😂
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
awesome
12:41 here , (salary and phone) too.
Which one was the foreign key ??? Dept. Code or any other ??
Sir could you post SQL tutorial
So, super key is set of all possible combinations of attributes that can uniquely identify tuples. Is it right?
Can only a null value be a candidate key?
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.
candidate key can also have a null value
It is possible that both john have null phone numbers than how can we identify the actual john?????????? From the table ………
Simple It's ID
ID is always Unique
why is salary on the table if you dont make use of it? Why is it not an alternate key?
How can {Name, Phone} uniquely identify a tuple? Phone is nullable, right?
I think we can set it to NOT NULL
salary also can't be a superkey, right?
Yupp
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
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
Great
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.
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.
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
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.
Who’ll say composite key? Me?
it is there at 19:40
Lol