Questions tagged [cardinality]

In data modeling, the cardinality of one data table with respect to another data table is a critical aspect of database design. Relationships between data tables define cardinality when explaining how each table links to another. In the relational model, tables can be related as any of: many-to-many, many-to-one (rev. one-to-many), or one-to-one. This is said to be the cardinality of a given table in relation to another.

In data modeling, the cardinality of one data table with respect to another data table is a critical aspect of database design. Relationships between data tables define cardinality when explaining how each table links to another.

In the relational model, tables can be related as any of: many-to-many, many-to-one (rev. one-to-many), or one-to-one. This is said to be the cardinality of a given table in relation to another.

Wikipedia article

274 questions
2
votes
1 answer

Proving that two specific sets have equal cardinality in Isabelle

I´m having trouble proving that two sets have the same cardinality. All the following sets are finite. First let´s assume we have set (M::b set) and a function foo :: "b set ⇒ b set ⇒ bool" such that (foo A C = foo B C ⟷ A = B) and for every A in…
RichiePoor
  • 53
  • 2
2
votes
1 answer

Jaccard similarity algorithm for thousands of huge datasets in runtime

What I need I'm looking for pretty fast and accurate way to find Jaccard similarity among multiple huge sets of data. I could have up to 10.000-20.000 operations of calculating Jaccard similarity. Due to the need to calculate all Jaccard…
VB_
  • 45,112
  • 42
  • 145
  • 293
2
votes
1 answer

Reasoner in Protege not working with Restrictions/Cardinalities

I am currently building/modifying a larger ontology. As I had problems to define restrictions I build a very short example: I have EuropeanCountry as a class and IslandCountry as a class:
tanktoo
  • 181
  • 12
2
votes
1 answer

Redis Hyperloglog limitations

I am trying to solve a problem in a hacky way using Redis Hyperloglog but what I am trying to understand is the limitations and assumptions by Hyperloglog on the data or the distribution. The count-min and bloom filter have their own set of…
Chenna V
  • 10,185
  • 11
  • 77
  • 104
2
votes
1 answer

How to change arrows in vis.js to chicken feet or cardinality

I am trying to use vis.js to show the structure of an XML or JSON Schema. I would like to show cardinality instead of an arrow. Any suggestions on documentation to view, because I cannot find any. Thanks, Loren
Loren Cahlander
  • 1,257
  • 1
  • 10
  • 24
2
votes
1 answer

Class diagram of category and sub-category

I have a simple relationship between product and category I came up with this diagram: A product can be assigned to 1 or many categories A category can have 0 or many sub-category A category can have 0 or 1 parent category When you delete a…
iOSGeek
  • 5,115
  • 9
  • 46
  • 74
2
votes
1 answer

Can cardinality differ for duplicate indexes in mysql?

I have a table which has duplicate indexes(same column is indexed twice (BTREE)) but surprisingly cardinality is different. Why this is happening. 'ACCENTURE_PASSIVE_CANDIDATES', '1', 'LD_INDEX', '1', 'LOCATION_DISTANCE', 'A', '37876', NULL, NULL,…
Ajit Kumar
  • 41
  • 1
  • 7
2
votes
2 answers

Trying to understand cardinality in an entity relationship diagram?

I'm quite new to relational databases and have been having a lot of trouble recently trying to understand an entity relationship diagram I've been given. Here it is: Solicitor ERD (ERD is for a made up solicitor company) Basically my task is to…
Toby95
  • 43
  • 1
  • 6
2
votes
1 answer

How to get distinct documents in elasticsearch

I have a documents with fields campaign_id (not unique), clicks (same for each campaign_id). How to count sum of unique campaign_ids clicks. e.g. campaign_id=1, clicks=2; campaign_id=2, clicks=3; campaign_id=1, clicks=2; Sum of unique campaign_id's…
Igor
  • 149
  • 2
  • 9
2
votes
1 answer

How to improve performance of PIG job that uses Datafu's Hyperloglog for estimating cardinality?

I am using Datafu's Hyperloglog UDF to estimate a count of unique ids in my dataset. In this case I have 320 million unique ids that may appear multiple times in my dataset. Dataset : Country, ID. Here is my code : REGISTER…
mnadig
  • 81
  • 2
  • 7
2
votes
2 answers

Query running slow in SQL Server 2014 because of DISTINCT operation, working fine in SQL Server 2012

Query looks something like this: SELECT A.Id, COUNT(DISTINCT (CASE WHEN (C.TypeId in (54, 57, 58, 59) OR (ISNULL(B.count1, 0) + ISNULL(B.count3, 0) + ISNULL(B.count2, 0) > 0)) THEN D.AdrsId …
2
votes
1 answer

Akka actor cardinality

After reading most of the Akka docs, I still don't understand something fairly fundamental to Akka: actor cardinality. Meaning, if I have a particular actor, say FizzActor, does Akka ever only create 1 instance of it, or does it spawn n-instances of…
smeeb
  • 27,777
  • 57
  • 250
  • 447
2
votes
1 answer

why is data.fu implementing HyperLogLog as an accumulator and not as algebraic?

data.fu has a nice implementation of HyperLogLog for estimating cardinality here However, it's implemented as Accumulator which means it will run only at the reducer and not in the combiner (but it will never load the entire set into memory as in…
ihadanny
  • 4,377
  • 7
  • 45
  • 76
2
votes
1 answer

Cardinality restrictions on SPARQL

My question is about SPARQL query language of RDF triples, suppose we have a family ontology written in RDF/XML format. Now, I want to query all parents, for example, with at least two children (cardinality on hasChild relation) with SPARQL. My…
frogatto
  • 28,539
  • 11
  • 83
  • 129
2
votes
2 answers

How to determine programmatically MySQL relationship type (1:1, 1:n, n:m) between tables?

I'm trying to query a MySQL server to determine information about a database in order to scaffold some code. I've been quite successful using Java JDBC and INFORMATION_SCHEMA table for this but the problem is that I need to determine if a table…