MySQL数据库外键的相关知识详解

MySQL数据库外键的相关知识详解
复制Create table country(   country_id smallint unsigned not null auto_increment,数识详   country varchar(50) not null,   last_update timestamp not null,   primary key(country_id)   )engine=innoDB default charset=utf8;   Create table city(   city_id smallint unsigned not null auto_increment,   city varchar(50) not null,   country_id smallint unsigned not null,   last_update timestamp not null default current_timestamp on update curren_timestamp,   Primary key(city_id),   key idx_fk_country_id (country_id),   constraint fk_city_country Foreign Key(country_id) References country(country_id) on DELETE restrict ON update cascade   )engine=innoDB default charset=utf8;  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.
系统运维
上一篇:电脑开机显示停止错误屏幕的解决方法(解决电脑开机时出现停止错误屏幕的常见故障)
下一篇:电脑操作教程(以电脑为工具,详细教你制作系统U盘的方法)