您的位置:首页 > 产品设计 > UI/UE

27.Which two statements are true regarding tables?

2015-12-17 11:31 519 查看
27.Which two statements are true regarding tables?

A.A table name can be of any length.

B.A table can have any number of columns.

C.A column that has a DEFAULT value cannot store null values.

D.A table and a view can have the same name in the same schema.

E.A table and a synonym can have the same name in the same schema.

F.The same table name can be used in different schemas in the same database.

答案:如果必须选择两个的话那就EF

解析:

A:表名只能30个字符

B:列最大1000个

drop table test purge;
create table test (a0 number);
declare
v_sql varchar(100);
v_col varchar2(5);
begin
for i in 1 .. 10000 loop
v_col := 'a'||to_char(i);
v_sql := 'alter table test add( '||v_col||' char(1))';
execute immediate v_sql;
end loop;
exception
when others then
dbms_output.put_line(sqlerrm);
end;
输出:ORA-01792: 表或视图中的最大列数为 1000

select count(*) from user_tab_columns where table_name='TEST';

输出:1000

C:列可不可以存储null与默认值没有关系,与not null 约束有关系

D:表和视图不能相同的名字在同一个schema

create table test (a number);
create view test as select * from tab;
提示:ORA-00955: 名称已由现有对象使用

--那么临时表是否可以与视图同名

create global temporary table test1(a number) on commit delete rows;
create view test1 as select * from tab;
提示:ORA-00955: 名称已由现有对象使用

E:public 同义词可以和表同名

create table test (a number);
create synonym test for tab;
提示:ORA-00955: 名称已由现有对象使用

--创建public 同义词

create public synonym test for tab;
--这里成功了,所以如果是同名的话只能是public 同义词

F:正确
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: