By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,704 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

What is Cardinality

P: n/a
-----Cross posted on comp.databases.ms-sqlserver and
microsoft.public.sqlserver.programming-----

Can someone please explain cardinality to me? I am having a problem with an
insert from a webpage.

When a user adds a venue with an event I need both tables to populate.
Currently only the event table populates the right info and the venue does
not. I am using SELECT SCOPE IDENTITY to get the last inserted venue to
associate with each event. That is to say that each event has a column for
venue and that value is incorrectly being added as 0, the default value. The
venue is not getting added.
It worked fine until I got to ID number 87 which was the 62nd venue.

When I look at my table structure in php myadmin my cardinality is different
depending on what field. ID is 67 and Address is 6. Something seems wierd,
but I don't understand cardinality so much.
Thanks!
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> Can someone please explain cardinality to me?

Here is the very basic concept... cardinality is basically the distribution
of unique values in a column. A bit column, for example, has low
cardinality because it only has three possible values (0,1,NULL). Whereas a
primary key column (or a column with a unique index/constraint) has very
high cardinality, because by definition, every value is unique.
When a user adds a venue with an event I need both tables to populate.
Currently only the event table populates the right info and the venue does
not. I am using SELECT SCOPE IDENTITY to get the last inserted venue to
associate with each event. That is to say that each event has a column for
venue and that value is incorrectly being added as 0, the default value. The venue is not getting added.


I don't think cardinality has anything to do with your issue. Sounds like a
coding error. Can you provide your table structure, sample data, and the
query that is failing. See my sig for details on proper format.

--
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
Jul 23 '05 #2

P: n/a
Lee
See number 8 in the second list:
http://www.sqlteam.com/item.asp?ItemID=122

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.