-- below 2 tables will be used in all the examples to understand or create the proof of concepts
create table customers_t ( cid int primary key ,vname varchar(30));
GO
create table orders_t( oid int primary key ,cid int foreign key
references customers_t(cid) ,oname varchar(30));
GO
insert into customers_t select 1,'A';
insert into customers_t select 2,'B';
insert into customers_t select 3,'C';
insert into orders_t select 1,1,'O-1';
insert into orders_t select 2, NULL,'0-2';
insert into orders_t select 3,NULL,'0-3';
create table customers_t ( cid int primary key ,vname varchar(30));
GO
create table orders_t( oid int primary key ,cid int foreign key
references customers_t(cid) ,oname varchar(30));
GO
insert into customers_t select 1,'A';
insert into customers_t select 2,'B';
insert into customers_t select 3,'C';
insert into orders_t select 1,1,'O-1';
insert into orders_t select 2, NULL,'0-2';
insert into orders_t select 3,NULL,'0-3';
No comments:
Post a Comment