I have two tables one tbl_demographics with coluimns [staffid, natid] and another tbl_nationality with columns [natid, description].
HR sends me staff data in excel with the staffid and nationality which I upload as it is. Only problem is the nationality column contains data such as Canadian instead of (CAN) or Nigerian instead of (NGA).
How do i write a script in sql (or php even) that can update all the natid in tbl_demographics into data that is corresponding the correct natid in tbl_nationality? I'm using mysql server (and php if necessary).
The data they send:
staffid | natid
201001 | Canadian
202332 | Nigerian
Expected tables look:
staffid | natid (tbl_demographics)
201001 | CAN
202332 | NGA
natid | description (tbl_nationality)
CAN | Canada
NGA | Nigeria