zoukankan      html  css  js  c++  java
  • OCP/OCA Oracle 学习001

    select * from TEST3 t
    
    
    select object_type, count(object_type)
    from user_objects
    group by object_type
    order by object_type
    
    
    
    select table_name from dba_tables where lower(table_name) = 'tf_dev'
    
    
    
    --7-1 确定会话可以访问那些对象。
    -- 7-1-1 确定模式中各种类型的对象 列出所有对象
    select object_type, count(object_type)
    from user_objects
    group by object_type
    
    --7-1-2 确定有权访问的总数
    select object_type, count(object_type)
    from all_objects
    group by object_type
    
    --7-1-3 确定谁拥有当前登录人能够看到的对象
    select distinct owner from all_objects
    
    -----------------------------------------------------
    
    --显示表中的数据类型
    describe test3;
    
    --  user_tab_cols用来获取对应用户表的列信息;
    -- user_col_comments用来获取对应用户表列的注释信息;
    --  user_constraints用来获取用户表的约束条件;
    --  user_cons_columns约束中用户可访问列。
    
    select column_name,
    data_type,
    nullable,
    data_length,
    data_precision,
    data_scale
    from user_tab_columns
    where table_name = 'TF_DEV'
    
    select trunc(sysdate) from dual
    
    --创建表
    create table tf_dev_copy as select * from tf_dev
    
    --创建表结构
    create table tf_dev_copy2 as select * from tf_dev where 1=2
    
    select * from tf_dev_copy where rownum<10
    
    select * from test3
    --新怎列
    alter table test3 add(id number)
    
    --修改列
    alter table test3 modify(num default 0)
    
    --删除列
    alter table test3 drop column id
    
    --蒋列标记为未使用
    alter table test3 set unused column id
    alter table test3 drop unused columns
    
    --重命名列名
    alter table test3 rename column num to tnum
    
    --删除表
    drop table test3
    

      

  • 相关阅读:
    HTML基础知识笔记摘要
    Shiro安全框架的说明及配置入门
    空指针问题的解决
    Log4j的配置及使用
    有关于注解的说明
    SpringMVC整合mybatis基于纯注解配置
    使用springmvc进行文件的上传和下载
    数据库设计入门及ERMaster的安装和使用
    spring mvc 接收ajax 复杂结构数据
    idea git ignore 插件
  • 原文地址:https://www.cnblogs.com/zhangyuanbo12358/p/8027879.html
Copyright © 2011-2022 走看看