您的位置:首页 > 其它

表管理

2016-03-26 20:35 330 查看
查看表结构:desc   tablename

创建表:create table student(xh number(4) primary key,xm varchar2(20),sex char(2),birthday date,jxj number(7,2));

添加字段:alter table student add(classid number(2));

修改字段长度:alter table student modify(xm varchar2(30));

删除字段:alter table student drop column jxj;

修改表名字:alter table to stu;

删除表:drop table student;

修改日期格式:alter session set nls_date_format='yyyy-mm-dd';

删除表数据:delete form student;(删除速度慢,因为要写日志,还可以恢复数据)
设置保存点:savepoint a;
回滚到保存点:rollback to a;

删除表数据:truncate table student;不可以恢复数据,删除速度快,不写日志
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: