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
0
votes
2 answers

ERD diagram Confusion

I am having a massive confusion as Im trying to develop an ERD Diagram and am confused by this statement. I am trying to relate two entities. they are "order" and "products". So im confused about the cardinality of these two. will it be 1 order will…
Sanjok Gurung
  • 948
  • 4
  • 17
  • 33
0
votes
1 answer

Modelling with Code First-style in Entity Framework?

I'm pretty new to Entity Framework and want to create a (personal) quick reference manual. The goal with it is to give myself some really short code first examples with different cardinalities: one-to-one one-to-many many-to-many Here is what I…
Hauns TM
  • 1,909
  • 2
  • 22
  • 38
0
votes
1 answer

Mysql compound index cardinality is not same on all fields

I have created an compound index on mysql, here is the command that i use: create index deliver_aid_sid_rcnt_idx on DELIVER_SM(AID,STATUSID,RETRY_CNT) USING BTREE; The weird is that i got different cardinality value for each field. is that normal? i…
Antonios
  • 190
  • 8
0
votes
1 answer

Cardinality and Relationship among tables

There is a table named Department, which shows the various departments of a University. And there is a table named Branch, which shows various branches (such as electrical, computer science, mechanical, automobile, law, literature…
0
votes
1 answer

EF5, Inherited FK and cardinality

I have this class structure: public class Activity { [Key] public long ActivityId { get; set; } public string ActivityName { get; set; } public virtual HashSet ActivityLogMessages { get; set; } public…
codeputer
  • 1,987
  • 3
  • 19
  • 45
0
votes
0 answers

How to infer relationships and cardinality from a database when generating code from the tables?

I'm working on generating code (models) from my database. I'm not sure how to, if possible, setup my database to create a relationship including cardinality. Is this something that can be done, or am I stuck with simply generating models that match…
myermian
  • 31,823
  • 24
  • 123
  • 215
0
votes
2 answers

Cardinality between entities

I'm learning for a test at school from database systems, and I'havent found similar example on the Internet and I'm not sure. What is the cardinality of following relationship ? I would say 1:1. Some of my friends say that 1:M. Am I right? I've…
0
votes
3 answers

How to ask a business user for cardinality information?

When collecting requirements from business users, I run into a point where I need to understand the cardinality between two concepts in the business user's domain. This is usually something I want to know early in the process, since it affects…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
0
votes
1 answer

How to determine cardinality of foreign key using mysql

I am stuck in a problem where i have to find cardinality of a relationship between tables using mysql. Following this post MySQL: How to determine foreign key relationships programmatically? I have found all tables related to my table and the…
Code Prank
  • 4,209
  • 5
  • 31
  • 47
-1
votes
1 answer

What is the cardinality of the 'writes' relationship type?

What is the cardinality of the writes relationship type? a) One-to-many b) Many-to-many c) One-to-one d) None of the other options This question confuses me a lot. This is all the context that is given in the question. I think it can be One-to-many,…
-1
votes
1 answer

PostgreSQL: implement minimum cardinality database

I have an entity-relationship diagram like this So in PostgreSQL I've created three tables like these: create table Artist( id id primary key ) create table Musical_Event( id id primary key ) create table Play_In( artist id, …
namerand
  • 43
  • 3
-1
votes
1 answer

Difference between "One and only one" and "Zero or one" (in MySQL Workbench)

I have tables Employees and Project. Project table have ProjectCreator and ProjectManager fields, which both references Employees.EmployeeID. I added the foreign keys exactly the same in MySQL Workbench, however, they show up differently in the…
James T
  • 99
  • 6
-1
votes
2 answers

Entity or relationship

I am drawing an ER diagram. Movies (title, year, and rating) are shown in theaters (name and city). A movie can be shown in many theaters and a theater can show many movies. "Show" should hold theater_name and title of the movie. Should "show" be…
user11127399
-1
votes
1 answer

mysql cardinality of column index is larger than unique values in that column

I'm using MySQL 5.6. There is a MYISAM table with 1 million rows. The 'county' column in this table has a BTREE index on it, and the column only has 61 possible values. When I run 'show index in TABLE' on this table, it reports that the cardinality…
-1
votes
1 answer

Relational Algebra and Cardinality?

I'm very confused when it comes to the topic of cardinality in Relational Algebra. I understand that cardinality essentially refers to the uniqueness of a table or data set. So I'll walk through a problem I attempted to solve and maybe someone can…
SaucedCaveman
  • 41
  • 2
  • 9
1 2 3
18
19