473,753 Members | 7,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Theoretical definition for the number of unique values?

Hi Everyone,
Here is a theoretical, and definition question for you.
In databases, we have:

Relation
a table with columns and rows

Attribute
a named column/field of a relation

Domain
a set of allowable values for one or more attributes

Tuple
a row of a relation

Degree
the number of attributes a relation contains
Number of fields in a table

Cardinality
the number of tuples/rows a relation contains

But!

What is the definition for the number of unique values in a field?

So, if you have 100 rows in a table, and the field is
the gender field, with only values of: Y, N.
You have 2 unique values.
What do we call this concept?
"the number of unique values in a column?"

Is there one?
Thanks a lot!

Apr 12 '07 #1
11 3946
sq************* @yahoo.com wrote:
Hi Everyone,
Here is a theoretical, and definition question for you.
In databases, we have:

Relation
a table with columns and rows

Attribute
a named column/field of a relation

Domain
a set of allowable values for one or more attributes

Tuple
a row of a relation

Degree
the number of attributes a relation contains
Number of fields in a table

Cardinality
the number of tuples/rows a relation contains

But!

What is the definition for the number of unique values in a field?

So, if you have 100 rows in a table, and the field is
the gender field, with only values of: Y, N.
You have 2 unique values.
What do we call this concept?
"the number of unique values in a column?"

Is there one?
It is the cardinality of the projection onto the attribute, which may or
may not equal the cardinality of the domain. Same concept just qualified
differently.
Apr 12 '07 #2
On Apr 12, 7:19 am, sqlservernew... @yahoo.com wrote:
"the number of unique values in a column?"
NDV - number of distinct values. There is nothing theoretical about it.

Apr 12 '07 #3
On Apr 12, 11:19 am, sqlservernew... @yahoo.com wrote:
Hi Everyone,

Here is a theoretical, and definition question for you.

In databases, we have:

Relation
a table with columns and rows

Attribute
a named column/field of a relation

Domain
a set of allowable values for one or more attributes

Tuple
a row of a relation

Degree
the number of attributes a relation contains
Number of fields in a table

Cardinality
the number of tuples/rows a relation contains

But!

What is the definition for the number of unique values in a field?

So, if you have 100 rows in a table, and the field is
the gender field, with only values of: Y, N.
You have 2 unique values.

What do we call this concept?
"the number of unique values in a column?"

Is there one?

Thanks a lot!
The Oracle statistics refer to this as the number of DISTINCT values.

Off the top of my head I do not remember any relational theory concept
that applies. The range of valid values for the attribute would be
the DOMAIN and each value in the domain would be distinct since the
domain concept has no relation to the actual number of occurrences for
real data.

Maybe someone else will remember a concept that applies to one of the
versions of relational theory.

HTH -- Mark D Powell --


Apr 12 '07 #4
On Apr 12, 10:19 am, sqlservernew... @yahoo.com wrote:
Hi Everyone,

Here is a theoretical, and definition question for you.

In databases, we have:

Relation
a table with columns and rows

Attribute
a named column/field of a relation

Domain
a set of allowable values for one or more attributes

Tuple
a row of a relation

Degree
the number of attributes a relation contains
Number of fields in a table

Cardinality
the number of tuples/rows a relation contains

But!

What is the definition for the number of unique values in a field?

So, if you have 100 rows in a table, and the field is
the gender field, with only values of: Y, N.
You have 2 unique values.

What do we call this concept?
"the number of unique values in a column?"

Is there one?

Thanks a lot!
I believe it is referred to as 'cardinality'. Which should be covered
in your text and by your instructor.
David Fitzjarrell

Apr 12 '07 #5
I found out. It is called "COLUMN CARDINALITY"

Sorry, no prizes.
http://www.informatik.uni-trier.de/~...WhangVT90.html
(1) obtaining the column cardinality (the number of unique values in a
column of a relation) and
(2) obtaining the join selectivity (the number of unique values in the
join column resulting from an unconditional join divided by the number
of unique join column values in the relation to Be joined).

These two parameters are important statistics that are used in
relational query optimization and physical database design.

http://www.idig.za.net/mysqlindexes/2006/11/09/
Column cardinality. This is the number of unique values contained in a
column. Indexes work best when there is a high cardinality. Put
another way, the more unique values there are (fewer duplicates) the
better that column will be for indexing. Consider the ID number column
of the previous example. Here there are no duplicates, only unique
values. This column will be ideal for indexing. On the other end of
the scale may be the first names column. Here there will probably be a
number of duplicate names (fewer unique values) and a lower
cardinality compared to the ID column.




Apr 13 '07 #6
On Apr 12, 4:19 pm, sqlservernew... @yahoo.com wrote:
Hi Everyone,

Here is a theoretical, and definition question for you.

In databases, we have:

Relation
a table with columns and rows

Attribute
a named column/field of a relation

Domain
a set of allowable values for one or more attributes

Tuple
a row of a relation

Degree
the number of attributes a relation contains
Number of fields in a table

Cardinality
the number of tuples/rows a relation contains

But!

What is the definition for the number of unique values in a field?

So, if you have 100 rows in a table, and the field is
the gender field, with only values of: Y, N.
You have 2 unique values.

What do we call this concept?
"the number of unique values in a column?"

Is there one?

Thanks a lot!
I do not believe there is a specific terminology or usefulness for
such concept. You may call it *domain attribute projection
cardinality* (I just made it up but it could be a description of
underlying concepts).

Apr 13 '07 #7
On Apr 12, 4:19 pm, sqlservernew... @yahoo.com wrote:
Degree
the number of attributes a relation contains
Number of fields in a table
A table does not have "fields".
Apr 14 '07 #8
On 12 Apr 2007 18:23:07 -0700, sq************* @yahoo.com wrote:
>I found out. It is called "COLUMN CARDINALITY"

Sorry, no prizes.
http://www.informatik.uni-trier.de/~...WhangVT90.html
(1) obtaining the column cardinality (the number of unique values in a
column of a relation) and
(2) obtaining the join selectivity (the number of unique values in the
join column resulting from an unconditional join divided by the number
of unique join column values in the relation to Be joined).

These two parameters are important statistics that are used in
relational query optimization and physical database design.

http://www.idig.za.net/mysqlindexes/2006/11/09/
Column cardinality. This is the number of unique values contained in a
column. Indexes work best when there is a high cardinality. Put
another way, the more unique values there are (fewer duplicates) the
better that column will be for indexing. Consider the ID number column
of the previous example. Here there are no duplicates, only unique
values. This column will be ideal for indexing. On the other end of
the scale may be the first names column. Here there will probably be a
number of duplicate names (fewer unique values) and a lower
cardinality compared to the ID column.
Yes, cardinality is the correct term.

Now, for bonus credits: can anyone tell me the correct term for
someone who posts a homework question here, gets an answer, and then
pretends he worked the answer out for himself?

Lemming
--
Curiosity *may* have killed Schrodinger's cat.
Apr 28 '07 #9
On Apr 27, 8:21 pm, Lemming <thiswillbou... @bumblbee.demon .co.uk>
wrote:
On 12 Apr 2007 18:23:07 -0700, sqlservernew... @yahoo.com wrote:


I found out. It is called "COLUMN CARDINALITY"
Sorry, no prizes.
http://www.informatik.uni-trier.de/~...WhangVT90.html
(1) obtaining the column cardinality (the number of unique values in a
column of a relation) and
(2) obtaining the join selectivity (the number of unique values in the
join column resulting from an unconditional join divided by the number
of unique join column values in the relation to Be joined).
These two parameters are important statistics that are used in
relational query optimization and physical database design.
http://www.idig.za.net/mysqlindexes/2006/11/09/
Column cardinality. This is the number of unique values contained in a
column. Indexes work best when there is a high cardinality. Put
another way, the more unique values there are (fewer duplicates) the
better that column will be for indexing. Consider the ID number column
of the previous example. Here there are no duplicates, only unique
values. This column will be ideal for indexing. On the other end of
the scale may be the first names column. Here there will probably be a
number of duplicate names (fewer unique values) and a lower
cardinality compared to the ID column.

Yes, cardinality is the correct term.

Now, for bonus credits: can anyone tell me the correct term for
someone who posts a homework question here, gets an answer, and then
pretends he worked the answer out for himself?

Lemming
--
Curiosity *may* have killed Schrodinger's cat
Way to jump all over a thread that died 2 weeks ago.

Apr 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
405
by: sqlservernewbie | last post by:
Hi Everyone, Here is a theoretical, and definition question for you. In databases, we have: Relation a table with columns and rows
0
9072
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8896
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9451
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9333
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8328
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4771
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3395
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2872
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.