Question
I am trying to link the ID column from the Customer's table to C_ID in the Purchases table. I am still learning SQL so I have a light knowledge and am not sure why this error is occuring. If someone could offer up a solution and point where I've went wrong that would be great.
SQL Code
CREATE TABLE Customer (
ID INTEGER,
Firstname VARCHAR (15),
Lastname VARCHAR (15),
Address VARCHAR (254),
Postcode VARCHAR (8),
Email VARCHAR (254),
Phoneno INTEGER,
Points INTEGER,
PRIMARY KEY (ID)
);
CREATE TABLE Purchases (
C_ID INTEGER,
GameName VARCHAR(30),
ConsoleType VARCHAR (20),
Price VARCHAR (254),
PaymentType VARCHAR (20),
Date TIMESTAMP,
PointsGained INTEGER,
PRIMARY KEY (C_ID),
FOREIGN KEY (ID) REFERENCES Customer(ID)
);