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

240 questions
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
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
  • 4,529
  • 5
  • 30
  • 38
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
  • 14,291
  • 12
  • 78
  • 103
3
votes
1 answer

ClickHouse: Does it make sense to use LowCardinality fields on Uint8 used as Boolean?

LowCardinality fields in ClickHouse are an optimization where the values are dictionary-encoded for faster lookups and smaller storage. As per documentation: The efficiency of using LowCarditality data type depends on data diversity. If a…
xmar
  • 1,256
  • 11
  • 31
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,091
  • 2
  • 21
  • 39
3
votes
1 answer

RBAC (Role Based Access Control) ER Diagram

I am trying to design an application with Role Based Access Control. And I have also designed the ER Diagram. So here I try to achieve that a USER will have a single ROLE and based on the particular ROLE it will get permissions for RESOURCES set in…
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,085
  • 13
  • 42
  • 57
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,420
  • 1
  • 16
  • 33
3
votes
1 answer

distinct count is greater than doc_count in elasticsearch aggs

I wrote some aggs query to get total(sum) and unique count. but the result is a little confused. unique value is greater than doc_count. is it possible? I know that cardinality aggs is experimentall and can get approximate count of distinct…
Jihun No
  • 1,039
  • 1
  • 9
  • 23
3
votes
2 answers

Elasticsearch Terms or Cardinality Aggregation - Order by number of distinct values

Friends, I am doing some analysis to find unique pairs from 100s of millions of documents. The mock example is as shown below: doc field1 field2 AAA : BBB AAA : CCC PPP : QQQ PPP : QQQ XXX : YYY XXX : YYY MMM : NNN 90% of the document contains an…
Deepak
  • 214
  • 1
  • 2
  • 9
3
votes
2 answers

Entity Relationships - Can a weak entity take part in a 'one to many' relationship as the 'one'

With the following entity relationship structure I'm struggling to figure out if the relationship between the LOAN and ITEM entities is valid? The weak entity of LOAN uses a partial key of 'loan_dateLeant' and the primary keys from CUSTOMER and ITEM…
user271132
  • 157
  • 1
  • 4
  • 9
3
votes
1 answer

Cypher relationship cardinality

Is there any way to do a cypher query that returns only the outgoing relationship with cardinality of 1, in neo4j 1.9.7? e.g N2 ----> N4 -----> N10 | |-------> N9 | |------> N5 -----> N9 | |------> N6 -----> N9 In a structure like this i…
Ancelot182
  • 119
  • 1
  • 7
3
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…
1 2
3
15 16