By the value in unique key we can identify the whole record but if there are two null values in that column then how we can identify a particular record uniquely
Even if there is only one NULL you can't identify that particular row becoz NULL contain some unknown value. I can understand your situation as well i m very impressed by your question. I cant believe that i forgot to discuss this part in this series. OK Let's talk about NULL what do you think about NULL i mean according to you what is NULL ? It seems you are taking NULL as string but NULL is something which doesn't really exists or we can't imagine what it could be or an unknown value. So Let's see this example there are two unknown person can u tell both these are same guy or different ? NO, You can't tell becoz you don't know them this is what NULL is. NULL (first unknown person) and NULL (2nd unknown person) it means NULL is not equal to NULL in SQL. I hope it is clear to you ?
Geeky Shows k I know the functionality of NULL but as like primary key doesn't accept duplicate we have to give auto_constraint to it without which error appear similarly we should give auto_contraint to this also naaa ...... As the only difference between primary key n unique key is PK don't accept NULL values n UK accept it
There is one more difference there can be only one PRIMARY KEY in a table while UNIQUE KEY may be more than one. Trust me you will understand the genuine use of UK and PK when you will do some real project for now i believe your concept has clear.
Hello , I tried to use Alter command with UNIQUE but it is showing errror: alter table student add state varchar (10) UNIQUE KEY This command not working ..pls help
*Sir is ka meaning kya ha?* Error SQL query: -- -- Indexes for dumped tables -- -- -- Indexes for table `ertable` -- ALTER TABLE `ertable` ADD PRIMARY KEY (`Sr`); MySQL said: Documentation #1068 - Multiple primary key defined
Sir....I think u r pursuing your IT degree from ignou ..So sir bca ya MCA kr rhe ho aap? Or sir web development k videos bnaye..How to become a good web developer?? Bahut help hogi sir