Question from OCP Dumps-Identifying constraint type in dba_constraints [message #151286] |
Wed, 14 December 2005 01:48 |
reena_ch30
Messages: 100 Registered: December 2005
|
Senior Member |
|
|
Hi,
I have one question from the OCP dumps(1Z0-031paper)
SQL> select constraint_name, constraint_type, deferrable,
2> deferred, validated
3> from dba_constraints
4> where owner = 'HR' and table_name='EMPLOYEES';
CONSTRAINT_NAME C DEFERRABLE DEFERRED VALIDATED
--------------------- -------------- ----------- --------------
EMP_DEPT_FK R NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_EMAIL_NV C NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_EMAIL_UK U NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_EMP_ID_PK P NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_HIRE_DATE_NN C NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_JOB_FK R NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_JOB_NN C DEFERRABLE DEFERRED NOT VALIDATED
EMP_LAST_NAME_NN C NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_MANAGER_FK R NOT DEFERRABLE IMMEDIATE VALIDATED
EMP_SALARY_MIN C NOT DEFERRABLE IMMEDIATE VALIDATED
Which type of constraint is EMP_JOB_NN?
A. Check
B. Unique
C. Not null
D. Primary key
E. Foreign key
what is the answer.. A or C??Constraint type 'C' is for both "not null" and "check " constraints.Then how to distingush between not null and check constraint in dba_constraints without using search condition column??Please help.
Regards,
reena.
|
|
|
|
|
|
Re: Question from OCP Dumps-Identifying constraint type in dba_constraints [message #151336 is a reply to message #151331] |
Wed, 14 December 2005 06:23 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
I would rather pick option A.
As i remember NOT NULL constraints comes under CHECK constraint category.
SQL> create table t1 (
2 n1 number(6) not null );
Table created.
SQL> desc t1
Name Null? Type
----------------------------------------- -------- ----------------------------
N1 NOT NULL NUMBER(6)
SQL> select constraint_name,constraint_type,
2 search_condition
3 from user_constraints
4 where table_name = 'T1';
CONSTRAINT_NAME CONS SEARCH_CONDITION
------------------------------ ---- --------------------
SYS_C006608 C "N1" IS NOT NULL
Can have a look here
[Updated on: Wed, 14 December 2005 06:24] Report message to a moderator
|
|
|
|