Search code examples
heidisql

Relationships between tables without foreign key in database in heidisql


I am looking at one database, which somebody else created, and I am trying to find relationship between tables. But those tables have only keys (indexes), and some of them have primary key too. There is not a single foreign key. I would like to figure out how these tables are connected to each other, but I do not know how to do It here ? I would like to request as simple as possible explanation, as I am not very good in this area.

Any suggestion ?


Solution

  • If there are no foreign keys defined, there is no link between tables. You'll have to find out the relationships via the table and column names.

    Because foreign key constraints are not being enforced right now, there is a chance that adding them is not possible if the data is not consistent.

    Adding foreign keys with HeidiSQL is simple and fast. Also, when you have edit a foreign key value in a data grid, HeidiSQL shows a dropdown with the first text field that it finds in the linked table. Nice feature.