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
4
votes
1 answer

Elasticsearch cardinality sorted wrong

When I make a request like this curl -XGET "http://localhost:9200/log/travels/_search?pretty" -d ' { "aggs":{ "travelers":{ "terms":{ …
Patrícia Villela
  • 808
  • 4
  • 14
  • 38
4
votes
1 answer

Elasticsearch Cardinality Aggregation giving completely wrong results

I am saving each page view of a website in an ES index, where each page is recognized by an entity_id. I need to get the total count of unique page views since a given point in time. I have the following mapping: { "my_index": { …
pmishev
  • 896
  • 9
  • 22
4
votes
1 answer

owl:someValuesFrom vs. owl:minCardinalilty

Usually when we say "all of my children are female" we intend to imply "and there's at least one of them". The famed pizza tutorial (V1.3) addresses this on page 100 saying that it's usually an error to have a universal restriction…
ericP
  • 1,675
  • 19
  • 21
4
votes
1 answer

Oracle selectivity / cardinality

According to this: Selectivity is the value between 0 and 1, and it is the fraction of rows returned after applying a filter on the table. For example if a table has 10,000 rows and the query returns 2601 rows, the selectivity would be…
Roger26
  • 57
  • 1
  • 6
4
votes
2 answers

Identifying vs Non-Identifying Relationships (Again!!!)

So, I've read a whole lot of answers here on stackoverflow, but I'm still confused about the whole concept thereof. Specifically, I've gone over this article (including all the ones it references), but can't seem to find a solid grasp on the concept…
4
votes
5 answers

Change cardinality of item in C# dictionary

I've got a dictionary, something like Dictionary fooDict I step through everything in the dictionary, e.g. foreach (Foo foo in fooDict.Keys) MessageBox.show(fooDict[foo]); It does that in the order the foos were added to the…
Asmor
  • 5,043
  • 6
  • 32
  • 42
4
votes
5 answers

What is the purpose of data modeling cardinality?

I understand what cardinality is, so please don't explain that ;-) I would like to know, what the purpose of doing cardinality is in data modeling, and why i should care. Example: In an ER model you make relations and ad the cardinality to the…
user977150
3
votes
2 answers

Using m..m in multiplicity in UML ER diagram?

According to different resources in UML notation multiplicities have different forms. Below are some of the forms which can be used in a use-case diagram. 1..1 0..* 1..* m..m m..n In T. Connelly and C. Begg's database systems book, they have…
ChathurawinD
  • 756
  • 1
  • 13
  • 35
3
votes
1 answer

Patterns and Practices for Enforcing Object Association Cardinality

I've been thinking about object-oriented principals / practices / paradigms such as SOLID, Law of Demeter, and DDD a lot lately and a theme that continues to surface is enforcing object cardinality. Object association cardinality is derived from…
3
votes
1 answer

How to Define a One-Side-Optional One-to-One Relationship in SQL Server and LINQ-to-SQL?

I am trying to create a one-to-one relationship that is optional on one side between a User table and a UserInfo table. The specifications are that a UserInfo must have exactly one User, while a User can have one or zero UserInfos. Also we require…
Carl G
  • 17,394
  • 14
  • 91
  • 115
3
votes
2 answers

How do i arrange Single cardinality for Vertex properties imported via CSV into AWS Neptune?

Neptune documentation says they support "Set" property cardinality only on property data imported via CSV, which means there is no way that a newly arrived property value could overwrite the old property value on the same vertex, on the same…
3
votes
2 answers

MS Visio 2007: How do I get the cardinality to appear on both ends of a relationship?

In Visio 2007, I can only seem to set the cardinality of the Parent-to-child relationship, but I want to set the Child-to-Parent as well. Is there a reason Visio won't let me do this? Do I need to create a separate relationship to achieve this? I'm…
Lifes
  • 1,226
  • 2
  • 25
  • 45
3
votes
3 answers

Mapping a ternary relationship to the relational model (Employes, Customer, Project)

I would like to convert this segment of an ER-Diagram to a relational model. We have a ternary relationship and what it says is the following: 1 Customer gives 1 Project to -> multiple Developers 1 Customer assigns 1 Developer with ->…
3
votes
1 answer

cardinality of the type

What does it mean, and also what is the cardinality of the next types for example: unit->int bool->(int->bool)
rookie
  • 7,723
  • 15
  • 49
  • 59
3
votes
1 answer

Mysql index 'and' chooses index that was created first always?

https://dev.mysql.com/doc/internals/en/optimizer-and-relations.html The article says that if both the conditions are indexed and have equal join types, it uses the index that was created first. In cases, where one index has higher cardinality,…
Kshitij Banerjee
  • 1,678
  • 1
  • 19
  • 35
1 2
3
18 19