Friday, March 30, 2012

i had a problem in inserting data in a table with foriegn key

i hav following 2 tables n i am able to insert data into the second table having a foriegn key

create table Customer_Details(
Customer_ID integer primary key,
Customer_First_Name varchar(75),
Customer_Last_Name varchar(75),
Address varchar(100))

create table Account_Details(
Account_No integer primary key,
Customer_ID integer foreign key references
Customer_Details(Customer_ID),
Debit float,Credit float,Balance float )hi
can u please put ur insert and also when a column is PK it cant be null. when u do not put any think then that means it also can be a null value but pk can't be null at all.

No comments:

Post a Comment