OCP 1Z0 051 27

来源:互联网 发布:gta5视角软件 编辑:程序博客网 时间:2024/05/22 06:58
27. Which two statements are true regarding tables? (Choose two.) 
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. 

A. 字段名不能超过30(lengthb函数返回结果,与字符集有关)
B.列不是无限
SQL> DROP TABLE t1 PURGE;Table droppedSQL> CREATE TABLE t1(t0 INT);Table createdSQL> DECLARE  2    v_sql VARCHAR2(4000);  3  BEGIN  4    FOR i IN 1 .. 10000 LOOP  5      v_sql := 'alter table t1 add t' || to_char(i) || ' int';  6      EXECUTE IMMEDIATE v_sql;  7    END LOOP;  8  EXCEPTION  9    WHEN OTHERS THEN 10      NULL; 11  END; 12  /PL/SQL procedure successfully completedExecuted in 277.031 secondsSQL> SELECT COUNT(*) FROM User_Tab_Cols WHERE table_name = UPPER('t1');  COUNT(*)----------      10001 row selectedSQL> alter table t1 add  t1002 int;alter table t1 add  t1002 intORA-01792: 表或视图中的最大列数为 1000


C.默认值与not null是两加事儿。
SQL> drop table t2 purge;drop table t2 purgeORA-00942: 表或视图不存在SQL> create table t2(df int default 1);Table createdSQL> insert into t2 values(null);1 row insertedSQL> insert into t2 values(1);1 row insertedSQL> col df form 9999;SQL> select rownum,df from t2;    ROWNUM   DF---------- ----         1          2    12 rows selected


d 错

SQL> create or replace view t2 as select * from t2;create or replace view t2 as select * from t2ORA-00955: 名称已由现有对象使用

e 错

SQL> create or replace synonym t2 for t2;create or replace synonym t2 for t2ORA-01471: 无法创建与对象同名的同义词


Answer: F 
0 0
原创粉丝点击