Hello!
Is there a SQL command to show relationship between tables in selected database?
Something like DESCRIBE.
Regards
How can I see relantionship in database.
Moderator: General Moderators
Re: How can I see relantionship in database.
What database engine are you using? As far as I know, MySQL database engines do not store relationships, they are only established in SQL queries.tua1 wrote:Hello!
Is there a SQL command to show relationship between tables in selected database?
Something like DESCRIBE.
Regards
Re: How can I see relantionship in database.
MySQL InnoDB does.califdon wrote:As far as I know, MySQL database engines do not store relationships, they are only established in SQL queries.
http://dev.mysql.com/doc/refman/5.0/en/ ... aints.html
If it is MySQL (InnoDB) you could use:
[sql]SHOW CREATE TABLE tbl_name;[/sql]
There are 10 types of people in this world, those who understand binary and those who don't
Re: How can I see relantionship in database.
Thanks, Vlad. I was thinking that maybe it did, but was too lazy to look it up. I stick with MyISAM because I haven't needed the features of InnoDB.VladSun wrote:MySQL InnoDB does.califdon wrote:As far as I know, MySQL database engines do not store relationships, they are only established in SQL queries.
http://dev.mysql.com/doc/refman/5.0/en/ ... aints.html
If it is MySQL (InnoDB) you could use:
[sql]SHOW CREATE TABLE tbl_name;[/sql]
Re: How can I see relantionship in database.
More people should use MySQL Workbench. It's actually really good these days. Even the free version.
Re: How can I see relantionship in database.
thanks for the replys.