0% found this document useful (0 votes)
30 views

Data World: Represents A Real World Which Is Changing Continuously - 3 Data Worlds

- The document discusses data models for database systems. It describes three "data worlds" that represent the real world, conceptual world, and computer world. - It explains key concepts of data models including conceptual, logical, and physical data models. The conceptual data model (like entity-relationship model) focuses on relationships between entities without physical storage considerations. The logical data model describes overall logical database structure and relationships between data fields. The physical data model describes how data is stored in the computer. - It provides details on the entity-relationship model, including entities, entity sets, attributes, relationships, relationship sets, keys, and graphical notation in E-R diagrams. Constraints like cardinality, participation, super
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Data World: Represents A Real World Which Is Changing Continuously - 3 Data Worlds

- The document discusses data models for database systems. It describes three "data worlds" that represent the real world, conceptual world, and computer world. - It explains key concepts of data models including conceptual, logical, and physical data models. The conceptual data model (like entity-relationship model) focuses on relationships between entities without physical storage considerations. The logical data model describes overall logical database structure and relationships between data fields. The physical data model describes how data is stored in the computer. - It provides details on the entity-relationship model, including entities, entity sets, attributes, relationships, relationship sets, keys, and graphical notation in E-R diagrams. Constraints like cardinality, participation, super
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 41

Data World

- Database represents a real world which is changing co


- Data model is the procedure for representing a real wo

• 3 Data Worlds

infornation data
modeling modeling
object
entity set record type
properties
attributes field
values
values values

real world(reality) conceptual world(concept) computer world(data)

-1 2. Data Models for Database Systems


Data World (cont'd)
• Database and Real World database
design

information conceptual world


real world
modeling

consistency data data


structuring modeling

stored
database
logical data structure

-2 2. Data Models for Database Systems


Data Model Concepts
• Data model
- conceptual tools for describing data and data relationship
- specify the overall logical structure of database
Data models fall into three different group : conceptual data model,
logical data model and physical data model.

• Conceptual data model (High-level)


- relationship between entity sets, not considering physical storage
device
- human oriented data model
- facilitate database design
- Entity-Relationship (E-R) model
- OO data model
-3 2. Data Models for Database Systems
Data Model Concepts (cont'd)
• Logical data model (Representational, Implementation)
- describing relationship between data field (record-based)
- overall logical structure of a database
- high level description of the implementation

- hierachical model
collection of trees
- network model
collection of record types and links, i.e., graphs
- relational model
collection of tables

-4 2. Data Models for Database Systems


Data Model Concepts (cont'd)
• Physical data model (Low-level)
- describe how data is stored in the computer
- e.g. record format, record orderings, and access paths

consistency data data


structuring modeling

stored
database
physical, low-level model logical, representational model
(logical data structure)

-5 2. Data Models for Database Systems


E-R Model
- by Peter Chen, 1976
- based on a perception of real world which consi
objects called entities and relationships among t
- E-R diagram is graphical database structure in E
is consist of entity set, relationship, attribute and

• Entity
- an object that exists and is distinguishable fro
- ex) Yoon S. A. with social security number 7
- may be abstract, such as a holiday or a conce

-6 2. Data Models for Database Systems


E-R Model (cont'd)
• Entity Set
- a set of entites of the same type
- ex) customer : set of all persons having an ac
account : set of all accounts maintained a
- rectangles, which represent entity sets
- entity sets need not be disjoint
a person entity may be an (bank) employee en
a customer entity, both, or neither
• Attribute
- entity is represented by a set of attributes
- ex) customer entity set's attributes are custom
security-number, street, and customer-cit

-7 2. Data Models for Database Systems


E-R Model (cont'd)
• Domain
- a set of permitted values
- ex) domain of customer--name : set of all text st
of a certa
• Relationship
- an association among several entities
- ex) Harris(customer) 401(account)
• Relationship Set
- a set of relationships of the same type
- {(e1, e2, ...
 , en) | e1 E
1, e2 E2, ... , en En}
- ex) CustAcct denote association between custom
- ternary relationship set CAB : Harris, 401, and R
-8 2. Data Models for Database Systems
E-R Model (cont'd)

• Attribute of Relationship
- relationship set can have attributes
- ex) CustAcct's (Harris, 401) has property {

-9 2. Data Models for Database Systems


Example
교수

교수번호 이름 학과
지도 강의

학생 과목
등록

학번 이름 학년 과목번호 과목이름 학점

- 10 2. Data Models for Database Systems


Constraints on Relationship Set

• Cardinality ratio constraint


number of entities to which another entity can be

- one-to-one : for each entity in either set, there is a


one associated member of the other s
Manages
Emp e1 d1 Dept
e2 d2
e3 d3
e4 d4
. d5
. . .
. .

- 11 2. Data Models for Database Systems


Constarints on Relationship Set (con
- many-to-one : each entity in E1(Courses) is as
most one entity in E2(Teachers
in E2 can be associated any num
taught-by
Courses Teachers

- many-to-many : no restriction
export
Countries Products

- 12 2. Data Models for Database Systems


Constarints on Relationship Set (con
• Participation constraint
the existence of an entity depends on the exis
the relationship to another entity

- existency dependency
this means that if y is deleted, so is

dominant entity, subordinate entity,


strong or regular entity weak entity

- 13 2. Data Models for Database Systems


Constarints on Relationship Set (con

account# Balance transaction# date amount

Account Log Transaction


dominant, strong subordinate, weak

462-21-23 3,000 1 11 Oct 1996 +50


262-45-20 6,000 4 12 Oct 1996 +350
645-44-09 5,000 7 12 Oct 1996 - 150
... ...

- 14 2. Data Models for Database Systems


Keys
it is important to be able to discriminate how ent
relationships

• Superkey
- a set of one or more attribute wich allow us to
uniquely an entity in the entity set
- may have unnecessary attributes to distinct
• Candidate Key
- minimal superkey
• Primary Key
- a candidate key chosen by the DB designer

- 15 2. Data Models for Database Systems


E-R Diagram
graphical database structure in E-R model
- rectangle : (strong) entity set
- double rectangle : weak entity set
- ellipse : attribute
- diamond : relationship set
- line : (1) link attribute to entity set
(2) link entity set to relationship set

 see Slide 2-11

- 16 2. Data Models for Database Systems


Reducing E-R diagrams to Tables
(1) Representation of strong entity sets
D1 X D2 X ..... Dn
see Fig. 2-14, Fig. 2-15 Korth Book
(2) Representation of weak entity sets
{attributes of weak entity set} U {prima
see Fig. 2-16
(3) Representation of relationship sets
{primary key set} U {attribute of relatio
see Fig. 2-17, Fig 2-18

- 17 2. Data Models for Database Systems


Reducing E-R diagrams to Tables (Ex)
account# Balance date transaction# date amount

Account Log Transaction

(1)

(2)

(3)

- 18 2. Data Models for Database Systems


Generalization
There are similarities between the checking-account entity set and
the saving-account entity set in the sense that they have several
attribute in common. This commonality can be expressed by
generalization.

- Creation method : create a high-level entity set from two or more


lower level entity set's common attributes
- Usage : is used to emphasize the similarities among lower level
entity type and to hide their differences
- Inheritance : lower level entity set (saving-account and checking
account) inherit the attributes of higher level entity set (account)

- 19 2. Data Models for Database Systems


Generalization (cont'd)
account
balance
number
• saving-account is an
account account

ISA

saving- account
account checking-
account number
number account

interest- balance
balance overdraft-
rete amount

- 20 2. Data Models for Database Systems


Generalization (cont'd)
• Transforming E-R diagram including generaliza
tabular form

(1) Primary key of high-level entity set pl


account + savings-account, checking-

(2) Only lower level entity sets


savings-account, checking-account (in
attributes)

- 21 2. Data Models for Database Systems


Aggregation
One limitation of the E-R model is that is not po
relationship among relationships
- Aggregation is an abstraction through which re
treated as high-level entities
hospital
1

hospitalization 입원

m
1 n
doctor treatment patients
치료

- 22 2. Data Models for Database Systems


Hierarchical Data Model
• Basic Concepts and Structure
- Hierarchical database consists of a collection of r
are connected to one another records through link
- record : collection of fields (attributes)
link : inary relstionship (parent-child relationship
* restriction : only one-to-many
subject
Hierarchical Definition Tree
(subject database schema)
prerequisite lecture
subject

lecturer student

- 23 2. Data Models for Database Systems


Hierarchical Data Model (cont'd)
subject
• ordered tree
C100 Database 3 • one-to-many
prerequisite
subject lecture (record type)

C99 L1 Tue-Thu 2-204


L2 Mon-Wed 3-403

student
S93002 Lee S. H. 85
lecturer
S93002 Hur S. 92
P94 Kim C. S. Computer S93001 Park E. Y. 90

subject Database Tree


(record occurrence)
- 24 2. Data Models for Database Systems
Hierarchical Data Model (cont'd)
• Characteristics
- parent-child relationship is one-to-many re
- ordered tree (left to right)
- n:m relationship can be represented by two
• Restrictions
- all record occurrences except root record, m
to parent record
* need to connect its parent for record inser
* have to delete all its child record for reco
- one-to-many relationship : to associate with
make another tree (m:n => two 1:n relation

- 25 2. Data Models for Database Systems


Network Data Model
• Basic Concepts and Structure
- Network database consists of a collection of re
are connected to one another records through li
 but, Data Structure Diagram (DSD) which repre
structure of network database, is network form
- extension of hierarchical data model
- CODASYL(Conference on Data Systems Lang
(Data Base Task Group) proposed the network
 many-to many link is not allowed (implementat
- Network Database System :
IDMS (Computer Associates)
TOTAL (Cincom Systems)
IDS II (Honeywell Information Systems)
- 26 2. Data Models for Database Systems
Network Data Model (cont'd)
• Data Structure Diagram (DSD)

customer branch

name street city name assets city

CustAcct BrncAcct

number balance
account

- 27 2. Data Models for Database Systems


Network Data Model (cont'd)
• Set Occurrence (database value)

• 1: n relationship
305 500 • graph
Kim Daesin Pusan 226 336

177 205 Uam 5,000,000 Pusan


Chung Choongmu Seoul
155 62
Namsan 2,000,000 Ulsan
Lee Hanbat Taejon 402 100

408 300

- 28 2. Data Models for Database Systems


Relational Data Model
• Background
- Proposed by E. F. Codd (1970, ACM TODS)
- Non-procedual database language (easy to use)
- Standard database language : SQL
* ISO, ANSI, X/Open
* SQL, SQL89, SQL2, SQL3, ....
- Theoretical background (mathematics-based)
- Relational DBMSs :
Oracle - 2nd largest S/W maker in the world
Informix - UNIX RDBMS special group
Sybase - Client/Server DBMS
Ingres - ?

- 29 2. Data Models for Database Systems


Relational Data Model (cont'd)
• Overview
Relational model = structure + constraints + operation
• Structure
- Domain : set of atomic values
- Relational scheme : set of attribute names
- Relation : any subset of the Cartesian product o
of attributes int relation scheme
Set of Tuples

Employee E# Ename Workfor


City Ename Dname

10 Smith LA Smith Physics


20 James NY James Mathematic
s

- 30 2. Data Models for Database Systems


Relational Data Model (cont'd)
- Terminologies
table : relation
row : tuple
column : attribute
- Arity(degree)
number of attribute in the relation
- Tuple
ordered list of values from domain D1, D2,
mapping from attribute names to values in
ex) (10, Smith, LA)
m(E#) = 10, m(Ename) = Smith, m(Cit

- 31 2. Data Models for Database Systems


Relational Data Model (cont'd)
• Integrity Constraints
- Entity integrity constraint
no primary key can be null
- Referential integrity constraints (foreig
foreign key : set of attributes which
of another relation
(ex) Dept = (Dname, Manager,
foregin key Budg
Employee = (Ename, Bdate, Sala
Every value of the foreign key must
corresponding primary key values of

- 32 2. Data Models for Database Systems


Relational Data Model (cont'd)
• Operation
- Operation to manipulate a relation is needed
- There are two types of operation, Relational Algebra and
Relational Calculus
• Relational Algebra (How)
query is expressed by applying specialized algebraic
operators operators => SQL
• Relational Calculus (What)
query is describes a desired set of tuples by specifying a
predicate the tuples must satisfy => QUEL, QBE

- 33 2. Data Models for Database Systems


Object-Oriented Data Model
• Shortcomings of the Conventional Database Technolog
- Too simple for modeling complex nested entities
- A limited set of atomic data types
- No frequently useful semantic concepts
- Impedance mismatch between programming lan
and database language
- Inappropriate for long-duration transactions nec
interactive, cooperative design environments (C
- Unacceptable for various types of computer-inte
applications

- 34 2. Data Models for Database Systems


Object-Oriented Data Model (cont'd)
• Additional Features of the Next-Generation Database
Systems
- Represent and manipulate complex nested objects
- Store and retrieve arbitary long data
- Define and manipulate arbitary data types
- Represent and manipulate various semantic modeling concepts
- Specify rules and extented constraints to support inferencing
and constraint management
- Manage long-duration cooperative transactions

- 35 2. Data Models for Database Systems


Object-Oriented Data Model (cont'd)
• Object-Oriented Approach
- in Programming language
from SIMULA-67 (K. Nygard, Norway)
Smalltalk, Eiffel, C++, Java
- in Artificial Intelligence
from introduction of FRAME
KEE, ART
- in Database
from semantic data model
E-R, EE-R, SDM, DAPLEX

- 36 2. Data Models for Database Systems


Object-Oriented Data Model (cont'd)
Account object
• Core Modeling Concepts
deposit Balance A#
- Object and Object Identifier
object = data + operation withdraw 5000 100
- Attribute and Methods
attribute : specified property to represent an object
method : an operation of an object ( = code)
- Encapsulation and Message passing
encapsulation : the data of an object can only be accessed via
the methods of the objects
message : a request to perform an operation

- 37 2. Data Models for Database Systems


Object-Oriented Data Model
- Class
class : a template from which objects with
representation and the same behav
- Class Hierarchy and Inheritance
inheritance : a mechanism which allows a
incrementally defined from a

instantiation instantiation

class

object 1
object 2

- 38 2. Data Models for Database Systems


Object-Oriented Data Model
• Object-Oriented Database Concepts
EMP Name Age Salary
Lee is an EMP object
data part Lee 25 500,000

operation part (hire, change Age, change Salary)

Account object

기존 : all 6% Balance A#
pay-interest
변경 : $1000 -> 5%
$1000 -> 6% 5000 100

- 39 2. Data Models for Database Systems


연습문제
1. 현실 세계와 개념 세게의 차이점을 설명하라 .

2. 데이터 모델이란 무엇이며 , 개념적 데이터 모델 , 논리적 데이터


모델 , 물리적 데이터 모델의 차이점을 설명하라 .

3. 주변의 어떤 업무를 선택해서 E-R 모델을 만들어 보라 .

4. 관계형 , 계층형 , 네트워크 데이터 모델을 설명하고 장 , 단점은 ?

5. E-R 모델에서 관계형 모델로 변환하는 방법을 설명하라 .

6. 객체 지향 모델의 개념을 설명하고 , 장점도 설명하라 .

- 40 2. Data Models for Database Systems


별을 찾아라
작가 델마 톰슨이 문단에 나오기 전의 일이다 . 군인이었던 그녀의 남편이
캘리포니아의 모하비 사막으로 파견을 나가게 되어 남편과 가까이 있고자
그 근처로 이사를 갔다 . 그러나 그곳은 폭염과 모래 바람만 불어되는 혹독한
곳이었다 . 하루종일 남편을 기다리던 그녀에게 매일매일이 고역이었다 .
세찬 모래 바람으로 입 안에는 모래알이 돌아 다녔고 음식은 높은 온도에
쉬어 버렸다 .
델마는 바참한 심정으로 고향의 친정 아버지에게 편지를 썼다 . “ 아버지 , 더
이상은 못 견디겠어요 . 차라리 감옥에 있는 것이 더 나을 것 같아요 .” 델마의
참담한 생활에 대해 아버지의 답장은 간단했다 . “ 두 명의 죄수가 감옥 창살로
밖을 보았단다 . 그런데 한 사람은 진흙을 보았고 , 다른 한 사람은 별을
보았단다 .” 델마는 아버지의 편지에 몹시 부끄러워져서 , 별을 찾기로 하였다 .
먼저 원주민의 공에품에 관심을 보이며 친구가 되고자 했다 . 또 사막의 식물에
관심을 가지고 살펴보니 , 그것들은 너무나 매혹적이었고 빨갛게 지는 노을을
바라보며 사막에도 아름다움이 많이 숨겨져 있음을 깨달았다 .
델마는 새로운 세계를 발견한 기쁨으로 책을 냈는데 “무엇이 나를 변화시켰는가 ?
모하비 사막은 변하지 않았다 . 나의 마음자세가 변했다 . 그럼으로써 비참한 경험이
가장 흥미있는 인생으로 변할 수 있음을 깨달았다 . 이후 델마 톰슨은 유명 작가의
길에 들어선다 .

- 41 2. Data Models for Database Systems

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy