introducing the mysql workbench case tool

42
MYSQL WORKBENCH INTRODUCING A CASE TOOL

Upload: andras-boegoely

Post on 22-Jan-2018

514 views

Category:

Engineering


7 download

TRANSCRIPT

Page 1: Introducing the MySQL Workbench CASE tool

MYSQL WORKBENCHINTRODUCING A CASE TOOL

Page 2: Introducing the MySQL Workbench CASE tool

ER MODELING

Entity Relationship

Attribute Cardinality

Page 3: Introducing the MySQL Workbench CASE tool

ENTITY

Animate

Inanimate

Any other…

Page 4: Introducing the MySQL Workbench CASE tool

ENTITY COLLECTION

• Collection of the same type of entities

• Analogous to the database tables

Page 5: Introducing the MySQL Workbench CASE tool

ENTITY – AN EXAMPLE

Teachers Students

Classes Subjects

Page 6: Introducing the MySQL Workbench CASE tool

ENTITY – ANOTHER EXAMPLE

Product Category

Customer Order

Page 7: Introducing the MySQL Workbench CASE tool

ATTRIBUTES

• Anything, that can give a meaning or value to an entity

• It can be an unique identifier

• Or a not too unique name

Page 8: Introducing the MySQL Workbench CASE tool

ATTRIBUTES - EXAMPLE

Product

Identifier

Price

NameCustomer

Shipping

addressE-mail

NameIdentifier

Page 9: Introducing the MySQL Workbench CASE tool

RELATIONSHIP

• Between entities, there can be relationships

Page 10: Introducing the MySQL Workbench CASE tool

RELATIONSHIP - EXAMPLE

placesCustomer Order

containsCategory Product

Page 11: Introducing the MySQL Workbench CASE tool

RELATIONSHIP – RECURSE EXAMPLE

contains

contains

Category

Page 12: Introducing the MySQL Workbench CASE tool

CARDINALITY

One-to-one

One-to-many

Many-to-many

The cardinality of the relationship

Page 13: Introducing the MySQL Workbench CASE tool

CARDINALITY – EXAMPLE - ONE-TO-ONE

CustomerShipping address

accepts product

11

Page 14: Introducing the MySQL Workbench CASE tool

CARDINALITY – EXAMPLE - ONE-TO-MANY

Category Productcontains0..N1

Page 15: Introducing the MySQL Workbench CASE tool

CARDINALITY – EXAMPLE - MANY-TO-MANY

Order Productcontains0..M0..N

Page 16: Introducing the MySQL Workbench CASE tool

CARDINALITY – EXAMPLE - MANY-TO-MANY M products

N orders

Page 17: Introducing the MySQL Workbench CASE tool

CASE

• Computer-aided software engineering

• Anything, that can aid software development

Page 18: Introducing the MySQL Workbench CASE tool
Page 19: Introducing the MySQL Workbench CASE tool
Page 20: Introducing the MySQL Workbench CASE tool

MYSQL WORKBENCH FUNCTIONALITY

Database

Design

Database Development

Database Administration

Page 21: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

Creating a database (schema)

Page 22: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

Az üres adatbázis(séma)• Diagramok• Táblák• Nézetek• Rutinok• Rutin csoportok

Page 23: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Adding table

• Analogous to an entity

collection

• We can place

• Layers

• Texts or comments

• Images

Page 24: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Database columns

• Defining types

• Defining other constraints

• Primary key

• Unique key

• Not null

• Auto increment

• Adding comments

Page 25: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Many-to-one kapcsolat

• Defining foreign key

Page 26: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Setting foreign key

• What happens in

the event of an

update,

• or a delete

Page 27: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Many-to-many

relationship

• It is possible with a new

database table

Page 28: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Connect the customers

to our model!

• It will be possible with a

one-to-many relation

Page 29: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• Add more attributes!

Page 30: Introducing the MySQL Workbench CASE tool

DATABASE DESIGN

• More special kind of attributes can be

enumerations

• We can constrain the value to a predefined set

ENUM(‘processing’, ‘processed’)

Page 31: Introducing the MySQL Workbench CASE tool

FORWARD ENGINEERING

• We can generate database from an existing model

• It will generate all the properties defined in the model

Page 32: Introducing the MySQL Workbench CASE tool

FORWARD ENGINEERING

• We don’t have to generate everything• Lot of options to set

Page 33: Introducing the MySQL Workbench CASE tool

FORWARD ENGINEERING

• It saves us from a lots of coding!

Page 34: Introducing the MySQL Workbench CASE tool

FORWARD ENGINEERING

• And we don’t have to care about how to run the code!

Page 35: Introducing the MySQL Workbench CASE tool

DATABASE DEVELOPMENT

• Or, SQL Development

• It can aid us constructing SQL Queries

Page 36: Introducing the MySQL Workbench CASE tool

DATABASE DEVELOPMENT

Page 37: Introducing the MySQL Workbench CASE tool

DATABASE DEVELOPMENT

• The Customer table

contains

SELECT * FROM customer;

Page 38: Introducing the MySQL Workbench CASE tool

CHANGE MANAGEMENT

• The database changes during its lifecycle

• Executing changes can be painful!

Page 39: Introducing the MySQL Workbench CASE tool

CHANGE MANAGEMENT

• We want to add another field to an existing database table

After change

Page 40: Introducing the MySQL Workbench CASE tool

CHANGE MANAGEMENT

• Let us change our model!

• Choose synchronize

• The tool will look for the

existing model in the

database and generate the

necessary changes

Page 41: Introducing the MySQL Workbench CASE tool

REVERSE ENGINEERING

• Creating a model from an existing database

• Not complete, due to the lack of metadata like comments

Page 42: Introducing the MySQL Workbench CASE tool

THANK YOU FOR YOUR ATTENTION!

Sources and inspirations

• http://www.tutorialspoint.com/dbms/er_model_basic_concepts.htm

• https://netbeans.org/kb/docs/javaee/ecommerce/data-model.html

• http://creately.com/blog/diagrams/er-diagrams-tutorial/

• http://intranet.unab.edu.co/AdministracionNoticias/Archivos/mysql_wp_workbench_93073623.pdf

• https://www.mysql.com/products/workbench/