How to connect two attributes without a PK (MySQL)

by Squall32   Last Updated October 19, 2019 08:06 AM - source

im a new programer and im doing a data base on MySQL with phpmyadmin, and i have this doubt, i know that if you want to link two differente tables, you need an attribute that is a Primary Key, and another in the other table that is a Foreign Key, but in this particular case, i want to link a normal attribute from one table to another, something like this:

Table 1: id (PK), age, birthday, name, Charge;

Table 2: id( PK), department, name, Charge (Reference);

So i can, for example, introduce the "charge" value to the first table, and then, when i visit the table 2, it would have that value as it was a FK calling a PK, or in other case, a way where i can link the PK of the table 1 with the table 2, so i can bring any attribute to it that i want like this:

Table 1: id1 (PK), age, birthday, name, Charge;

Table 2: id2, id2 (FK), department, name, Charge (Reference);

Is there any way to make this?

Tags : mysql phpmyadmin

Related Questions

Count the same value from 2 tables

Updated May 20, 2015 03:02 AM