z
create table customer(
CMobile_no int ,
Customer_id int,
Customer_Address varchar(20),
Fname varchar(20),
Minit varchar(20),
Lname varchar(20),
Customer_id2 int,
constraint customer_pk
primary key (Customer_id2),
);
create table Buysfrom(
Cid int,
Bid int,
Hrs int,
CONSTRAINT buys_pk
primary key (Cid,Bid),
Constraint customer_Buys_pk
foreign key (Cid) references customer(Customer_id2),
constraint Branch_Buys_fk
foreign key (Bid)references Branch(Branch_id),
);
error is in customer_id2 in buys from
The error message is as follow:
foreign key customer buys pk referenced invalid coloumn customer_id2 in refrenced table customer
What I have tried:
change customer_id2 in table customer but it doesnot affect any thing