Foreign key issue in mysql? -


lets employeeid acting primary key in 1 table in mysql database. how make employeeid act foreign key in table?

i think simple question answered oneself . let's have 'employee' table making employeeid primary key storing, updating , , deleting data 'employee' table . in case want provide salary employee , want store salary information in database , in case need 'salary' table , employeeid work foreign key

'employee' table  employeeid | employee_name| employee_birthdate| address  1          |  john due    | 1990-01-01        | dhaka  2          | rahim        | 1990-02-06        | feni,bangladesh  'salary' table  salaryid | employeeid(from 'employee' table | salary | date time 1        | 2                                | $5000  | 2017-04-01 2        | 2                                | $5000  | 2017-05-01 

i hope understand . if still seems dozy , feel free ask me anyway


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -