Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table relations in Navicat

How do I add table relations in Navicat without using SQL queries? Is there some kind of wizard or helper to do this?

like image 978
steavy Avatar asked Dec 28 '22 04:12

steavy


2 Answers

You can also use er Diagram view

  1. Select database and use it

  2. Click view from menu, then select er Diagram now you can see every table you made

  3. press R so you change select kursor to mode relation

  4. click and drag field (foreign key) from your table to table that reference

like image 22
Hans Avatar answered Jan 15 '23 15:01

Hans


  1. Select the table, right click then select Design Table

  2. First go to the Options tab and ensure that your Engine is InnoDB which supports foreign key relationships

  3. Then go to the Foreign keys tab.

  4. Once you add one foreign key save it, so that you resolve any issues that may stop it from being created

like image 130
Stephen Senkomago Musoke Avatar answered Jan 15 '23 15:01

Stephen Senkomago Musoke