Check out example codes for "add a column with foreign key psql". It will help you in understanding the concepts better.

Code Example 1

alter table links_chatpicmessage 
      add column sender integer, 
      add constraint fk_test 
      foreign key (sender) 
      references auth_user (id);

Learn ReactJs, React Native from akashmittal.com