表管理
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;不可以恢复数据,删除速度快,不写日志
创建表: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;不可以恢复数据,删除速度快,不写日志
相关文章推荐
- 第四次上机实践项目-项目1-三角形类锥形-(2)
- C++作业2
- Yii CGridView 基本使用(三)关联表相关字段搜索
- 同意按钮,倒计时10秒,同意按钮变为可提交的
- Windows操作系统发展简史
- oracle终端基本命令
- Android之自定义属性
- asp+mysql__不同类型用户登录
- 第16课 位运算符分析
- js异步编程
- C#导出EXCEL的几种方法
- JSON的多样格式
- 单例设计模式
- mac 安装maven
- weka 基础
- 在Windows下使用类Linux terminal
- EditPlus使用技巧
- 总结几种log打印printf函数的宏定义
- BitmapData.draw 绘制透明区域
- objective-C学习笔记(十一)类别和扩展