drop table test1; drop table test; create table test(id integer primary key, name varchar(30)); create table test1(id integer, address varchar(30), phone varchar(30), FOREIGN KEY (id) REFERENCES test(id)); insert into test values(1, 'name1'); insert into test1 values(1, 'a', 'a' ); insert into test values(2, 'name2'); insert into test1 values(1, 'b', 'b'); insert into test1 values(2, 'b', 'b'); insert into test values(3, 'name3'); insert into test1 values(3, 'c', 'c'); select * from test; select * from test1; 本文出自 51CTO.COM技术博客 |