Home » RDBMS Server » Server Administration » Question from OCP Dumps-Identifying constraint type in dba_constraints
Question from OCP Dumps-Identifying constraint type in dba_constraints [message #151286] Wed, 14 December 2005 01:48 Go to next message
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 #151325 is a reply to message #151286] Wed, 14 December 2005 04:42 Go to previous messageGo to next message
vjeedigunta
Messages: 201
Registered: March 2005
Location: Hyderabad
Senior Member

Reena,
I blv you can check both A & C in this case ..
I dont think there is a way to check apart from using search_condition ..

-Sai Jeedigunta
Re: Question from OCP Dumps-Identifying constraint type in dba_constraints [message #151330 is a reply to message #151325] Wed, 14 December 2005 05:38 Go to previous messageGo to next message
reena_ch30
Messages: 100
Registered: December 2005
Senior Member
The question says "select one"

Regards,
reena
Re: Question from OCP Dumps-Identifying constraint type in dba_constraints [message #151331 is a reply to message #151330] Wed, 14 December 2005 05:41 Go to previous messageGo to next message
vjeedigunta
Messages: 201
Registered: March 2005
Location: Hyderabad
Senior Member

Depending on the naming convention EMP_JOB_NN I will pick not null .. Smile

-Sai Jeedigunta


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 Go to previous messageGo to next message
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

Re: Question from OCP Dumps-Identifying constraint type in dba_constraints [message #152264 is a reply to message #151286] Thu, 22 December 2005 00:47 Go to previous message
manishora
Messages: 3
Registered: December 2005
Location: indian
Junior Member
Hi!

If you have ocp dump please forward me to mitraforever@rediffmail.com

Thanks
Previous Topic: install client on remote desktop
Next Topic: ORA Error::::ORA00020 Urgent Please help
Goto Forum:
  


Current Time: Sun Jan 26 13:14:30 CST 2025