Вы находитесь на странице: 1из 2

Configuring ERD in DB-VA

Page 1 of 2

Created by PDFTiger Unregistered Version

Created by PDFTiger Unregistered Version


Creating an entity relationship diagram
1. Right click on Entity Relationship Diagram on Diagram Navigator and select New Entity Relationship Diagram from the pop-up menu 2. Enter Online Bookstore as the name for newly created ERD 3. Select Entity from the diagram toolbar and click it on the diagram 4. Name the newly created entity as Order 5. Press its resource icon One-to-One Relationship -> Entity and drag it out 6. Release the mouse and name the newly created entity as Staff 7. Press Order's resource icon Many-to-Many Relationship -> Entity and drag it out 8. Release the mouse and name the entity as Product 9. Rename the entity between Order and Product as OrderLine 10. Right click on Order and select New Column from the pop-up menu 11. Enter +id:integer(10) in new column and press Enter key 12. Enter pur_date:date and remarks:varchar(200) in two new columns respectively 13. Right click on pur_date:date and select Unique from the pop-up menu

Created by PDFTiger

Generate SQL from ERD

Unregistered Version

1. Select Tools > Object-Relational Mapping (ORM) > Database Configuration... from the main menu 2. Check Oracle and click OK button in Database Configuration dialog box

http://media.visual-paradigm.com/media/videos/dbva60/010/010-entity-relationship-diagr... 12/30/2011

Configuring ERD in DB-VA

Page 2 of 2

3. Right click on the diagram's background and select Utilities > Generate SQL... from the popup menu 4. Highlight the code and press Execute button in Generate SQL dialog box

Stored procedure
1. Select Stored Procedures from the diagram toolbar and click it on diagram 2. Right click on the newly created stored procedures and select New Procedure from the popup menu 3. Enter sp_GetBookWithName() in procedure 4. Right click on sp_GelBookWithName() and select Open Specification... from the pop-up menu 5. Enter statement and click OK button in Procedure Specification dialog box

Created by PDFTiger

Unregistered Version

Trigger
1. 2. 3. 4. 5. Select Triggers from the diagram toolbar and click it on diagram Right click on the newly created triggers and select New Trigger from the pop-up menu Enter product_trigger in trigger Right click on product_trigger and select Open Specification... from the pop-up menu Enter statement and click OK button in Trigger Specification dialog box

Automatic column type assignment


1. 2. 3. 4. 5. 6. 7. 8. 9. 10.

Select Tools > Options from the main menu Open Diagramming > ERD & ORM > Auto Column Type in Options dialog box Press Add button Enter description in name and varchar(210) in type and then click OK button in Add Auto Column Type dialog box Click OK button in Options dialog box Select Entity from the diagram toolbar and click it on the diagram Name the entity as Customer Right click on Customer and select New Column from the pop-up menu Enter description in the column and press Enter key Enter gender in the new column and press Enter key

Created by PDFTiger

Unregistered Version

Created by PDFTiger Unregistered Version

http://media.visual-paradigm.com/media/videos/dbva60/010/010-entity-relationship-diagr... 12/30/2011

Вам также может понравиться