Unanswered: Insert a foreign key that doesn't exist yet
I just started with the databases, I a, trying to insert a value to a table that contains a foreign key.
however, that foreign key is still empty from it's source table, all the tables are empty right now :
create table department(
dnumber int primary key not null,
create table employee(
ssn bigint primary key not null,
foreign key (superssn) references employee(ssn),
foreign key (dno) references department(dnumber)
i am trying to insert the value "dno" that doesn't exist NOT YET
insert into employee(fname, minit, lname,ssn,bdate,address,sex,salary,superssn, dno)
values('john','B','smith',123456789, '1965/01/09', '731 Fondren, Houston, tx', 'M', 30000, 333445555, )
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.