Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Oracle Certified Professional Exams (OCP & OCA) >> Question about count distinct (Q116 in TK) 1Z0-007

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Question about count distinct (Q116 in TK) 1Z0-007
 ozkucur  Posted: Nov 07, 2006 05:08:06 AM

 Total Post: 23
 Joined: Oct, 2006






 The CUSTOMERS table has these columns:
CUSTOMER_ID
CUSTOMER_NAME
STREET_ADDRESS
CITY_ADDRESS
NUMBER (4)
VARCHAR2 (100)
VARCHAR2 (150)
VARHCAR2 (50)
NOT NULL
NOT NULL

STATE_ADDRESS VARCHAR2 (50)
PROVINCE_ADDRESS VARCHAR2 (50)
COUNTRY_ADDRESS VARCHAR2 (50)
POSTAL_CODE VARCHAR2 (12)
CUSTOMER_PHONE VARCHAR2 (20)

The CUSTOMER_ID column is the primary key for the table.


You need to determine how dispersed your customer base is.
Which expression finds the number of different countries represented in the
CUSTOMERS table?

A)COUNT(UPPER(country_address))
B)COUNT(DIFF(UPPER(country_address)))
C)COUNT(UNIQUE(UPPER(country_address)))
D)COUNT DISTINTC UPPER(country_address)
E)COUNT(DISTINTC (UPPER(country_address)))

ANSWER: TK says E
IMO: C

It is obvious that the DISCTINCT keyword mistyped in the D and E options. I don't know if it is intentionally done or the guy who braindumped the question just mistyped it.

Apart from that, although it is not mentioned in the (my) SQL books, I have surprisingly realised that, one use the UNIQUE keyword can be used instead of the DISTINCT keyword in count function. And it produces the same result.

E.g.:
The following two statements produced the same result in the HR schema

select count(DISTINCT(UPPER(last_name))) from employees

select count(UNQIUE(UPPER(last_name))) from employees

Any comments?

 snehalatha
Posted: Nov 07, 2006 05:29:36 AM  

 Total Post: 169
 Joined: Apr, 2006






 
C is CORRECT ANSWER.

UNIQUE will generate the same result as DISTINCT.



 ozkucur
Posted: Nov 07, 2006 05:32:17 AM  

 Total Post: 23
 Joined: Oct, 2006






 
Thanks snehalatha.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar814
  Mohammed Taj694
  Jayanta Sur479
  Vigyan Kaushik386
  positive fanatic361
  Gitesh Trivedi322
  Gopu Gopi239
  neeraj sharma228
  Ramesh Jois226
  snehalatha p169






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software