--查看表的结构
select a.column_name 字段名,
a.data_type 数据类型,
a.data_length 长度,
a.data_precision整数位,
a.data_scale 小数位,
a.nullable 允许空值,
a.data_default 缺省值,
b.comments 备注
from user_tab_columns a, user_col_comments b
where a.column_name = b.column_name
and a.table_name = b.table_name
and a.table_name = upper('emps');
--查看列的注释
select * from user_col_comments wheretable_name = upper('emps');
--查看表的注释
select * from user_tab_comments wheretable_name = upper('emps');
--查看表的约束
select * from user_constraints where table_name = upper('emps');
--查看索引
create unique index idx_unique_ename on emps(name);
select * from user_indexes where table_name= upper('emps');