Title: Introduction to bioinformatics
1??????? ????? ?????? ???? - 20436
- ??????????? ??????
- ???? ???? ???????
- ????? ??? 2003?
-
2Information SystemsDevelopment in Action
- The problem decomposition process
3Steps in the Systems Development Process
- System identification, selection, and planning
- System analysis
- System design
- System implementation
- System maintenance
4Entity-Relationship Diagram
5Three views of the system data
Structure
Function
Entity Relationship diagram (ERD)
Data Flow diagrams (DFD)
System data
Entity Life History (ELH)
Sequence
6Conceptual Data Modeling
- Representation of organizational data
- Purpose is to show rules about the meaning and
interrelationships among data - Entity-Relationship (E-R) diagrams are commonly
used to show how data are organized - Main goal of conceptual data modeling is to
create accurate E-R diagrams - Methods such as interviewing, questionnaires and
JAD are used to collect information - Consistency must be maintained between process
flow, decision logic and data modeling
descriptions
10.6
7Process of Conceptual Data Modeling
- First step is to develop a data model for the
system being replaced - Next, a new conceptual data model is built that
includes all the requirements of the new system - In the design stage, the conceptual data model is
translated into a physical design - Project repository links all design and data
modeling steps performed during SDLC
10.7
8Figure 10-3Sample conceptual data model diagram
10.8
9Gathering Information for Conceptual Data Modeling
- Two perspectives
- Top-down
- Data model is derived from an intimate
understanding of the business - Bottom-up
- Data model is derived by reviewing specifications
and business documents
10.9
10Introduction to Entity-Relationship (E-R) Modeling
- Notation uses three main constructs
- Data entities
- Relationships
- Attributes
- Entity-Relationship (E-R) Diagram
- A detailed, logical representation of the
entities, associations and data elements for an
organization or business
10.10
11Entity-Relationship (E-R) ModelingKey Terms
- Entity
- A person, place, object, event or concept in the
user environment about which the organization
wishes to maintain data - Represented by a rectangle in E-R diagrams
- Entity Type
- A collection of entities that share common
properties or characteristics - Attribute
- A named property or characteristic of an entity
that is of interest to an organization
10.11
12Elements of an ERD
- Relationships
- Association between entities
- Labeled with a verb
- Specialization
- Aggregation
- Cardinality
- Associative object type indicators
13ERD Symbols
Entity Name
Rectangle represents entities
RelationshipName
Diamond represents relationships
Line links entities and relationships
14ERD Examples
Specialization
Named Relationship
15ERD Examples
Aggregation Hierarchy Cardinality
Car
Engine
Chassis
3
2
Wheel
Axle
16ERD Cardinality Notation
1
Exactly one
01
Zero or one
1
Mandatory many
0
Optional many
17Entity
- Something of importance to the a user that needs
to be represented in a database. - In an entity-relationship diagram, entities are
restricted to things that can be represented by a
single table.
18Entity Class
- A set of entities of the same type, for example,
EMPLOYEE and DEPARTMENT
19Entity Instance
- A particular occurrence of an entity, for
example, Employee 100, and the Accounting
Department
20Attributes
- Column of a relation
- called
- field
- column
- data-item
- A property in an ERD
- Represented as an oval
21ERD Attributes
LNAME
FNAME
PADDRESS
STUDENT
SSN
GENDER
ADDRESS
22ERD EXAMPLE
23Modeling the Business
Activities
What It Does
What It Needs to Know
Data
24Data Model
25Data Model Components
- Subject areas
- Entity types
- Relationships
- Attributes
26Subject Areas
Products
Personnel
Customers
A natural area of interest of an enterprise
centered on a major resource or activity of the
enterprise and consisting of a set of data
objects
27Entity Types
Shipment
Employee
Product
Types of things the business needs in order to
operate
28Entity Occurrence or Instance or sometimes
just Entity
Gone with the Wind Casablanca Are Entity
Occurrences or Instances of
FILM
29Relationship
A reason of relevance to the enterprise for
associating occurrences of one or more entity
types.
TAPE
Member
TAPE
MEMBER
RENTS
30Relationship Pairing
Specific entity occurrences participate in an
occurrence of the relationship.
Bob Allen
Casablanca
Gone with the Wind
Ann Smith
of
MEMBER
TAPE
RENTS
31Two Relationship Memberships
One way
places
STORE
ORDER
is placed by
32Reading ERDs
- Entity type names should always be singular. Ex.
Employee, Member - Read starting with Each. Ex. Each store places
one or more orders. Each order is placed by one
and only one store.
33Cardinality
The number of pairings in which an entity
occurrence may participate
PURCHASE ORDER(S)
Only1?
The Video Store
Each
PLACES
1ormore?
STORE
34Cardinality of Relationships
OFFERS
FILM
DISTRIBUTOR
IS OFFERED BY
IS RENTED AS
STORE TAPE COPY
RENTAL ITEM
IS THE RENTAL OF
INCLUDES
RENTAL ITEM
RENTAL
IS INCLUDED ON
35Mandatory Relationship Memberships
Business rule 1. Each RENTAL always CONTAINS
one or more RENTAL ITEM 2. Each RENTAL ITEM
always IS CONTAINED IN one RENTAL
CONTAINS
RENTAL ITEM
RENTAL
IS CONTAINED IN
36Optional Relationship Membership
Business rule 1. Each STORE sometimes PLACES
one or more ORDER 2. Each ORDER always IS
PLACED BY one STORE
PLACES
ORDER
STORE
IS PLACED BY
37Attributes
Facts the business needs to keep about
EMPLOYEE
EMPLOYEE
NameNumberStreet AddressCityStatePostal
CodePhone Number
The Entity Type
The Person
38Attribute Value
For entity type
STORE
Attribute Value Number 56 200 30 Manag
er Name Pat Jones Jasmine Schwartz Chris
Corrigan
An occurrence of an attribute is its value
39Attribute Optionality
Attribute
Status Must always have a value
Mandatory Phone Number May not always have a
value Optional
40Attribute Detail - Domains
Text or
Alphanumeric - Character and Number Used
for fields not used in calculations. Number or
Numeric - Integer or decimal Use integer if
no decimals are needed. Define larger than
you think you need. Date - YYYYMMDD
8 (Full year and month and day) Best
if defined as 3 fields. Time - HHMMSS
6 Memo - Highly variable-length text
fields Avoid if possible.
41Entity Type Identifiers
Passport
Distinguishing between entities of an entity type
is accomplished by selecting identifiers.
42An Attribute as an Identifier
Entity Type CUSTOMER
Attributes
What is a Primary Key?
STATUS NAME STREET ADDRESS CITY STATE POSTAL
CODE NUMBER MAILING AUTHORIZATION CODE
Single Identifier
NUMBER
43Relationship Membership as part of an Identifier
(requires that the entity be dependent)
Entity Type ORDER ITEMs identifier
Attributes
Relationships
PK-ORDER NUMBER PK-ITEM NUMBER SALE PRICE QUANTITY
IS INCLUDED ON
ORDER ITEM
ORDER
INCLUDES
Note this line
PK-ORDER NUMBER
Identifier is a combination of
ITEM NUMBER and the fact that
Each ORDER ITEM IS INCLUDED ON one ORDER
To indicate Order Number as PK, click Primary
UID box on the relationship line in Designer. Do
not add an attribute and make it a PK. Line on
relationship indicates PK.
44Relationship Memberships as an Identifier
(intersection or associative entity)
Entity Type STORE MEMBERSHIP
CLUB MEMBERSHIP
STORE
ISSUES
POSSESSES
IS ISSUED BY
STORE MEMBERSHIP
BELONGS TO
Combination of Each STORE MEMBERSHIP BELONGS
TO one CLUB MEMBERSHIP Each STORE MEMBERSHIP
IS ISSUED BY one STORE
45Relationships (Foreign Keys) in Child, Dependent
or Weak entity types
- When a relationship exists between a strong
(independent) (parent) (one-side) entity type and
a weak (dependent) (child) (many-side) entity
type, it is called a foreign key. - The identifier attribute in the parent entity
type is automatically copied to and becomes an
attribute in the child entity type by
Designer/2000. Do not put the attribute in the
child entity type. - Foreign keys allow tables to be joined (records
to be matched) in a relational database.
46Entity Type Normalization
The process of ensuring an attribute describes
only the entity type in which it is placed and
there are no repeating groups of fields.
Before Normalizing
COURSE
Name . . . Instructor Name
Also describes the instructor
After Normalizing
INSTRUCTOR
COURSE
Name
Name
47Practice Exercise - ERD
- Draw the ERD for problem 5 on p. 341
48ERD Examples
Ternary Relationships
49ERD Examples
Associative Object Type Indicators
Purchase
Item
Customer
Purchase is both object type AND relationship
50Exercise Time!
51ERD Exercise
- Problem statement
- Model a travel agency. The TA can sell rooms,
apartments and houses to customers or resellers.
The TA gets reservation (booking) options or
fixed booking contingents from hotels, pensions
or private persons. Contingents are bookings that
are reserved exclusively for the TA while options
can only be sold if there are vacancies. This
requires confirmation by the client prior to
reservation. Clients are informed about current
offers by a schedule.
52ERD Exercise
- Bookings can be made in the TA office or by phone
or mail. Private persons have to pay a certain
amount upfront and have to pay the remaining
amount 14 days before departure, resellers get an
invoice for the entire amount. Contingents are
paid immediately, regardless if they could be
re-sold or not. For bookings based on options the
TA pays the supplier the amount the client paid
less a commission. - Consider modeling the relations to customers and
suppliers separately, i.e. using two diagrams.
If you think anything is missing, make any
(sensible) assumption that you need. There is no
perfect solution!
53Private Person
Pension
Provider
owns
1
Object
Hotel
1
1
Calendar
Accommodation
1
Reser- vation
Payment
Apartment
Room
Option
Contingent
54Customer
Private Person
Reseller
Booking
Calendar
Accomo dation
Price
55Cardinality
- Maximum Cardinality In a binary relationship,
the maximum number of elements allowed on each
side of the relationship. - 11, 1N, NM
- Minimum Cardinality
- optional-optional
- optional-mandatory
- mandatory-optional
- mandatory-mandatory
56ERD with Cardinality
1 M