1 Assoc.Prof.Dr.B.G.Çetiner 2000 Data Modeling and Database Design Using ERwin PRACTICAL DATA MODELING and DATABASE DESIGN USING ERWIN • ERWIN and Its Main Features • Data Modeling Using ERWIN • Before Database Design • Transforming Data Model To Database Design • Reverse Engineering • ERWIN Reports • Samples Assoc.Prof.Dr.B.G.Çetiner 2000 What is ERWIN? Assoc.Prof.Dr.B.G.Çetiner 2000 ERWIN and Its Main Features Erwin*; A Data Modeling and Database Design Application CASE Tool working on Windows Assoc.Prof.Dr.B.G.Çetiner 2000 * CopyRighted by Logic Works and Platinum Inc. ERWIN and Its Main Features Forward Engineering: Transforming Data Model into Database Reverse Engineering: Obtaining Design Info and Data Model From a Relational Database Assoc.Prof.Dr.B.G.Çetiner 2000 Relational Data Model Relational Database Forward Engineering Reverse Engineering Main Features ERWIN and Its Main Features Main Features: Supported DBMSs Assoc.Prof.Dr.B.G.Çetiner 2000 ERWIN and Its Main Features
15
Embed
Data Modeling and Database Design Using ERwinweb.itu.edu.tr/~cetinerg/notes/ie352p6.pdf · and Database Design Using ERwin PRACTICAL DATA MODELING and DATABASE DESIGN USING ERWIN
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Assoc.Prof.Dr.B.G.Çetiner 2000
Data Modeling and Database
DesignUsing ERwin
PRACTICAL DATA MODELING and DATABASE
DESIGN USING ERWIN
• ERWIN and Its Main Features• Data Modeling Using ERWIN• Before Database Design• Transforming Data Model To Database Design• Reverse Engineering• ERWIN Reports• Samples
Assoc.Prof.Dr.B.G.Çetiner 2000
What is ERWIN?
Assoc.Prof.Dr.B.G.Çetiner 2000
ERWIN and Its Main Features
Erwin*; A Data Modeling and Database Design Application CASE Tool working on Windows
Assoc.Prof.Dr.B.G.Çetiner 2000
* CopyRighted by Logic Works and Platinum Inc.
ERWIN and Its Main Features
Forward Engineering: Transforming Data Model into DatabaseReverse Engineering: Obtaining Design Info and Data Model From a Relational
Database
Assoc.Prof.Dr.B.G.Çetiner 2000
RelationalData Model
RelationalDatabase
ForwardEngineering
ReverseEngineering
Main Features
ERWIN and Its Main Features
Main Features: Supported DBMSs
Assoc.Prof.Dr.B.G.Çetiner 2000
ERWIN and Its Main Features
2
Main Features: ORACLE Designer Data Modeling Tool
Assoc.Prof.Dr.B.G.Çetiner 2000
ORACLE Designer2000 Compatible
ERWIN and Its Main Features
Main Features: Importing Entities from BPwin
Assoc.Prof.Dr.B.G.Çetiner 2000
BPWin is an activity (process) modeling, and data flow diagramming tool
Representing ORACLE Designer Notations under ERwin
3. One-to-one Relationships (Optional)
The entity covering the other entity is defined as child entity in one-to-one relationship.
Assoc.Prof.Dr.B.G.Çetiner 2000
ENGINECARinstalled
in
containing
ParentEntityChild
Entity
Non-identifying Relationship
ERWin
ORACLE
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
4. One-to-one Relationships (Mandatory)
The entity covering the other entity is defined as child entity in one-to-one relationship.
7
Assoc.Prof.Dr.B.G.Çetiner 2000
DEPARTMENTEMPLOYEEstaffing
assigned to
ORACLE
Note: First, you have to resolve many-to-many relationships
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
5. Many-to-many Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
1. Choose many-to-many relationship in Logical Level
2. Click on both entities
3. If you have chosen auto-transform, then an intersection entity will be added automatically.
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
5. Many-to-many Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
5. Many-to-many Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
Intersection Entity Added Automatically
It becomes identifiyingrelationship
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
5. Many-to-many Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
ORACLE Designer
opened in
opening
ACCOUNT#* Account No* Type
BANK#* Bank ID
* Name
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
6. Obtaining Uniqueness via Relationships
ERwin
Represented as identifying relationship
Assoc.Prof.Dr.B.G.Çetiner 2000
ORACLE Designer
EMPLOYEE#* employee ID* name* surnameo job
manager for
managed by
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
Modeled as Non-identifying Relationship as in
one-to-many relationship
ERwin
8
Assoc.Prof.Dr.B.G.Çetiner 2000
1. First, identify the entity and its unique identifier
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
1. First, identify the entity and its unique identifier2. Choose non-identifying relationship from toolbox
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
1. First, identify the entity and its unique identifier2. Choose non-identifying relationhip from toolbox3. Click twice on the same entity (EMPLOYEE)
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
1. First, identify the entity and its unique identifier2. Choose non-identifying relationhip from toolbox3. Click twice on the same entity (EMPLOYEE)4. EMPLOYEE ID has not come as Foreign Key
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
1. First, identify the entity and its unique identifier2. Choose non-identifying relationhip from toolbox3. Click twice on the same entity (EMPLOYEE)4. EMPLOYEE ID has not come yet as Foreign Key5. Click twice on the relationship to identify rolename
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
Assoc.Prof.Dr.B.G.Çetiner 2000
MANAGER ID comes as Foreign key.
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
7. Recursive Relationships
9
Assoc.Prof.Dr.B.G.Çetiner 2000
8. Exclusive Relationships
Transferred to ERwin for each pair of relationships
assigned as
an entityunder
EMPLOYEE# * employee id
* name* lastname o job
WORKERo hourly rateo overtime rate
STAFFo title
assigned as
an entity
under
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
Assoc.Prof.Dr.B.G.Çetiner 2000
8. Exclusive Relationships
Transferred to ERwin for each pair of relationships
assigned as
an entityunder
EMPLOYEE# * employee id
* name* lastname o job
WORKERo hourly rateo overtime rate
STAFFo title
assigned as
an entity
under
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
Assoc.Prof.Dr.B.G.Çetiner 2000
8. Exclusive Relationships
Transferred to ERwin for each pair of relationships
assigned as
an entityunder
EMPLOYEE# * employee id
* name* lastname o job
WORKERo hourly rateo overtime rate
STAFFo title
assigned as
an entity
under
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
Assoc.Prof.Dr.B.G.Çetiner 2000
9. Supertypes and Subtypes
Modeled as Identifying Relationship
STAFF* title
WORKER* hourly rate* overtime rate
EMPLOYEE# * employee id
* name* surname
DEPARTMENT UNION
deploying
assigned to
member for
made up of
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
One-to-m
any relationship
between W
OR
KER
and UNIO
N
One
-to-m
any
rela
tions
hip
betw
een
EMPL
OY
EE
and
DEP
ARTM
ENT
Assoc.Prof.Dr.B.G.Çetiner 2000
9. Supertypes and Subtypes
STAFF* title
WORKER* hourly rate* overtime rate
EMPLOYEE# * employee id
* name* surname
Data Modeling Using ERWIN
Representing ORACLE Designer Notations under ERwin
Modeled as Identifying Relationship Assoc.Prof.Dr.B.G.Çetiner 2000
Choosing Target Database Management System
Database/Choose Database for selecting target database managementsystem
NOTE: You have to beunder
Transforming Data Model To Database Design
level
10
Assoc.Prof.Dr.B.G.Çetiner 2000
Supported Database Management Systems1. IBM DB22. IBM AS/4003. ORACLE4. MS SQL Server5. InterBase6. SYBASE7. PROGRESS8. INFORMIX9. Ingres10. Red Brick11. SQLBase12. Rdb13. WATCOM/SQL Anywhere14. Teradata15. Clipper16. FoxPro17. dBase18. Access19. Paradox
SQL
Dat
aase
Man
agem
ent S
yste
ms
Des
ktop
DB
MS
Transforming Data Model To Database Design
Choosing Target Database Management System
You can also access to the DBMSsnot listed here via ODBC/Generic Assoc.Prof.Dr.B.G.Çetiner 2000
Making Connection Settings for Target Database Management System
ODBC Settings For connecting to DBMS
Before Transforming Data Model
You can directly invoke ODBC Administrator from Run Dialog: odbcad32
Assoc.Prof.Dr.B.G.Çetiner 2000
Before Transforming Data Model
For adding new connection
Making Connection Settings for Target Database Management System
Assoc.Prof.Dr.B.G.Çetiner 2000
Example; Settings for connecting to Oracle DBMS through ODBC
For connecting to Oracle DBMS
Transforming Data Model To Database Design
Assoc.Prof.Dr.B.G.Çetiner 2000
Connection name to connect (You can reach under ERWinODBC Connection)Service name
Username
Transforming Data Model To Database Design
Example; Settings for connecting to Oracle DBMS through ODBC
Assoc.Prof.Dr.B.G.Çetiner 2000
Connection Name for SQL Server
Optional Description
AI1 is the server name
Transforming Data Model To Database Design
Example; MS SQL Server Connections
ODBC Settings for each DBMS is different (like printer drivers)
11
Assoc.Prof.Dr.B.G.Çetiner 2000
Forward Engineering
Applying the principles of Systems Development Life Cycle (SDLC)(Going from the top to bottom in Waterfall model)
Producing the Relational Database Objects via the use of Data Models
Transforming Data Model To Database Design
Assoc.Prof.Dr.B.G.Çetiner 2000
Choose Forward Engineer Under Tools
Transforming Data Model To Database Design
Forward Engineering
Assoc.Prof.Dr.B.G.Çetiner 2000
Forward Engineering: Settings
Opt
ions
Transforming Data Model To Database Design
Filtering model Preview Print Write SQL Script Generateobjects SQL Script SQL Script to a File Database
ObjectsAssoc.Prof.Dr.B.G.Çetiner 2000
Forward Engineering
Press1.
2. Give required security information and press Connect button.
Transforming Data Model To Database Design
ODBC Connection Native Connection
Assoc.Prof.Dr.B.G.Çetiner 2000
Produce the database objects from data model directlyTransforming Data Model To Database Design
Assoc.Prof.Dr.B.G.Çetiner 2000
Press button1.
2.
SQL Script filename
Transforming Data Model To Database Design
Produce the database objects from data model using SQL Script
12
Assoc.Prof.Dr.B.G.Çetiner 2000
Transforming Data Model To Database Design
Produce the database objects from data model using SQL Script
Assoc.Prof.Dr.B.G.Çetiner 2000
Just run the SQL ScriptFile using tools under the DBMSs
ExamplesOracle SQL*Plus for Oracle DBMSQuery Analyzer for MS SQL Server
Transforming Data Model To Database Design
Name of Script File
Produce the database objects from data model using SQL Script
Oracle SQL*Plus for Oracle DBMS
Assoc.Prof.Dr.B.G.Çetiner 2000
Just run the SQL ScriptFile using tools under the DBMSs
ExamplesOracle SQL*Plus for Oracle DBMSQuery Analyzer for MS SQL Server
Transforming Data Model To Database Design
Produce the database objects from data model using SQL Script
Query Analyzer for MS SQL Server
Assoc.Prof.Dr.B.G.Çetiner 2000
Transforming Data Model To Database DesignProduce the database objects from data model using SQL Script
Interactive SQL for Interbase DBMS
Assoc.Prof.Dr.B.G.Çetiner 2000
Reverse Engineering
Reverse Engineering
Applying the principles of Systems Development Life Cycle (SDLC) in reverse order
(Going from the bottom to top in Waterfall model)
Inferring the Data Model from Database Objects
Assoc.Prof.Dr.B.G.Çetiner 2000
Select Reverse Engineer under Tools Menu
Reverse Engineering
Reverse Engineering
13
Assoc.Prof.Dr.B.G.Çetiner 2000
Reverse Engineering: Settings
As in forward engineering, connections are achieved via the native or ODBC type of connection
Reverse Engineering
Assoc.Prof.Dr.B.G.Çetiner 2000
Choose the Target DBMS to reverse engineer the database
Reverse EngineeringReverse Engineering
Assoc.Prof.Dr.B.G.Çetiner 2000
Data model can be obtained from;
1. DBMS by direct connection
2. SQL Script Files
Reverse EngineeringReverse Engineering
Assoc.Prof.Dr.B.G.Çetiner 2000
Reverse EngineeringReverse Engineering
If the database is not relational then you can infere primary keys and relationships from Indexes and thecolumn names in tables
Assoc.Prof.Dr.B.G.Çetiner 2000
Reengineering
Other Functions
Reengineering: Compares the data model and physical database. You can update the data model via the databaseor database via the data model
Assoc.Prof.Dr.B.G.Çetiner 2000
Report Generation
For report generation
ERwin Reports
14
Assoc.Prof.Dr.B.G.Çetiner 2000
Reports
ERwin Reports
Assoc.Prof.Dr.B.G.Çetiner 2000
Reports: Example; Table/Physical Properties
ERwin Reports
Assoc.Prof.Dr.B.G.Çetiner 2000
Reports: Reports are generated Using Report Templates and Output type (such as HTML)
ERwin Reports
Assoc.Prof.Dr.B.G.Çetiner 2000
Reports: Reports are generated Using Report Templates and Output type (such as HTML)