0
点赞
收藏
分享

微信扫一扫

ARM中专用指令(异常向量表、异常源、异常返回等)

火热如冰 03-07 08:01 阅读 1

show databases;                                      查询所有数据库

select database();                                     查询当前数据库

use 数据库名;                                          使用数据库

creat database[if not exists] 数据库名 ;    创建

drop database[if exists] 数据库名;          删除数据库

schema可以替换database

-- 创建表
create table tb_user(
    id int primary key auto_increment comment 'ID',
    username  varchar(10) not null comment '用户名',
    age  int not null comment '用户年龄'
)comment '用户表';

约束

not null(非空约束)           限制该字段不能为空

unique(唯一约束)                 保证字段中的数据都是唯一的,不重复的

primary key(主键约束)    非空且唯一(auto_increment 让主键自动增长)

default (默认约束)             如果未指定该数值,则采用默认值

foreign key(外键约束)        让两张表的数据保持一致,保证数据的一致性和完整性

数据类型

 

举报

相关推荐

0 条评论