zoukankan      html  css  js  c++  java
  • Oracle 对表的基本CURD操作!

    Oracle对表的基本Curd操作:

    样式表:接下来对这张(表明:Stud)表进行Curd操作(请看面SQL代码)

        

    1):增加新的字段列:

    alter table Stud add(height varchar2(100))       
    --解释:alter table 表名称 add(字段名 字段类型  默认值 是否为空);--此出的默认值 是否为空可省略不写        关键字:add

     

    2):修改字段的类型:

    alter table Stud modify(height number(4))     
    --解释:alter table 表名称 modify (字段名 字段类型  默认值 是否为空);--此出的默认值 是否为空可省略不写   关键字:modify

    3):修改字段名称:

    alter table Stud rename column height to gao  
    --解释: alter table 表名称 rename column 想要修改的列名称 to 列的新名称         关键字: rename column  * to *

    4):删除表中多余的列:

    alter table Stud drop column gao     
    --解释:alter table 表明称 drop column 不想要的列                             关键字:drop column

    5):修改表的的名称:

    alter table Stud rename to xuesheng (不会破坏表的结构和字段类型及其内容)    关键:注意表明称不要写反
    --解释:alter table 原表名称 rename to 改后的表明

    生在内卷,你卷我也卷。 愿与诸君共勉!
  • 相关阅读:
    【angularJS】启动(bootstrap)机制
    【angularJS】定义模块angular.module
    【angularJS】简介
    .NET AutoMapper学习记录
    WebAPI学习
    【MongoDB】在C#中使用
    RabbitMQ介绍及windows下安装使用
    【MongoDB】初识
    php命名空间(nameSpace)的使用详解
    魔术方法
  • 原文地址:https://www.cnblogs.com/superyonng/p/13268466.html
Copyright © 2011-2022 走看看