can anyone say a way to transform SQL code to data diagram like ERD ? for som DBMS like MySQL or general SQL

ModelRight, , is a great ERD application and it is free for MySQL and ODBC connected databases. It reverse engineers from the DB, if you wish to reverse engineer from SQL Script, you can examine out Dezign for Databases,

For MySQL may use sqlyog :

SQLyog MySQL GUI is easily the most effective MySQL manager and admin tool, mixing the characteristics of MySQL Query Browser, Administrator, phpMyAdmin and other MySQL Front Finishes and MySQL GUI tools in one intuitive interface.