欢迎光临重庆协创IT国际认证中心!

收藏本站 .网站地图 .联系我们

20年认证人才培训品牌

咨询热线:

023-65111115
023-65111116
  • 重庆协创教育
  • 协创教育_IT培训
  • 协创教育_国际认证
  • previous
  • next
您所在的位置:首页 > 文章集萃

Oracle数据定义语言和数据操纵语言

2014-12-12
投稿人:admin

  重庆协创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;


您的评论

评论者: 请填写您的姓名,方便我们联系您
评论内容:
请填写您的评论内容, 内容不能超过200字哟!有您的支持,是我们不断前进的动力,感谢您的支持!
  
相关评论更多
Copyright: Chongqing Co-Founder of Network Technology Education Center (c) 2005-2021 All Rights
版权所有:重庆协创IT国际认证中心(c)2005-2011 All Rights 网站备案号:渝ICP备17014127号-1
地址:重庆市沙坪坝区小龙坎新街86号嘉多利广场11-7     联系电话:023-65111115   023-65111116
站长统计 技术支持:重庆网络推广专家