You are on page 1of 87

Oracle SQL Developer Data

Modeler
Workshop

Copyright © 2020, Oracle and/or its affiliates. All rights reserved.


Getting Started with
Oracle SQL Developer Data Modeler
• Oracle SQL Developer Data Modeler offers a range of
data and database modeling capabilities, enabling you
to:
−Capture business rules and information
−Create and process Logical, Relational, and Physical Models
−Store metadata information in XML files
−Synchronize the Relational Model
with the Data Dictionary

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 3


Getting Started with
Oracle SQL Developer Data Modeler
• Key Concepts:
−Create a Logical Model using SQL Data Modeler
−Forward Engineer the Logical Model to a Relational Model
−Reverse Engineer a Relational Model
−Apply Naming Standards using:
• Glossary
• Naming Template

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 4


Getting Started with
Oracle SQL Developer Data Modeler
• Difficulty:
−Beginner
• This workshop is appropriate for someone who has never used the
Oracle SQL Developer Data Modeler but has some basic knowledge of
Database Design methods and terminology
• Duration:
−Approximately 2-3 hours
• Notes:
−This tutorial was built using
Oracle SQL Developer Data Modeler 17.4.0

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 5


Downloading Oracle SQL Developer Data Modeler
• To download the installation files, go to the Oracle
Technology Network at:
−http://www.oracle.com/technetwork/developer-
tools/datamodeler/downloads/index.html
• Be certain you have a JRE installed
−Download from the Oracle Technology Network at :
−http://www.oracle.com/technetwork/java/javase/downloads
/index.html

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 6


Open Oracle SQL Developer Data Modeler
• Once the Data Modeler zip file is
downloaded:
− Extract the zip file into any folder
− Within that folder expand the
datamodeler folder
− Double-click datamodeler.exe for
32-bit and double-click
datamodeler64.exe for 64-bit

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 7


Open Oracle SQL Developer Data Modeler
• Reference the valuable information on the Start Page
−This page can be re-opened by clicking Help, Start Page
• Close the Start Window
• We’re ready to go!

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 8


Oracle SQL Developer Data Modeler Interface:
Example Overview

Main
Menu

Object Browser Display Window Navigator

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 9


Building an ERD by Using Oracle SQL Developer Data
Modeler

d. Set the source


and target values
c. Define for the
relationship relationship
b. Add between
attributes entities
a. Create and UIDs
entities

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 10


Case Scenario: An Introduction

Class, we are going to use the Global Fast


Foods company to illustrate the creation of
an Entity Relationship Diagram.

Faculty We will start by examining the ERD including


the entities and their attributes. We can then
use the Oracle SQL Developer Data Modeler
tool to build the Logical Model.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 11


Global Fast Foods ERD
• This is the
complete Global
Fast Foods ERD,
but we will start
out with a
simpler version
found on the next
slide

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 12


Global Fast Foods Entities and Attributes
• Create these entities in
SQL Data Modeler
using the directions on
the following slides

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 13


Building an Entity Relationship Diagram
1
Navigate to the
Logical Tab
2
Create an Entity
3
Add Attributes to
the Entity
4
Set the Unique
Identifiers
5
Define the Relationship
Between the Entities
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 14
Building an ERD: Step 1
• Navigate to the Logical tab
• The first step in building an ERD in Oracle SQL
Developer Data Modeler is to click the Logical tab
• Notice that the toolbar changes to display tools
specifically for working with ERDs

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 15


Building an ERD: Step 1
• If you do not see the Logical tab, then perform the
following steps:
−Right-click Logical Model in the browser pane
−Select Show

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 16


Building an ERD: Step 2
• To create an entity, perform the following steps:
a. On the toolbar, click the New Entity tool, and then click
anywhere in the white space of the Logical pane - the
Entity Properties window appears
b. In the Entity Properties window, enter the name of the
entity
i. For the example below, the entity name is “STAFF"
ii. Do not close the window after you have entered the entity name
b
a

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 17


Building an ERD: Step 3
• To add attributes to the entity, perform the following
steps:
a. Select Attributes in the navigator of the Entity Properties
window
b. Click the Add an Attribute icon
c. In the Name field, enter a name for the attribute
a
b c
Double click on blue entity box in d
the model at any time to return
to the Entity Properties Window e
to modify the entity or its
attributes. f

g
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 18
Building an ERD: Step 3
d. In the Data type field, select Logical, then source type from
the dropdown list
e. Enter the attribute size
f. If the attribute is the primary key or is mandatory check the
appropriate box
g. Click Add Attribute to add another until done, then OK
a
b c
Double click on blue entity box in d
the model at any time to return
to the Entity Properties Window e
to modify the entity or its
attributes. f

g
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 19
Building an ERD: Step 3
• You can set commonly used Logical data types as
preferred by performing the following steps:
a. Select Tools > Preferences > Data Modeler, and then select
the Model node
b. Select the types from the All Logical Types section, and
then move them to the preferred area by clicking the arrow
c. Click OK
a

c
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 20
Building an ERD: Step 3
• To view only the preferred data types, select the
Preferred check box
• This will limit the options displayed in the drop-down
list for Logical types

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 21


Building an ERD: Step 4
• If you have not done
so, you can set the a
Primary UID for the b
entity by performing
the following steps: c
a. Select Attributes in the
left navigator of the
Entity Properties
window

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 22


Building an ERD: Step 4
a. Select the attribute that
you want to assign as
the Primary UID. a
b. Select the Primary UID b
check box.
− The attribute that you c
assign as primary UID is
automatically also set to
mandatory

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 23


Building an ERD: Step 4
• To set Secondary UIDs
for the entity, perform a b
the following steps:
c
a. Select Unique Identifiers
in the left navigator of the
Entity Properties window d
b. Click the Add icon to add
another UID
c. Click the Properties
icon/General tab
d. Enter a name to identify
the Secondary UID

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 24


Building an ERD: Step 4
e. Select Attributes and
Relations from the left
navigator of the Key
Properties window
f. Select the attribute to set e g
as a Secondary UID f
g. Click the arrow icon to
move the attribute to the
right-hand pane
h
h. Click OK

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 25


Case Scenario: Entities and Attributes
Class, we are making
great progress!
We now have our
entities and their
attributes created. We
have also assigned
Faculty
primary and secondary
keys and the optionality
of each attribute.
Now we will add
relationships to our
model.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 26


Building an ERD: Step 5
• Define the relationships between the entities

• The relationships available in Oracle SQL Developer


are:
− 1:1 (one-to-one)
− 1:N (one-to-many)
− 1:N Identifying Relationship (one-to-many barred
relationship)
− M:N (many-to-many)

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 27


Building an ERD: Step 5
• Define the relationships between the entities
• To define the relationships between entities in Oracle
SQL Developer, perform the following steps:
a. Click a relationship type on the toolbar
b. Click the source entity and then click the target entity. (In a
one-to-many relationship the source is the “one” and the
target is the “many”)

b
a

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 28


Building an ERD: Step 6
• Set the source and target values for the relationship
• In the Relation Properties Window:
−Select the General property in the left navigator
−Specify a name for the relationship
−Specify the source and target names for the relationship
−Double click on the relationship line at any time to return to
the Relation Properties Window to modify the relationship
a
b

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 29


Building an ERD: Step 6
• To display source and target relationship names:
a. Right click on the whitespace of the diagram
b. Select Show
c. Click Labels

a
b
c

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 30


Building an ERD: Step 6
• To change the path of a relationship line:
a. Right click on the relationship
b. Select Add elbow
c. Drag the center handle to the desired position

c
a

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 31


Case Scenario: Building Relationships

Things are moving along well with our ERD. Our one-
to-many relationships, which compose the majority of
our relationships, have been created.

However, we’ve learned that in the database design


process, sometimes relationships are not so simple.
Faculty
Sometimes we have supertype/subtype, arc, recursive
or other types of relationships in our design.

Let’s take a look at how we can model these


relationships using the SQL Data Modeler software!

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 32


Case Scenario: Supertype/Subtype Entities
The management at Global Fast Foods would like to include some
categories for the staff such as:
• Order Taker
• Cook
• Manager

This can be achieved by modifying the STAFF entity to hold staff


details that are common to all three staff types. This will be a
Faculty
supertype entity.

We can then create entities for specific staff categories which will
inherit the properties of the supertype entity, in addition to their
own specific attributes. Hence, the specific staff types will be
subtypes within the supertype entity.

Let’s look at how to model supertypes and subtypes using SQL


Data Modeler.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 33


Creating a Supertype Entity
• To define an entity as a subtype in Oracle SQL
Developer Data Modeler you need to first ensure that
the supertype exists.
• In this example, the super type is STAFF.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 34


Creating a Supertype Entity
• Perform the following steps to create the COOK
subtype:
a. Create a new entity for each subtype then double-click the
entity
− For the example in the slide, you want to make COOK a subtype of the
STAFF supertype
− Double-click COOK
Supertype
a
Subtype

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 35


Creating a Supertype Entity
• Perform the following steps to create the COOK
subtype:
a. In the General tab, select the STAFF supertype entity from
the Super Type list, and then click OK
− The COOK entity is now a subtype of the STAFF supertype and will inherit
all the attributes of the supertype
− Do the same for the other subtypes
Supertype

Subtype

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 36


Case Scenario: Arc Relationships

Great work!

The management at Global Fast Foods has also informed


us that a food item can only be listed on one menu at a
time – in this case either the promotional menu or the
regular menu – it cannot be listed on both.
Faculty
We can model this mutually exclusive relationship using
an Arc.

Let’s look at how to model arcs using SQL Data Modeler.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 37


Creating the Arc Relationship
• To create an exclusive relationship in Oracle SQL
Developer Data Modeler, perform the following steps:
a. Hold the Ctrl key and select the intersecting entity and
both relationships on which you want to create the Arc
relationship
b. Click the New Arc icon in the toolbar
c. The exclusive relationship is created with the arc
a

b
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 38
Case Scenario: Barred Relationships

In our conversations with the Global Fast Foods


company it has been determined that an ORDER can
have many FOOD ITEMs on it resulting in a many to
many relationship between these entities.

To resolve this situation an intersection entity - ORDER


Faculty LINE was created. The primary key for this entity
consists of the PKs of the original entities ORDER and
FOOD ITEM. This is called an identifying or barred
relationship.

Let’s look at how we can model this type of relationship


using SQL Data Modeler.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 39


Creating the Barred Relationship
• To create a barred relationship:
a. Select Identifying Relationship from the toolbar
b. Click the source and target entities and create the
relationship between the entities.
a Identifying
Relationship

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 40


Case Scenario: Recursive Relationships

We are almost done with creating our relationships!

As you may recall from our database design studies,


sometimes an entity has a relationship with itself. This
is called a recursive relationship.

MANAGERs at Global Fast Foods are also STAFF


Faculty
members. The MANAGER subtype has a relationship to
the supertype of STAFF.

Let’s look at how we can model a recursive relationship


using SQL Data Modeler.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 41


Creating the Recursive Relationship
• To add a Recursive Relationship, select the required
relationship from the toolbar as normal, and then click
on the entity to make it the source
• Click the same entity a second time to make it the
target
−In this case click the subtype MANAGER, and then the
supertype STAFF
−Hint: Add elbows to the relationship line
Recursive
Relationship

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 42


Case Scenario: Building a Relational Model
Students, we have completed building our Logical Model for
the Global Fast Foods Company!

It should look something like this :


Faculty

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 43


Case Scenario: Building a Relational Model

The next step is to create a Relational Model (also known as


a Physical Model) which will be used to build our database!

Faculty

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 44


Benefits of Creating a Relational Model
• A Relational Model:
−Is closer to the implementation solution
−Facilitates discussion
−Forms the basis for the physical database design
−The ideal model can be adapted to a Relational Database
Management System (RDBMS) model

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 45


Overview of Relational Database
Table: CUSTOMERS

ID FIRST_NAME LAST_NAME ADDRESS CITY STATE ZIP PHONE


NUMBER
101 Jones Smith 12 Oxford Hudson MA 01234 555-1212
Street

Primary Key Columns Row


Table in the Relational Model

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 46


Terminology Mapping
ANALYSIS DESIGN
Logical Model Relational Model
Entity Table
Attribute Column
Instance Row
Primary UID Primary Key
Secondary UID Unique Constraint
Relationship Foreign Key
Business Constraints Check Constraints

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 47


Engineering a Data Model
• Forward Engineering is the process of transforming a
Logical Data Model to a Relational Model
• In Oracle SQL Developer Data Modeler a Physical
Model is represented by a Relational Model
• Reverse Engineering is the process of creating a
Conceptual or Logical Model by extracting the
information from an existing data source Models

Models

DD
L
Data Dictionary
DD
L Models
Data Dictionary
Synchroni
ze

DD
L
Data Dictionary
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 48
Case Scenario: Building a Relational Model

Students, it is possible to create a Relational Model


from an existing Logical Model by using the Oracle
SQL Developer Data Modeler tool!

Faculty As we just learned, this is called Forward Engineering.

Let’s take a look at the steps involved in Forward


Engineering a Logical Model to a Relational Model
using the Oracle SQL Developer Data Modeler tool.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 49


Case Scenario: Global Fast Foods Company ERD
• Again, here is our Logical Model
• We will now create the Relational Model using the
Oracle SQL Developer Data Modeler tool

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 50


Engineering a Relational Model
• Here are the steps involved in forward engineering a
Logical Model to a Relational Model using Oracle SQL
Developer Data Modeler:
a. Select the Logical Model
b. Click the Engineer to Relational Model icon
c. Accept all the defaults and click Engineer
b
a

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 51


Engineering a Relational Model
d. Click the Relational tab to see the engineered Relational
Model
−Hint :
• You may have to resize the tables to see all of the information, and
delete subtypes that have been merged into the supertype
• We will see how to control mapping of subtypes later in the workshop
d

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 52


Reverse Engineering a Relational Model
• Reverse Engineering from a Relational to a Logical
Model allows an ERD to be created from an existing
Physical design
• Steps to Reverse Engineer a Relational Model using
Oracle SQL Developer Data Modeler:
a. Select the Relational Model.
b
b. Click the Engineer to Logical Model icon.
c. Accept all the defaults and click Engineer.
a

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 53


Case Scenario: Modifying the Relational Model

Students, you may have noticed that some of the


names in the Relational Model are very long and
cumbersome.

Oracle Data Modeler has some features that can


Faculty
help us overcome some of these issues.

In the following slides we will be looking at using a


Glossary and applying naming standards.

Let’s take a look!

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 54


Naming Conventions
• Decide on conventions for:
−Table names
• The plural of the entity name is generally used as the corresponding
table name
−Column names and special characters (%, *, #, -, space, …)
• Column names are often identical to the attribute names, with a few
exceptions
• Replace special characters with an underscore because SQL does not
allow most special characters to be used in column names
• Often column names are abbreviated
−Table short names (abbreviations)
• A unique abbreviation for every table is a very useful element for the
naming of foreign key columns or foreign key constraints

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 55


Naming Restrictions with Oracle Database
• Table and column names:
−Must start with a letter
−May contain up to 30 alphanumeric characters
−Must not contain spaces or some special characters
−Must avoid reserved words
• Table names must be unique within a schema
• Column names must be unique within a table

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 56


Applying Naming Standards Using Oracle SQL
Developer Data Modeler
• There are many ways to define naming standards in
Oracle SQL Developer Data Modeler
• In this lesson, we will create a Glossary to map entities
to table names, and attributes to column names
Glossary Name
Logical Model Translation

Name
Naming Formatter
Templates Relational Model

Naming Design Rule


Restrictions Validation
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 57
Applying Naming Standards Using Oracle SQL
Developer Data Modeler
• In the previous slides, we engineered from a Logical to
a Relational Model
• By default, table names are mapped directly from
entity names, and are not plurals

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 58


Applying Naming Standards Using Oracle SQL
Developer Data Modeler
• Column names are mapped directly from attribute
names, with the exception that spaces are replaced by
underscores
• To apply our naming conventions to table and column
names, we create a Glossary

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 59


Glossary
• A Glossary in Data Modeler is a set of accepted terms
that can be used in the design
• It ensures that the model complies with your set
naming standards or when engineering between the
Logical and Relational Models
• You can create a new Glossary, use existing Glossaries,
or generate a Glossary based on an existing Logical
Model

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 60


Create a Glossary from a Logical Model
• You can create a Glossary from the existing Logical
Model
• This is quicker and easier than creating a new Glossary,
as entity and attribute names from the Logical Model
are added automatically

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 61


Create a Glossary from a Logical Model
• To create a Glossary from an existing Logical Model:
−Right mouse click on Logical Model in the browser window.
−Select Create Glossary from Logical Model
Creating a Glossary from
a a Logical Model

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 62


Create a Glossary from a Logical Model
• The Glossary editor includes suggested plurals and
abbreviations
• Edits can be made by clicking into the field and
modifying or deleting the text

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 63


Create a Glossary from a Logical Model
• Ensure entity names have plurals, and any required
abbreviations are included for attributes
• Remove any suggestions you do not require
(Modify Glossary as shown in graphic)

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 64


Create a Glossary from a Logical Model
• When you have made all the required changes:
a. Click Save
b. Enter a filename for the Glossary and browse to a location
to save the file (Note the location for use in the next step)
c. Click Save

b
c

a
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 65
Adding the Glossary as the Naming Standard
• For the Glossary to be applied during engineering, you
must add it on the Naming Standard page in the
Preferences dialog box
• To add the Glossary, perform the following steps:
a. Right-click the Design Model in the Browser.
b. Select Properties.
c. Expand Settings and highlight the Naming Standard node
d. Click the green + icon, and then navigate to the location of the
Glossary
e. Click OK c
a
d
b
e
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 66
Editing the Glossary
a • To edit an existing Glossary:
a. Click Tools
b. Click Glossary Editor
c. Browse to the location of the
b
required Glossary file, and click
d. Select Open
c

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 67


Applying the Naming Standard
• To Apply the Glossary
a as the naming
standard:
a. Engineer the Logical
b Model once more
b. Click the Relational tab
to view the results

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 68


Mapping Entities to Table names
Entities • By applying the naming
standards contained in
the Glossary, singular
entity names in the
Logical Model are
mapped to plural table
names in the Relational
Tables Model

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 69


Mapping Attributes to Column names
Entity • If we include the term
ORDER in the Glossary
Editor list of attributes
and an abbreviation of
ORD, by applying the
naming standards
contained in the
Table Glossary, the
abbreviation specified
for Order is applied in
the column names

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 70


Naming Conventions
• Constraints enforce rules and ensure the consistency
and integrity of the database
• Constraints should be given meaningful names to allow
them to be easily referenced

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 71


Naming Conventions for Primary Key Constraints
• Primary key constraints are named using the table
short name, an underscore and the suffix PK
Entities

Unique Unique
identifier identifier

Tables

Primary Primary
key key constraint
constraint

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 72


Naming Conventions for Foreign Key Constraints
• Foreign key constraints are named using the table
short names of both tables, an underscore and the
suffix FK
Entities

Tables

Foreign
key
constraint

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 73


Naming Conventions for Foreign Key Columns
• Foreign key columns are named using the table short
name and column name of the table the foreign key
references Entities

Tables

Foreign
key column

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 74


Apply naming standards in Oracle SQL Developer Data
Modeler.
• By default, constraint names are created using the full
table name in Oracle SQL Developer Data Modeler
• This can lead to constraint names that are very long,
difficult to manage, and may exceed the maximum
permitted number of characters in SQL

Foreign key constraints

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 75


Create Name Abbreviations
• To apply naming standards
to constraint names, first
create a .csv file in a
spreadsheet application
• In the first column specify
the table names, and in the
second column the
abbreviation to use Example of .csv
• Save as .csv file and note file content
the location

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 76


Defining Naming Templates
• To apply our abbreviations to
our model, we need to set the a
pattern in the Naming
b
template
• To access the Templates page:
a. Right-click the name of the c
Design in the Object Browser
b. Select Properties
c. Expand Settings and Naming
Standard d
d. Select Templates

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 77


Defining Naming Templates
• Edit the template to use abbreviated names for
Primary and Foreign keys and Column Foreign Key by
adding abbr to the pattern

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 78


Applying Naming Abbreviations
• To apply the abbreviations from the template:
a. Select Tools
b. Select Name Abbreviations
c. Browse to the .csv file containing the abbreviations
d. Un-check Tables to maintain existing names from the
Glossary
e. Click OK
a
c

d
b

e
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 79
Applying Naming Abbreviations
• The Relational Model is now engineered with
constraint names that follow our naming standards
−Note: if the Logical Model has already been engineered,
sometimes it may be necessary to delete all objects in the
Relational Model, re-engineer the Logical, and then apply the
naming abbreviations

Foreign key constraints

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 80


Mapping Subtypes to Tables
• As you learned in database design lessons, subtypes
can be mapped to tables in a number of ways:
−One table (single table implementation)
−Two table (table for each child (subtype) implementation)

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 81


Mapping Subtypes to Tables
a • To select how subtypes
are engineered in Oracle
SQL Developer Data
b Modeler:
a. In the Logical Model,
c
Double click the Super
type entity to edit
properties
b. Select Subtypes
c. Select required method
for generating subtypes
from the Subtree
generation dropdown box
options

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 82


Case Scenario: Conclusions

Class, I hope you had fun learning how to use the


Oracle SQL Data Modeler!

As you can see, it has powerful features that make the


creation of Logical and Relational Models very easy
Faculty and intuitive.

The Global Fast Foods company is going to be very


pleased with our database models for their company!

If you want more practice using the Oracle SQL Data


Modeler see the project on the next slide!

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 83


Oracle Robots Practice Case Scenario
Oracle Robots currently employs well over 22,000 people in a variety of jobs
ranging from CEO to engineers to accountants. We need to keep basic contact
information for every employee as well as the date they were hired by our company
and the date they leave our company, as well as the department the person is
assigned to. Some of our employees actually design or make the products that we
sell. Others are simply management. Everyone is assigned to a department, no
exceptions.
We have departments in many locations around the world. It is possible to have a
department exist in more than one location (for example, receiving, shipping and
payroll are all departments at each location).
We want to keep information on each location and the number and types of
buildings we have there (including sq. ft. for office space). Additionally, we contact
with suppliers, retailers, and delivery personnel all around the world to make our
business successful. We do not sell our robots to individuals. They must be sold to
a supplier or retailer.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 84


Oracle Robots Practice Case Scenario
We need to know the origin of where purchase supplies. For each item, we
must know how much the item costs, how to contact our supplier and what
method they use to deliver the item to us. For our retailers we need basic
contact information as well as what type of store they are (department or
specialty), the neighborhood the store is in (urban, rural, upscale), and if
the store is part of a chain or not. For the delivery methods we need to
know basic contact information for the company as well as who provides a
discount for bulk shipping and what the discount percentage is.

Here at Oracle Robots we have a number of products that we sell including


parts. For each item we sell, we need to know the price, where it is made,
how many we have sold in the past and where it sells the most.

See the next slide for the sample ERD.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 85


Oracle Robots Practice Case Scenario

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. 86

You might also like