数据定义语言:create(创建)、alter(更改)和drop(删除)命令。
1.建表
create table tb( country VARCHAR2(16) null, people NUMBER(8,2) default 0.00 not null)
2.修改列
alter table tb modify(people NUMBER(8) default 0 not null);
3.添加列
alter table tb add(name varchar2(20) null);
4.删除列
alter table tb drop column name;
5.删除表
drop table tb;
6.删除表中所有行(不可以回滚)
truncate table tb;
7.新建一个表
create table hon as select * from tb; //全有create table hong as select * from tb where 1=2; //只有表结构,没有数据
insert into tb values('中国',13.47);insert into tb values('美国',3.09);insert into tb values('俄国',1.43);insert into tb values('德国',0.82);insert into tb values('法国',0.64);insert into tb values('日本',1.27);insert into tb values('英国',0.62);insert into tb values('墨西哥',1.14);insert into tb values('印度',12.10);insert into tb values('加拿大',0.35);insert into tb values('澳大利亚',0.23);