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
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,854
  • 2
  • 18
  • 43
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
  • 29,999
  • 21
  • 111
  • 199
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
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,049
  • 5
  • 29
  • 45
-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
  • 33
  • 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
  • 1
  • 9
-1
votes
1 answer

Does Cardinality happen one at a time or it is about the whole life of the data?

A laboratory has several chemists who work on one or more projects. While working on these projects a chemist may use different laboratory equipment. The laboratory needs to know the following information…
-1
votes
1 answer

How do I finish this recursive statement?

def search_sequence( seq, item ): """ Search a sequence for the given item. PROVIDE AN IMPLEMENTATION (TASK #2). This function should use **car** and **cdr**. :param seq: the sequence to be searched. :param item: the item to be…
-2
votes
1 answer

In one to many relationship does there exist element from first table that are not connected to element from second table

when we have two tables, suppose A and B,there exists one to many relationship between these two, than can there be element from A that are not connected to any element from B?
-2
votes
2 answers

Find the Cardinality of Natural Join

|X| represents number of tuples in X bold letters represent keys in the relation Consider the relations R(A, B) and S(A, C), and that R has a foreign key on A that references S. |R ✶ S| (where ' * ' represents natural join) is: The options are:…
rdr2
  • 1
  • 2
1 2 3
15
16