Oracle Database 12c: SQL Fundamentals — Question 34
The CUSTOMERS table has these columns:
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?
Answer options
- A. COUNT(UPPER(country_address))
- B. COUNT(DIFF(UPPER(country_address)))
- C. COUNT(UNIQUE(UPPER(country_address)))
- D. COUNT DISTINCT UPPER(country_address)
- E. COUNT(DISTINCT (UPPER(country_address)))
Correct answer: E
Explanation
The correct answer, E, utilizes the COUNT function with DISTINCT to count unique values of countries in uppercase format. Options A, B, and C are incorrect because they either do not correctly count unique values or use invalid SQL syntax. Option D is close but incorrectly formats the COUNT DISTINCT syntax.