数据库系统概论:ER Diagram

Entity

image-20211229105639114
  • Rectangles represent entity sets.
  • Attributes listed inside entity rectangle
  • Underline indicates primary key attributes

Relationship

image-20211229105757177 image-20211229105939329

Relationship Sets with Attributes

image-20211229105832140

One-to-One

image-20211229110143082

One-to-Many / Many-to-One

有箭头的那边是 One

image-20211229110221075

Many-to-Many

两边都没有箭头

image-20211229110341835

Total participation

每个学生必须有一个老师,有要求的那边是双线

image-20211229110420901

Others

image-20211229110509423

每个老师可以没有学生,或者可以有无限个学生

每个学生只能有一个老师

1
2
3
4
5
Novel(ID, name, words, type, publisherID, writerID), foreign key: publisherID (reference publisher(ID)), writerID (reference writer(ID))
Writer(ID, name, nationality, birthday)
Publisher(ID, name, asset, phone)
Bookstore(ID, name, location, phone)
Sold(novel_ID, bookstore_ID, price), foreign key: novel_ID(reference novel(ID)), bookstore_ID(reference bookstore(ID))