473,403 Members | 2,354 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,403 software developers and data experts.

What is Cardinality

-----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
2 10431
> 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
Lee
See number 8 in the second list:
http://www.sqlteam.com/item.asp?ItemID=122

Jul 23 '05 #3

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

Similar topics

2
by: pnichols | last post by:
We have a large select statement being executed statically from an SQL stored procedure, such as: SELECT ...about 100 columns... FROM ...about 30 tables... WHERE ...about 10 predicates... AND...
7
by: janet | last post by:
HI, We had some data which had low cardinality (86) , the count for that table is 9 million rows. How to optimize query which involve joining this table on that column? I'm not sure if...
375
by: rkusenet | last post by:
This article is very bleak about future of DB2. How credible is the author. http://www.eweek.com/article2/0,1895,1839681,00.asp
5
by: MLH | last post by:
Cardinality? I hear it spoken of by MySQL users. Does it matter to MS Access if MySQL tables are attached via ODBC?
2
by: scott.swank | last post by:
Hello all. I'm running SQL Server 2000 and I'm trying to get a very few, recent rows of data from a table based on an indexed datetime column. Here's my predicate: where order_date >...
0
by: Istvan | last post by:
Hello Maybe somebody know how to construct the cardinality functions of required for XPath 2.0, XQuery 1.0 and XSLT 2.0 ? there are three functions normally, fn:zero-or-one(item,item,...) ...
2
by: uwcssa | last post by:
is there a way to see the actual (not just estimated) cost and cardinality at each plan operator? SQL Server and Oracle has such feature but I failed to find a way in DB2 yet (up to V9.5)
0
by: db2admin | last post by:
hello, I have compressed table 442992 rows and when i run explain plan on this table for some SQL using this table, i see table scan and cardinality on top of table node as 18458. I am new to...
4
by: sunarb | last post by:
I want to know the exact difference between these two applications.as per my knowledge web app is an application run by the sever or simply a website. and even this enterprise application also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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,...
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
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.