当前位置:网站首页>Learn to draw Er graph in an article

Learn to draw Er graph in an article

2022-06-23 05:06:00 InfoQ

What is? er chart ?

E-R Graph is also called entity relation graph , Is an entity that provides , Properties and contact methods , A conceptual model used to describe the real world . In layman's terms , When we understand the needs of the actual problem , There needs to be a way to express this requirement , The conceptual model is used to describe such requirements .

such as : Departments and majors in universities , And students' noumenon , Follow the following picture roughly er chart

null

er The basic elements in the diagram

Let's use the picture above to illustrate :

  • Entity : Things that exist in practical problems and can be identified with each other

Like the one above : departments , major , Male students , Girl friend

  • attribute : A property of an entity , We call them attributes

such as : The above picture can be used by departments : Department number , name , Attribute description of mailbox

A major can use a major code , Professional name Description

Male students can use their student ID , Name Description

  • Entity set : A collection of entities with the same attributes ,(211……13, Ming Di ) It is an entity in the student entity set
  • key : Attributes that uniquely identify entities are called keys , Keys are also attributes of entities , The attribute value as a key must be unique and cannot be empty . For example, student ID. 211……13 It can be called a key
  • 1 Yes 1,1 For more than , Many to many ,3 Kind of

draw er Graph specification

  • Rectangle box : Represents an entity , Write the entity name in the box
  • Diamond frame : It means to contact , Write the contact name in the box
  • Oval box : Represents the property , Write the attribute name in the box
  • attachment : Entities and attributes , Entity and connection , Connection and attribute
    Use straight lines
    Connect ,
  • In the process of connection, the type of connection shall be marked on the line :
  • 1 Yes 1: Contact each direction 1
  • 1 For more than :1 The party who wrote 1, More than one party to write n
  • Many to many : Write in each direction n,m

example

Through the above explanation , Let's do an exercise .

Library management system should be no stranger , A brief analysis of , The discovery database mainly provides the following services :

  • You can query the varieties of existing books in the library at any time 、 Quantity and storage location . All kinds of books can be uniquely identified by the book number .
  • You can check the borrowing and returning of books at any time , Including the borrower's unit 、 full name 、 Library card number 、 Borrowing date and return date .
  • Appointment : Anyone can borrow a variety of books , Any kind of book can be borrowed by more than one person , The library card number is unique .

null
Finally, if you feel useful, please connect three times , Your three companies are the greatest encouragement to the author !!!
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230040479479.html