Using ERWin to create Entities and Attributes

Starting ERWin
To begin, you need to start up ERWin by selecting the Start button, the Programs menu item and the  PLATINUM ERwin ERX3.5.2 folder and the PLATINUM ERwin ERX3.5.2 program.

If you get an error message or warning message, just click OK.
If you get a log in screen, just close it and proceed.

Change the Model Type
 
In the tool bar select Logical 
 

Change the Notation

Choose Preference on the Option menu.
Click the Methodology tab.
Click the I.E. button in the Logical Notation and the Physical Notation . (The Information Engineering notation is what we have been covering in class.) Click OK.
Create a New ER diagram.
 
If you do not see the ERWin Toolbox, select the Window menu and the ErWin Toolbox menu item.
Select  File menu and the New menu item and then the Blank diagram choice. Click OK.
Check that both the Logical model is displayed in the option list on the ERwin toolbar and that the methodology is I.E.
TIP: As you do your work in Erwin, you may need to rearrange the objects (entities, toolbox etc.) in the workplace.
Draw the new entity
 
In the ERwin toolbox, click the Entity tool - first row, second from the left.
The Entity tool creates an independent entity with square corners.
Click anywhere on the diagram. ERwin draws the new entity and labels it E/n, where E stands for entity and n is a unique number.
Name the entity
Click the Select tool  in the toolbox.
Click on the new entity - do not double click.
When an edit box appears, type CLIENT.
Press SHIFT + ENTER to close the edit window for the entity name.
Change the entity name
Select the CLIENT entity using the Select tool. Click the name CLIENT, wait briefly, then click again.
Use the BACKSPACE or DELETE key to erase the name.
Type the new name CUSTOMER.
TIP: You can press the ESC (Escape) key to cancel a change.
Press SHIFT + ENTER to close
Add primary key attribute
 
If you do not see the Independent Attribute Browser, click on the diagram then press CTRL + B to display it.

Select number from the list displayed in the Logical Independent Attribute Browser dialog.
Drag and drop the number attribute into the primary key area of the CUSTOMER  entity.

Change the attribute name
 
Select the CUSTOMER entity using the Select tool.
Tab to the number attribute (the primary key).
Use the DELETE or BACKSPACE key to erase the old name. Type # * id
ERWin does not provide the markings of #, * o that we have covered in class.  Therefore, we will include these as part of the name of the attributes.
Press SHIFT + ENTER to save your changes.
Tip: You can press the ESC (Escape) key to cancel a change.
Add non-key attributes
Select string from the list displayed in the Logical Independent Attribute Browser dialog.
Drag and drop string into the Non-Key area. Notice that a horizontal line appears to indicate where the attribute will be placed.
Select the CUSTOMER entity using the Select tool.
Tab to the string attribute.
Use the DELETE or BACKSPACE key to erase the old name. Type * lastname
 
Repeat this process to add another string attribute named * firstname

Repeat this process to add number attribute named o phone

When done your entity should look like the one on the right.

Next add the following two Entities and their attributes:
An entity called INVOICE that has the following attributes:
invnbr  - it is the key of type number
dateorder  - it is a mandatory non-key attribute of type datetime
qnty  - it is a mandatory non-key attribute of type number
delivtype  - it is an optional non-key attribute of type string
An entity of PRODUCT that has the following attributes:
pid  - it is the key of type number
unitmeasure  - it is an optional non-key attribute of type string
Move the entity and move an attribute
 
When you are done with this you should have the three entities CUSTOMER, INVOICE and PRODUCT. 

Move them (reposition them) so that they have the layout that is displayed on the right.

Change the Display Options
 
Right button click in an empty area.
Select Display Options / Entities.
When the submenu appears, select Primary Key Designator.
Repeat this process until you have selected Logical Datatype / Domain 
and Foreign Key Designator.
Close the Model
To save your work, select Save as and your floppy disk or your H drive and give the file the name AG1.er1 file then click OK.  (To close without saving, select Close without saving then click OK.)
Select the File menu and the Exit menu item.