设为首页 加入收藏 联系我们
+  最新公告
+ 更多  
导航分类  
数据正在添加中!

厂商认证
·微软MCP考试信息
·致已购买非正常渠道思科折扣号的
·关于对微软考生身份证件的政策
·7月1日起微软将不再免费寄发纸
·ITIL 考后证书需重新申请
·重庆协创思科授权培训中心(重庆
·证书丢了怎么办
文章集萃
 
Oracle数据定义语言和数据操纵语言
  发布者: 发布时间:2014/12/12 18:08:54 阅读:1141次 【字体:

  重庆协创Oracle培训中心与您分享数据定义语言和数据操纵语言。

  一、数据定义语言

  操作表的命令:

  create table、alter table、truncate table、drop table。

  修改表的命令:

  alter table stu_table rename to stu_tbl;——修改表名

  alter table stu_tbl rename column stu_sextosex;——修改列名

  alter table stu_tbl modify(stu_name varchar2(2));——更改列的数据类型

  alter table stu_tbl add(stu_name number);——添加新列

  alter table stu_tbl drop(age);——删除列

  alter table stu_tbl add constraint pk_stu_tbl primary key(id);——添加约束

  二、数据操纵语言

  select,update,delete,insert。

  利用现有的表创建表

  create table stu_tbl_log as select id,stu_name,stu_age from stu_tbl;——选择无重复的行

  select distinct stu_name from stu_tbl;——插入来自其他表中的记录

  insert into stu_tbl_log select id,stu_name,stu_age from stu_tbl;