Professional Web Applications Themes

Theoretical definition for the number of unique values? - MySQL

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 ...

  1. #1

    Default 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: M, F.
    The result is 2 unique values.


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

    Is there one?


    Thanks a lot!

    sqlservernewbie@yahoo.com Guest

  2. #2

    Default Re: Theoretical definition for the number of unique values?

    com wrote:
     

    Using your definitions, it'd probably be "the cardinality of the
    domain."


    Larry Coon
    University of California
    Larry Guest

  3. #3

    Default Re: Theoretical definition for the number of unique values?

    On Apr 12, 11:47 am, com wrote: 

    distinct values

    For a column or set of columns which together an index is created from
    you can think of it as distinct keys

    hpuxrac Guest

  4. #4

    Default Re: Theoretical definition for the number of unique values?

    com wrote: 

    (Column) Cardinality = number of distinct column/attribute values.
    Table Cardinality = number of rows in a table.

    --
    Jeroen


    The Guest

  5. #5

    Default Re: Theoretical definition for the number of unique values?

    In article <461e877b$0$328$xs4all.nl>,
    Spam.Please.invalid says... 
    >
    > (Column) Cardinality = number of distinct column/attribute values.
    > Table Cardinality = number of rows in a table.[/ref]

    Shouldn't that be *distinct* (non-duplicate) rows in the table?


    --
    Remove the ns_ from if replying by e-mail (but keep posts in the
    newsgroups if possible).
    David Guest

  6. #6

    Default Re: Theoretical definition for the number of unique values?

    On Apr 12, 4:14 pm, David Kerber
    <com> wrote: [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]

    >
    > Shouldn't that be *distinct* (non-duplicate) rows in the table?[/ref]

    I believe that one of the cardinal rules (pun intended) of RDBMS
    theory is that a table can never have duplicate rows.
     


    Gord Guest

  7. #7

    Default Re: Theoretical definition for the number of unique values?

     
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > > 
    > >
    > > Shouldn't that be *distinct* (non-duplicate) rows in the table?[/ref]
    >
    > I believe that one of the cardinal rules (pun intended) of RDBMS
    > theory is that a table can never have duplicate rows.[/ref]

    True. There's no point in having duplicate rows, cause you can't tell
    which one you're handling :-)



    --
    Martijn Tonies
    Database Workbench - development tool for MySQL, and more!
    Upscene Productions
    http://www.upscene.com
    My thoughts:
    http://blog.upscene.com/martijn/
    Database development questions? Check the forum!
    http://www.databasedevelopmentforum.com


    Martijn Guest

  8. #8

    Default Re: Theoretical definition for the number of unique values?

    In article <461f2fcd$0$11982$news.xs4all.nl>,
    removethis.com says... 
    > >
    > > I believe that one of the cardinal rules (pun intended) of RDBMS
    > > theory is that a table can never have duplicate rows.[/ref]
    >
    > True. There's no point in having duplicate rows, cause you can't tell
    > which one you're handling :-)[/ref]

    True, but are you telling me you've never had it happen accidentally??


    --
    Remove the ns_ from if replying by e-mail (but keep posts in the
    newsgroups if possible).
    David Guest

  9. #9

    Default Re: Theoretical definition for the number of unique values?

    David Kerber wrote:
     
    >
    > True, but are you telling me you've never had it happen accidentally??[/ref]

    Assuming the database is being used as more than an electronic form
    of Excel or 3x5 cards ... no. Primary key constraints were invented
    for a reason. Like seat belts they are most useful when used.
    --
    Daniel A. Morgan
    University of Washington
    damorganx.washington.edu
    (replace x with u to respond)
    Puget Sound Oracle Users Group
    www.psoug.org
    DA Guest

Similar Threads

  1. Replies: 5
    Last Post: December 12th, 10:29 PM
  2. can I show only unique values in a List?
    By Mark.P. in forum Macromedia Flash Data Integration
    Replies: 2
    Last Post: October 2nd, 12:57 PM
  3. counting number of unique entries under a column
    By mr_burns in forum PHP Development
    Replies: 2
    Last Post: October 9th, 07:29 PM
  4. Best method for obtaining unique values?
    By David in forum Microsoft SQL / MS SQL Server
    Replies: 5
    Last Post: August 8th, 01:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139