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

  

转载于:https://www.cnblogs.com/zhangyuanbo12358/p/8027879.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值