Credit portal




How To: Generate an ERD for Selected Tables in SQL Developer

how to generate report

Entity Relationship Diagrams tell a story. An employee is assigned one department. A location can house one or more departments. Jeff doesn’t have a boss because he is ‘the man.’ It can be challenging to understand the nature of your data by simply reading through the list of Foreign Key constraints for a table. Who wants to read this

when you can instead see this

A pretty picture is worth a few dozen DDL scripts?

Open the Data Modeler Browser in SQL Developer

Go to the Relational Models node in the Tree

This will give you a blank model workspace.

Select your table(s) from the connection tree and drag them to the model space.


instant ERD! The only problem is that you will need to KNOW which objects to drag and drop. The Data Modeler will not automatically recursively search for related objects by foreign key constraint and add those tables. However, if you do add tables one at a time, it will auto-generate the relationship if there is one defined in the database.

Update! SQL Developer can automatically add ‘child tables.’

If you hold down CTRL while you drag, it will bring in all related subordinate objects. Thanks for the heads-up Philip (the guy who wrote the code!) For an example, take HR.REGIONS and Ctrl drag it to a model. You’ll get EMPLOYEES, DEPARTMENTS, JOB_HISTORY, etc all auto-added to the model. Pretty slick!

Category: Bank

Similar articles: