zoukankan      html  css  js  c++  java
  • DDL语言的学习

    一、DDL语言的学习
       1.create关键字,用来创建表结构
        /*格式如下:
          create table tname(
          colName dataType,
          colName dataType,
          ………………
          colName dataType
          );
        */
      2:alter,用来修改表结构
         1)增加表的字段
          --格式: alter table tname add (colName dataType);
          --练习:为表temp_1增加个字段 tage 类型为number,长度为2
            alter table temp_1 add (tage number(2));
          2)删除表的字段
          -- 格式: alter table tname drop column colName
          -- 练习:删除temp_1表中的tage
            alter table temp_1 drop column tage;
         3)修改字段的名称
          -- 格式: alter table tname rename column oldName to newName
          -- 练习:将表temp_1的tname修改成name
          alter table temp_1 rename column tname to name;
         4)修改字段的数据类型
          -- 格式:alter table tname modify colName dataType
          -- 练习:修改temp_1表中的name 为varchar2(30);
          alter table temp_1 modify name varchar2(30);
        5)修改表名
          -- 格式:rename oldTname to newTname
          -- 练习:修改temp_1为temp_2;
          rename temp_1 to temp_2;
         6)删除表结构
          -- 格式:drop table tname;
          -- 练习:将temp_2删除
          drop table temp_2;
        7)查看表结构
        -- 格式: desc tname;
        -- 练习:创建temp_1,查看表结构
        desc temp_1;
     


  • 相关阅读:
    ueditor富文本编辑在 asp.net MVC下使用步骤
    C#中Socket用法,多个聊天和单一聊天。
    事件与委托的联系和区别
    异步调用backgroudworker
    C#事件作用和用法
    如何遍历protected object转化为数组
    获取后台用户 token 的方法
    Magento2 中如何使用curl
    curl 错误排查方法
    Magento 2 REST API入门
  • 原文地址:https://www.cnblogs.com/xiaozelulu/p/8835761.html
Copyright © 2011-2022 走看看