Wednesday, October 29, 2008

Create ER diagrams from SQL

I needed to make a schema for my recent database project. I already had the sql tables, so I decided to try making the schema an easy way. The following procedure was followed on my ubuntu machine.

Step 1: Install sqlfairy

sudo apt-get install sqlfairy

Step 2 : Install mysql or oracle(if you don't have it already)

apt-get instal mysql-server5.0

Step 3 : sqlt-diagram -d=MySQL -o=hmc.png hmc.sql --color

This will create a colored image, hmc.png taking table details from hmc.sql, where -d=MySQL specified the MySQL driver.

Easy, isn't it...

You can read more about sqlfairy from the link provided. It provides a lot of other magical features.

2 comments:

Abhinav.Singh said...

Dood I am quite impressed by the way you pen down your blog. Many do it for the sake of it, but i liked your way.

I don't remember by your face though :(

NKG said...

thanks for such an encouraging comment..