I have a database in MySQL created by someone. I don't have any documentation of the database.
How can I know the relationship between the tables?
Is there any query or a procedure to generate a report so that it's easy to find the relations?
I can look into Schema information and manually figure it out, but it would be great if I could generate a relationship report.
Do you have the
SELECTs
that use the database? That may be the best source of the relationships.You may take a look at
information_scheme.KEY_COLUMN_USAGE
tableAs it is suggested there a quick way to list your FKs (Foreign Key references) using the KEY_COLUMN_USAGE view: