473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

NULL values & UNIQUE Key

Hi,
I have some doubts regarding NULL values. Can any one help me in clearing my doubts.

I have created a table:-
create table suppliers
(
supplier_id number,
supplier_name varchar2(10)
);

Next, I will insert two records into this table.

insert into suppliers (supplier_id, supplier_name )
values ( 10565, null );

insert into suppliers (supplier_id, supplier_name )
values ( 10566, '' );

Q 1) Can any one tell which is the null value, whether it is supplier_name having 10565 or 10506.


2) Empty String is null value
or
NULL is null value

3) Because of this Null value doubts i have another doubt . How many null values can be their in a column if that column is defined as UNIQUE?


Regards,
Naveen
Jul 15 '07 #1
2 2691
debasisdas
8,127 Expert 4TB
The supplier_id having value 10565 contains NULL in the supplier_name field.

There is no limit to the number of null values in acolumn if that column is defined as UNIQUE, simply because Null is not a value it means nothing ,it is simply null.
Jul 16 '07 #2
Supplier_id=10565 ,supplier_name is null value
Supplier_id=10566 ,supplier_name is empty value

Null is not equal to null,empty string or blank space.
Null is nothing but unavailable.

u can use any no of null values for unique column values
Jul 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
13
by: Federico Balbi | last post by:
Hi, I was wondering if PGSQL has a function similar to binary_checksum() of MS SQL Server 2000. It is pretty handy when it comes to compare rows of data instead of having to write long boolean...
12
by: Miles Keaton | last post by:
PG peeps: What's the prevailing wisdom & best-practice advice about when to let a varchar (or any) column be NULL, and when to make it NOT NULL DEFAULT '' (or '0000-00-00' or whatever) - in...
7
by: ProvoWallis | last post by:
I'm still learning python so this might be a crazy question but I thought I would ask anyway. Can anyone tell me if it is possible to join two dictionaries together to create a new dictionary using...
7
by: teddysnips | last post by:
Table DDL below: The tables I have contain Timesheet information. Each row in the tblTSCollected table contains an entry for an employee into the timesheet system, specifically by scanning the...
7
by: am72de | last post by:
Hi all, I've posted this problem some weeks ago, but noone had a solution. Perhaps now someone could help me. I have the following tables: Create Table T1 ( ID1 int Not Null , ID2 int Not...
3
by: binder | last post by:
I am designing a new table with a few columns that may or may not have a value on each row that is inserted. What issues determine whether to allow a NULL value to be inserted for that column or...
3
by: Ganesh Palaniappan | last post by:
We're getting following exception for the below piece of code. We're wondering how it is possible since we're having a null check for objGraphics and strokePen... Exception:...
3
by: Suyash Upadhyay | last post by:
Hi all, I want to ask whether MySQL also treat two NULL values as different values like Oracle. I write following commands but MySQL generate NULL value for all enrollment no field...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.