Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Good morning,

Using LaTeX or another text-macro tool/library, how can I use natural language text to describe relationships, then generate an Entity-Relationship Diagram and generate SQL DDL to create the database schema from it?

share|improve this question
What SQL are you trying to generate? DDL or DML? – mrdenny Sep 15 '11 at 5:11
DDL (for Oracle) Basically just the Create reference + attribute related commands need to be generated. – A T Sep 16 '11 at 7:10
up vote 3 down vote accepted

There are many ways to do this, but the most important thing to know is that there is a name for what you want to do: Object Role Modeling. It's a process for creating conceptual models using natural-language semantics.

This is a pretty good (if old) overview of the process.

The Wikipedia page for ORM has a pretty complete list of the available tools, many of which are free.

The most up-to-date solution is NORMA, since it is actively maintained by the ORM Foundation, but that's a plug-in that requires Visual Studio.

If you don't have Visual Studio, Infagon looks like it is still pretty actively developed and may be your best bet.

CaseTalk is also worth a look. Free to students and educators, but commercial otherwise.

share|improve this answer
Thanks, this is what I was looking for! – A T Dec 19 '11 at 16:32

I think I will write the SQL by hand, and generate a diagram from that using SchemaSpy.

Unless you can think of a quicker; more efficient way?

share|improve this answer

I did something like this once with a document parser tool I wrote. It would strip out specially formatted comments from a DDL statement and produce a data dictionary. This was renedered with LaTeX. However, I still had to reverse engineer the database into Visio to make E-R diagrams.

For a limited subset of SQL needed to parse create table statements it wasn't too hard to write the parser. I had it working in a couple of weekends.

share|improve this answer
Awesome, would you be able to share this? – A T Nov 19 '11 at 11:46

Hey If it's any help i have used visio to create my ERD and revere engineer it to DB using it's Reverse engineering tool, which provides reverse engineering support to ms access, ms sql server, ...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.