首页 > 代码库 > 一则 Mysql 建表语句

一则 Mysql 建表语句

 1 DROP TABLE IF EXISTS `nuvue`; 2  3 CREATE TABLE `nuvue`( 4     `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, 5     `status` TINYINT(2) UNSIGNED NOT NULL DEFAULT 0 COMMENT 状态, 6     `uid` INT(10) UNSIGNED NOT NULL COMMENT 创建用户, 7     `province_id` TINYINT(3)  UNSIGNED NOT NULL COMMENT 一级城市, 8     `city_id` TINYINT(3)  UNSIGNED NOT NULL COMMENT 二级地区, 9     `name` VARCHAR(100) NOT NULL COMMENT 场地名称,10     `logo_url` VARCHAR(100) NOT NULL COMMENT 场地Logo,11     `location_address` VARCHAR(200) NOT NULL COMMENT 场地地址,12     `location_point` VARCHAR(30) NOT NULL COMMENT 场地坐标,13     `caoncat_phone` VARCHAR(20) NOT NULL COMMENT 联系人电话,14     `type` ENUM(livehouse,theare,bar,bookshop,other) NOT NULL COMMENT 场地类型,15     `phone` VARCHAR(20) NOT NULL COMMENT 场地电话,16     `area` VARCHAR(10) NOT NULL COMMENT 场地面积,17     `people` VARCHAR(10) NOT NULL COMMENT 容纳人数,18     `device` VARCHAR(100) NOT NULL DEFAULT ‘‘ COMMENT 场地设备,19     `introduction` VARCHAR(100) NOT NULL DEFAULT ‘‘ COMMENT 场地简介,20     `create_at` DATETIME NOT NULL COMMENT 创建时间,21     PRIMARY KEY `id`(`id`),22     UNIQUE KEY `name`(`name`),23     KEY `idx_type`(`type`),24     KEY `idx_uid`(`uid`),25     KEY `idx_status`(`status`),26     KEY `idx_location`(`province_id`,`city_id`)27 )ENGINE= Myisam DEFAULT CHARSET = utf8;

 

一则 Mysql 建表语句