Hey guys. Can you have a look at my queries? I can't spot the error with my foreign key linking.
As of now, the table staff has already existed:
StaffID char(7)
Staff_Name varchar(50)
Position varchar(50)
And now I'm trying to create a new table called SalesInvoice:
create table SalesInvoice(
SalesInvoiceID char(7),
Sales_Person char(7),
primary key(SalesInvoiceID),
foreign key (Sales_Person) references staff(StaffID));
when I execute the query, it gives me Error 1005, I've looked around in google and this forum, it seems to be foreign key related?