mysql1
数据库的创建
create database test;
数据表的创建
create table test
(
code varchar(20),
name varchar(20)
);
删除数据库
drop database test;
删除表
drop table test;
关键字:
create table test1
(
code varchar(20) primary key, #primary key 为主键
name varchar(20) not null #not null 为此列非空
);
create table zhu
(
code int primary key,
name varchar(20)
);
create table cong
(
code int primary key,
name varchar(20),
zhu int,
foreign key (zhu) references zhu(code) #外键
);
create table haoyou
(
ids int auto_increment primary key, #自增长列
me varchar(20),
friends varchar(20)
);