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
So how do you go from one to the other?
Today it requires just a few steps:
Open the Data Modeler Browser in SQL Developer
View .. Data Modeler .. Browser
This will give you a new panel, underneath your Connections|Reports panel.
Go to the Relational Models node in the Tree
Right-mouse-click, ‘New Relational Model’
This will give you a blank model workspace.
Select your table(s) from the connection tree and drag them to the model space.
Voila, 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.
Note: if you haven’t already done this, you’ll need to disable this option in the preferences – ‘Open Object on Single Click.’ If you have this enabled, as soon as you go to click on an object in the tree, we’ll try to open it, versus letting you do a Drag.
I know what you’re thinking, ‘Shouldn’t this be easier?’
Maybe watching the movie will help?
Stay thirsty my friends!
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!