数据库
什么是数据库 存储数据的仓库,本质上是一套CS结构的软件程序,分为客户端和服务器, 我们通常说安装数据,装的其实是服务器
库的语句
create database
drop database
alter database
show databases
show create database
表的语句
create table
drop table
alter table add|modify|drop |change
show tables
show create table
desc 表名
rename table a to b
记录的操作
insert into
delete from table
truncate table
update 表名 set xx = xx
select * from 表名
数据类型
int float
char varchar text blob enum set
year date time datetime timestamp
约束
unsigned
unique
not null
null
default
primary key auto_increment
foreign key
添加数据补充:
将一个查询结果插入到另一张表中
create table student(name char(10),gender int);
insert into student values("