The Camtasia Studio video content presented here requires a more recent version of the Adobe Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

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

Generate SQL from ERD

  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
  3. Right click on the diagram's background and select Utilities > Generate SQL... from the pop-up 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 pop-up 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

Trigger

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

Automatic column type assignment

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