我是新蜂我在使用sql server 2000之前我的问题是在sql server 2000中创建两个表时说位置和项目表项目有一个外键引用位置表时在项目中插入值也更新了这是不需要的在项目表中的外键中插入类似的值为什么我在mysql中使用insert命令在位置插入值时不可能,当在项目上使用select命令时它不显示外键中的值请检查下面的代码
mysql> create table location(
-> id int not null,
-> primary key(id))
-> engine=innodb;
Query OK, 0 rows affected (0.11 sec)
mysql> create table projects(
-> id int,
-> location_id int,
-> foreign key(location_id) references location(id) on update cascade on del
ete cascade)
-> engine=innodb;
Query OK, 0 rows affected (0.31 sec)
mysql> insert into location values('1')
Query OK, 1 row affected (0.34 sec)
mysql> select * from location;
+----+
| id |
+----+
| …Run Code Online (Sandbox Code Playgroud)