Tutorial 3 SQL Developer Data Modeler and Database Lifecycle
Tutorial 3 SQL Developer Data Modeler and Database Lifecycle
Oracle SQL Developer Data Modeler is a free graphical tool that enhances productivity and simplifies
data modeling tasks. Using Oracle SQL Developer Data Modeler users can create, browse and edit,
logical, relational, physical, multi-dimensional, and data type models. The Data Modeler provides
forward and reverse engineering capabilities and supports collaborative development through integrated
source code control. The Data Modeler can be used in both traditional and in Cloud environments.
https://www.oracle.com/database/technologies/appdev/datamodeler.html
Note: You may need to create an account to download. Please follow the on-screen steps to create an
account.
https://docs.oracle.com/cd/E39885_01/doc.40/e48205/tut_data_modeling.htm#DMDUG36166
However, before you create the entities, create some domains that will make the entity creation (and later
DDL generation) more meaningful and specific.
You can skip the part of adding domain if you choose Logical data type for attributes while creating
entities
Adding Domains:
In planning for your data needs, you have determined that several kinds of fields will occur in multiple
kinds of records, and many fields can share a definition.
For example, you have decided that CUSTOMER table will have following structure:
1. Click Tools, then Domains Administration.
2. In the Domains Administration dialog box, add domains with the above definitions. Click Add to start
each definition, and click Apply after each definition.
When you have finished defining these domains, click Save. This creates a file named defaultdomains.xml in
the datamodeler/domains directory or datamodeler\domains folder under the location where you installed
Data Modeler.
4.
1. In the main area (right side) of the Data Modeler window, click the Logical tab.
3. Click in the logical model pane in the main area; and in the Logical pane press, diagonally drag, and
release the mouse button to draw an entity box. The Entity Properties dialog box is displayed.
5. Click Attributes on the left, and use the Add (+) icon to add the following attributes, one at a time.
(For datatypes, select from the Domain types) and from Source Type select CUSTOMER_ID, check
Primary UID to make it key
6. Add all attributes and click OK to finish creating CUSTOMER Entity
After finishing the customer entity is created:
PRACTICE EXERCISE: Repeat the above steps for creating entities for the below remaining
entities:
When you are done with all entities, the logical model pane in the main area should look like the following
figure.
Note that for this figure, Barker Notation is used (you can change to Bachman notation by clicking View, then
Logical Diagram Notation, then Bachman notation).
Bachman Notation
Creating Relations Between Entities
2. Click first in the CUSTOMER box, then in the RENTAL_HISTORY box. A line with an arrowhead is
drawn from CUSTOMER to RENTAL_HISTORY and following property dialogue will appear:
3. Check source optional box, since every customer may not rent a media, however, rental history
should be mandatory if some customer rent a media, therefore leave target optional unchecked.
Add one-to-many relationship from MOVIE to MDIA. Note media cannot exist without movie keep source
and target unchecked and set delete rule as CASCADE as shown in the below figure.
Optionally, double-click a line (or right-click a line and select Properties) and view the Relation
Properties information.
MOVIE and START_BILLING has one-to-Many relationships from MOVIE to START_BILLING as shown in
the below figure. Please note that identifying box is checked to make the TITLE_ID both PK and FK.
Practice exercise: Complete all the remaining relationship.
The final ERD should look like the following if using Barker Notation.
Bachman Notation
Once you have completed the above exercise answer the following questions:
1. What are the main stages of the database system development lifecycle? Depict the
stages using www.draw.io. For each stage, state if it is mandatory or optional.
2. Discuss the main approaches to database design. Discuss the contexts where each is
appropriate.
3. What are the three phases of database design? How are they related to each other?
4. The following are problems that have been identified during the testing process in the
development of a new system. In which part of the life cycle do you think these problem
could have originated and been identified by a thorough review following that stage in
the development life cycle?