0

I have three tables in my database named "applicant_info", "application_info", "education". I want to make a foreign key relationship from columns in "application_info" named "PassPortNo" and "Nationality" to the same columns in "applicant_info" table that are primary keys. Those columns are indexed in the child table i.e application_info. And all the tables are of type "InnoDB".When I try to construct the relationship in relation view tab "PassPortNo" and "Nationality" from Applicant_Info table are not coming in the drop box. How can I do that?

Indexes on the applicant_info table index on applicant_info

Indexes on the application_info table index on the application_info table

This is the relation view tab that I constructed the relationship with. On the dropdown that says "Table" I couldn't find table named "Applicant_info". Does this mean I cannot construct such a relationship with columns that are primary keys? enter image description here

Samuel Mideksa
  • 423
  • 8
  • 19
  • Did you try to see if there are any errors? You can use the following command to see if there are any errors generated, "SHOW ENGINE INNODB STATUS;" Then check in the LATEST FOREIGN KEY ERROR section. Maybe the following article would give you some helpful information. https://stackoverflow.com/questions/15534977/mysql-cannot-add-foreign-key-constraint – hel Feb 13 '20 at 11:04
  • I am seeing InnoDB ================== no errors but how can I view the table structure and the relationships in graph in phpmyadmin and make sure that everything worked fine? – Samuel Mideksa Feb 13 '20 at 11:21
  • Please [use text, not images/links, for text--including tables & ERDs](https://meta.stackoverflow.com/q/285551/3404097). Use images only for what cannot be expressed as text or to augment text. Images cannot be searched for or cut & pasted. Include a legend/key & explanation with an image. – philipxy Feb 13 '20 at 20:19
  • Through this information, you have given in the question its hard to determine what the exact cause of the issue could be. I understand you have mentioned all database tables are of type INNODB. If any of the tables are of a different storage engine, it will not appear as an option in the list of tables. You can check this under "applicant_info" table details > Operations tab > Table Options > storage engine. If you find the answer to this please share it, as it is quite interesting to know. – hel Feb 14 '20 at 08:28

0 Answers0