Home > Database > Mysql Tutorial > body text

省市县三级联动的SQL语句

WBOY
Release: 2016-06-07 14:57:53
Original
2690 people have browsed it

省市县三级联动的SQL语句 无 CREATE TABLE `t_address_province` (`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',`code` CHAR(6) NOT NULL COMMENT '省份编码',`name` VARCHAR(40) NOT NULL COMMENT '省份名称') ENGINE=InnoDB DEFAULT CHARSET=UTF8 C

省市县三级联动的SQL语句
CREATE TABLE `t_address_province` (

`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',

`code` CHAR(6) NOT NULL COMMENT '省份编码',

`name` VARCHAR(40) NOT NULL COMMENT '省份名称'

) ENGINE=InnoDB DEFAULT CHARSET=UTF8 COMMENT='省份信息表';

CREATE TABLE `t_address_city` (

`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',

`code` CHAR(6) NOT NULL COMMENT '城市编码',

`name` VARCHAR(40) NOT NULL COMMENT '城市名称',

`provinceCode` CHAR(6) NOT NULL COMMENT '所属省份编码'

) ENGINE=InnoDB DEFAULT CHARSET=UTF8 COMMENT='城市信息表';

CREATE TABLE `t_address_town` (

`id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '主键',

`code` CHAR(6) NOT NULL COMMENT '区县编码',

`name` VARCHAR(40) NOT NULL COMMENT '区县名称',

`cityCode` CHAR(6) NOT NULL COMMENT '所属城市编码'

) ENGINE=InnoDB DEFAULT CHARSET=UTF8 COMMENT='区县信息表'; 
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template