topic 9. stages of database design. er diagrams
TRANSCRIPT
Topic 9. Stages of database design. ER diagramsMODULE 2. DATABASE DESIGN
HNEU, Department of Information Systems, Course Database, V. V. Fedko
Contents
1. The stages of database design.
2. The main notation for representation ER diagrams.
3. ER modeling of the subject area using CASE tools.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 2
Test questions
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 3
1. Ответы на какие вопросы должен получить разработчик базы данных во время анализа предметной области?
2. Из каких фаз состоит процесс проектирования баз данных? Чем они отличатся друг от друга?
3. Опишите назначение ERWin.
ru:
1. Answers to what questions should a database developer get when analysing a subject area?
2. What phases does the database design process consist of? How do they differ from each other?
3. Describe the purpose of ERWin.
en:
1. The stages of database design
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 4
1.1. Database Design MethodologyDatabase design is the process of creating a database schema and determining the necessary integrity constraints.
Main goals:
▪ Storage of all necessary information.
▪ Obtaining data for all necessary queries.
▪ Reducing data redundancy and duplication.
▪ Ensuring database integrity.
Design methodology is a structural approach that includes the use of specialized procedures, methods, tools, documentation and is aimed at supporting and managing the design process.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 5
1.2. Subject Area Analysis1
The database developer should receive answers to the following basic questions:
Subject area boundaries (SA)• What fragments of SA should be considered in the database at present?• What fragments are supposed to be included in the future?
DB purpose• What is the list and what is the significance of the proposed functions of the database (search, operational, or analytical data processing)?
The circle of potential users and their information needs• Who needs what, in what form and how often?
Analysis of information flows based on existing technology for the accumulation and processing of information• What is the list of key documents?• What is their appearance (paper or electronic)?• Where and by whom are they created?• Where and to whom are they transmitted?• What is the list of elementary data for each document?• What is the set of valid values for each elementary data?
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 6
1.2. Subject Area Analysis 2
Processing algorithms and data update features• What are the relationships between documents and their basic data?• How are some elementary data calculated on the basis of others?• What data is updated at the same time and how often?
Technical base for the implementation of the database• What is available now?• What financial opportunities does the customer have for updating the technical base?
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 7
The design methodology provides for dividing the entire process into the following phases (stages):
1. Conceptual.
2. Logical.
3. Physical.
1.3. Design phases
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 8
1.4. Conceptual design of a database
- a procedure for the construction of the information subject area model that is independent of any physical conditions of implementation.
A conceptual model of a database includes:
• description of information objects or concepts in the subject area and the relationships between them;
• description of constraints, i.e. the requirements for valid data values and to the connections between them.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 9
Stages of conceptual design:
Determining the types of relationships
Creature local conceptual data model based on the concepts of the subject area for each user's type
Determining the types of entities
Defining attribute domains
Defining attributes that are candidate and primary keys
Defining hierarchical entity types: specialization (subclasses), generalization (superclasses), or IS-A (member of) (optional step)
Model checking for redundancy
Verifying that the local conceptual model matches specific user transactions
Defining attributes and link them with the types of entities and relationships
Discussion of local conceptual data models with end users
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 10
1.5. Database Logical Design- is the process of constructing the enterprise information model based on the existing specific data models (relational, network ...), regardless of the DBMS and other physical conditions of implementation
For a relational data model, a datalogical model is a set of relation schemas, usually with primary keys, as well as the “relationships” between relations, which are foreign keys.
The transformation of the conceptual model into a logical model, as a rule, is carried out by formal rules. This step can be largely automated.
At the stage of logic design takes into account the specifics of a particular data model, but it can not take into account the specifics of a particular DBMS.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO eleven
Stages of logical design:
Determining the set of relations on the basis of the structure of the local logical data model
1. Building and testing a local logical data model based on the representation of the subject area for each user's type
Converting a local conceptual data model to a local logical model
Checking the model using the normalization rules
Model validation against user transactions
Create the entity-relationship diagram
Determination of requirements to support data integrity
Discussion of developed local logical data models with end users
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 12
Checking the global logical data model
2. Create and validate global logical data model
Merging local logical data models into a single global data model
Checking possibilities of future expansion model
Creation of the final version of the entity-relationship diagram
Discussion of the global logical data model with users
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO thirteen
1.6. Physical Design- is to create the database schema for a specific DBMS.
The specificity of a particular database may include:
▪ restrictions on the naming of database objects,
▪ restrictions on the supported data types,
▪ selection of decisions related to the physical storage medium (disk storage selection management methods),
▪ dividing the database into files and devices,
▪ data access methods,
▪ index creation,
▪ development of data security mechanisms.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 14
Implementation of enterprise business rules in the target DBMS environment
1. Transfer of global logical data model in the environment of the target database
Design of the main tables in the target database environment
Transaction analysis
Selecting a file structure
2. Design the physical representation of the database
Determination of secondary indexes
Analysis of the need to introduce controlled redundancy data
Determination of requirements for disk storage
Stages physical design (1, 2):
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO fifteen
3. Development of security mechanisms
The development of custom views
Defining access rights
Organization of monitoring and tuning system performance
Stages physical design (3):
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 16
2. The main notation for representation ER diagrams
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 17
18HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
Chen's notation supposes the
representation of entities by rectangles
with the entity's names inside,
relationships by diamonds, and
attributes by ovals connected with a line to exactly one entity.
Chen's notation
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
Crow's foot diagrams use boxes to represent entities and lines between these boxes to show relationships. Varied shapes at the ends of lines depict the cardinality of a given relationship.
Martin's notation (Crow's foot )
Entity
Relationships
19
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
It is a variation of the "crow`s foot" style of data modelling that was favoured by many over the original Chen style of ERD modelling because of its readability and efficient use of drawing space (Oracle).
Barker's notation
Relationships
20
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
The IDEF1X notation displays entities as rectangles with squared or rounded corners. Each relationship has an associated cardinality (displayed with circles and diamonds) that specifies the number of instances of the dependent entity that are related to an instance of the independent entity.
IDEF1X notation AttributesEntity
Relationships
21
Logical models differ in the depth of representation of the data structure:
1. Presentation diagram - describe only the most basic classes of entities and their relationships. Keys cannot be fully described, and relationships cannot be personalized. Therefore, the valid types of relationships are many-to-many.
2. Key diagram - it is necessary to describe all entity classes and their relationships, usually only in terms of primary keys. Many-to-many relationships are detailed here.
3. Full attributive diagram - describe in the most detail all entity classes, their attributes, and the relationships between these entity classes. Typically, these diagrams represent data in the third normal form.
Types of ER diagrams
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 22
3. ER modeling of the subject area using CASE tools
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 23
ERD Tools
ERD Tools
https://support.filemaker.com/s/article/erd-tools?language=en_US
Comparison of data modeling tools
https://en.wikipedia.org/wiki/Comparison_of_data_modeling_tools
79 Data Modeling Tools Compared
https://www.databasestar.com/data-modeling-tools/
20 BEST Data Modeling Tools: Design your Database for FREE
https://www.guru99.com/data-modeling-tools-design-database.html
Data Modelling Tools
http://www.databaseanswers.org/modelling_tools.htm
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 24
ERwin
ER Studio
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 25
Erwin (begin from firm Computer Associates)
The ERWin package is used to model and create databases of any complexity based on entity-relationship diagrams.
Supports different databases:
DB2, SQL Server, Oracle, PostgreSQL, Informix, Sybase,
Progress, SAS , SAP, Teradata and etc.)
After creation of ER-diagrams ERWin automatically generates SQL-code to create tables, indexes, and other database objects.
A package can reengineer an existing database by generating its ER diagram.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 26
https://erwin.com/
For ERWin 4.0
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
ERwin used to build data model.
It has two levels of representation model - logical and physical.
On the logical level data is not linked to a specific DBMS.
Physical level of data - it is essentially a display of the system catalog, which is dependent on the specific implementation of the database.
It allows processes forward and reverse database design:
Forward: ERwin can create the actual database from the physical model, and create different physical implementations from a single logical model.
Reverse: ERwin can also reverse-engineer existing databases into a data model diagram.
Purpose:
27
The model has both logicaland physical levels
Model has only logical level Model has only physical level
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 28
On the logical level ERWin supports 2 notation (IE and IDEF1X) on the physical 3 notation (IE, IDEF1X, DM)
Information Engineering (IE). Notation developed by Martin, Finkelstein and other authors used advantageously in industry.
Integration DEFinition for Information Modeling (IDEF1X). The notation was developed for the US Army and a US federal standard. In addition, it is the standard in a number of international organizations (NATO, the International Monetary Fund).
Dimensional Modeling (DM). Specialized notation designed for the development of data warehouses.
Notations
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 29
To create a logical data model Erwin uses two notations: IDEF1X and IE
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 30
Standard Toolbar
Creature
model
Open
model
Save
model
Call dialogue
Data Browser to
generate reports
Call Report Template
Builder - tool for
publishing reports
Level
entity
Level
attributes
Level
definitions
Change the view levelmodel
Zooming
view model
Switching between the
regions of the model
Subject Area
Selection list to switch
between logical and
physical models
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 31
Toolbox at the logical level
Toolbox at the physical level
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
Always switch to select mode after editing
Entity
Relationship
Category
Select mode
View table
Relationship
32
ERwin has several diagramdisplay levels:• entities • attributes, • definitions, primary keys, • icons. To switch between the first three levels you can use the toolbar buttons. You can switch to another display level using the context menu that appears when you "click" anywhere in the diagram, but not on occupied model objects.In the context menu, select Display Level and then display the desired level.
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
Display Levels
33
!!! It`s important• First select Logical / Physical model type
• If you will use Cyrillic before the creation of the first entity set Cyrillic script (Format- Default Fonts & Colors)
• Before generating the database, create a Access empty database for versions Access 2000
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO 34
Test questions
HNEU, DEPARTMENT OF INFORMATION SYSTEMS, COURSE DATABASE, VV FEDKO
1. Ответы на какие вопросы должен получить разработчик базы данных во время анализа предметной области?
2. Из каких фаз состоит процесс проектирования баз данных? Чем они отличатся друг от друга?
3. Опишите назначение ERWin.
ru:
1. Answers to what questions should a database developer get when analysing a subject area?
2. What phases does the database design process consist of? How do they differ from each other?
3. Describe the purpose of ERWin.
en:
35