管理数据库
一:创建数据库 create database a;
二:查看数据库:show databases;
三:打开数据库:use a;
四:删除数据库:drop database a;
1.创建表
create table student
(sno char(11),
sname char(20),
sage int,
ssex char(2));
create table sc
(sno char(11) not null,
cname char(4)not null,
grade int);
2.修改表alter table 表名
(1)添加列
alter table student
add dno char(3);
(2)修改列
alter table student
modify sno char(11)not null;
(3)删除列
alter table student
drop column dno;
3.删除表
drop table sc;
4.查看
查看当前数据库下有哪些表:show tables;
查看表结构:desc student;