in Databases
863 views
1 vote
1 vote

Answer should be $0$ row,right?

in Databases
by
863 views

4 Comments

here i meant implementation of a unique key with  not null when we dont declare a primary key for a table as either we have to declare a key as primary key or we can manage it by declaring unique not null.

.

for a table to exist uniquely there must be a primary key so as to prevent the wastage of space to be more precise.
0
0

that what i am saying also.... even though you declare PK, UK + NOT NULL internally declared as PK

to prevent the wastage of space to be more precise

The space required for declaring UK and PK is equal 

0
0
here i have not compared memory for uk and pk...

i have told about why we need to identify records uniquely either by uk or by pk.
0
0

2 Answers

1 vote
1 vote
yes Given answer is Wrong ..it should return 0 rows..

In database the NULL is Undefined or Unknown .. so one Null can never be equal to another NULL ..

So as there is no matching .. it will simply return 0 rows...Definately it will compare NULL with NULL ...

but as they are unknown we can say nothing ...as a result compiler will simply return 0 rows
0 votes
0 votes
comparing null with null gives you error in mySql.

1 comment

NULL when compared to null gives Null in SQL.

0
0

Related questions