database.sarang.net
UserID
Passwd
Database
ㆍDBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
DBMS Columns 578 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 578
Datamodeling and Relational Database Design (3)
작성자
정재익(advance)
작성일
2002-09-29 10:00
조회수
5,594
첨부파일: schema-pic.zip (7,992bytes)

Basic Schema

 

Developing the Basic Schema

 

Once entities and relationships have been identified and defined, the first draft of the entity relationship diagram can be created. This section introduces the ER diagram by demonstrating how to diagram binary relationships. Recursive relationships are also shown.

 

Binary Relationships

 

Figure 1 shows examples of how to diagram one-to-one, one-to-many, and many-to-many relationships.

 

Figure 1: Example of Binary Relationships

 

 

One-To-One

 

Figure 1A shows an example of a one-to-one diagram. Reading the diagram from left to right represents the relationship every employee is assigned a workstation. Because every employee must have a workstation, the symbol for mandatory existence—in this case the crossbar—is placed next to the WORKSTATION entity. Reading from right to left, the diagram shows that not all workstation are assigned to employees. This condition may reflect that some workstations are kept for spares or for loans. Therefore, we use the symbol for optional existence, the circle, next to EMPLOYEE. The cardinality and existence of a relationship must be derived from the "business rules" of the organization. For example, if all workstations owned by an organization were assigned to employees, then the circle would be replaced by a crossbar to indicate mandatory existence. One-to-one relationships are rarely seen in "real-world" data models. Some practioners advise that most one-to-one relationships should be collapsed into a single entity or converted to a generalization hierarchy.

 

 

One-To-Many

 

Figure 1B shows an example of a one-to-many relationship between DEPARTMENT and PROJECT. In this diagram, DEPARTMENT is considered the parent entity while PROJECT is the child. Reading from left to right, the diagram represents departments may be responsible for many projects. The optionality of the relationship reflects the "business rule" that not all departments in the organization will be responsible for managing projects. Reading from right to left, the diagram tells us that every project must be the responsibility of exactly one department.

 

Many-To-Many

 

Figure 1C shows a many-to-many relationship between EMPLOYEE and PROJECT. An employee may be assigned to many projects; each project must have many employee Note that the association between EMPLOYEE and PROJECT is optional because, at a given time, an employee may not be assigned to a project. However, the relationship between PROJECT and EMPLOYEE is mandatory because a project must have at least two employees assigned. Many-To-Many relationships can be used in the initial drafting of the model but eventually must be transformed into two one-to-many relationships. The transformation is required because many-to-many relationships cannot be represented by the relational model. The process for resolving many-to-many relationships is discussed in the next section.

 

Recursive relationships

 

A recursive relationship is an entity is associated with itself. Figure 2 shows an example of the recursive relationship.

 

 

An employee may manage many employees and each employee is managed by one employee.

 

Figure 2: Example of Recursive Relationship

 

[img2]

 

Summary

 

The Entity-Relationship diagram provides a pictorial representation of the major data objects, the entities, and the relationships between them. Once the basic diagram is completed, the next step is Refining The Entity-Relationship Diagram .

[Top]
No.
제목
작성자
작성일
조회
581Datamodeling and Relational Database Design (6)
정재익
2002-09-29
5393
580Datamodeling and Relational Database Design (5)
정재익
2002-09-29
4546
579Datamodeling and Relational Database Design (4)
정재익
2002-09-29
4722
578Datamodeling and Relational Database Design (3)
정재익
2002-09-29
5594
577Datamodeling and Relational Database Design (2)
정재익
2002-09-29
4606
576Datamodeling and Relational Database Design (1)
정재익
2002-09-29
5694
570정보처리기술의 페러다임 - Data WareHousing 과 OLAP (5)
정재익
2002-09-22
5729
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다