DataBase

ERD-Attribute, Cardinality, Multivalued Attribute

Naranjito 2023. 7. 13. 15:21
  • Attribute

A property or characteristic of an entity. Often shown as an oval or circle.

For instance, each one of these entities is going to have what we call attributes, which are various properties or traits.

In this case, under the customer entity, we have a customer id.

 

  • Entities and attributes in the database

Entities in your database will be the rows, and the attributes in your database will be depicted as the columns.

 

  • Relationship between entities

The relationships describe how these entities will interact with each otherThe lines that is sort of interaction or connection in some way.

 

  • Cardinality

Defines the numerical attributes of the relationship between two entities or entity sets. The three main cardinal relationships are one-to-one, one-to-many, and many-many. 

In other words, the cardinality which further defines the relationship in a numerical context, particularly within minimums and maximums.

 

For instance,

 

From Customer -> to Order

- What is the minimum number of orders that a customer could have? A customer could exist, but he or she could have zero orders. So to show that over here, we'll have that zero sign.
- What are the maximum number of orders that a customer could have? A customer can have infinite orders.

 

From Order -> to Customer

- What is the minimum amount of customers that an order may have? A specific order can only have one and only one customer.
- what's the maximum number of customers that an order may have? Only one number of customers to an order.

 

From Order -> to Product

- A certain order can have how many products? For an order to exist it has to have one product. A lot of different products
can be comprised of that order.

 

From Product -> to Order 

- A product can be a part of how many orders? A product could be a part of no orders. But it also could be a product of many orders.

 

  • Multivalued Attribute

It contains more than one value at a time for an entity instance from a set of possible values, which is the opposite of how single-valued attributes function. Curly braces {} can be used to indicate multivalued attributes inside the co-centric elliptical shape that represents these attributes.

 

For instance,

A student can have multiple phone numbers. In this case, the phone number can be classified as a multivalued attribute of the student entity and these multi-valued attributes can be marked inside the co-centric elliptical shape.

Attribute Name Attribute Type
Student_Name Single Value
Roll_No Single Value
Phone_Number Multi-Valued
Email_ID Multi-Valued

reference : https://www.lucidchart.com/pages/er-diagrams

'DataBase' 카테고리의 다른 글

Database Normalization  (0) 2023.07.14
key  (0) 2023.07.14
ERD, Entity, Strong Entity VS Weak Entity  (0) 2023.07.13