Mysql ---3

1.创建表:注意:` `  '  '   ,  三种符号   if not exists    primary key(`id`)engine= innodb    charset=utf8

    create table if not exists `stu`

                `id` int(4) auto_increment  comment '学号',

                `name` varchar(20) not null default '名字' comment '姓名',

                `sex`  varchar(2) default null comment '性别',

                primary key(`id`)

                )engine=innodb default charset=utf8

2.show create database 库名   数据库结构

 show create table 表名  表结构

 desc  student   表字段

3.数据库引擎InnoDB支持事务、外键约束   Myisam

猜你喜欢

转载自www.cnblogs.com/chencn/p/12299125.html