Check out example codes for "data type for foreign key". It will help you in understanding the concepts better.

Code Example 1

CREATE TABLE Orders
(

   
OrderID int NOT NULL,

   
OrderNumber int NOT NULL,

   
PersonID int,

   
PRIMARY KEY (OrderID),

   
CONSTRAINT FK_PersonOrder FOREIGN KEY (PersonID)

   
REFERENCES Persons(PersonID)

);

Learn ReactJs, React Native from akashmittal.com