Home
Multichoice
Questions & answers
Interview
Questions & answers
  • Home
  • Database
  • Oracle Database 11g Administrator Certified Associate (OCA)
11.
You want to display each project's start date as the day, week, number, and year. Which statement will give output like the following?
Tuesday Week 23, 2008
  • [A]
    SELECT proj_id, TO_CHAR(start_date, 'DOW Week WOY YYYY') FROM projects;
  • [B]
    SELECT proj_id, TO_CHAR(start_date,'Day'||' Week'||' WOY, YYYY') FROM projects;
  • [C]
    SELECT proj_id, TO_CHAR(start_date, 'Day" Week" WW, YYYY') FROM projects;
  • [D]
    SELECT proj_id, TO_CHAR(start_date, 'Day Week# , YYYY') FROM projects;
  • [E]
    You can't calculate week numbers with Oracle.
  • Answer & Explanation
  • Report
Answer : [C]
Explanation :
Double quotation marks must surround literal strings like "Week".
Report
Name Email  
12.
What will the following statement return?
SELECT last_name, first_name, start_date
FROM employees
WHERE hire_date < TRUNC(SYSDATE) – 5;
  • [A]
    Employees hired within the past five hours
  • [B]
    Employees hired within the past five days
  • [C]
    Employees hired more than five hours ago
  • [D]
    Employees hired more than five days ago
  • Answer & Explanation
  • Report
Answer : [D]
Explanation :
The TRUNC function removes the time portion of a date by default, and whole numbers added to or subtracted from dates represent days added or subtracted from that date. TRUNC(SYSDATE) –5 means five days ago at midnight.
Report
Name Email  
13.
Which assertion about the following statements is most true?
SELECT name, region_code||phone_number
FROM customers;
SELECT name, CONCAT(region_code,phone_number)
FROM customers;
  • [A]
    If REGION_CODE is NULL, the first statement will not include that customer's PHONE_ NUMBER.
  • [B]
    If REGION_CODE is NULL, the second statement will not include that customer's PHONE_ NUMBER.
  • [C]
    Both statements will return the same data.
  • [D]
    The second statement will raise an error if REGION_CODE is NULL for any customer.
  • Answer & Explanation
  • Report
Answer : [C]
Explanation :
The two statements are equivalent.
Report
Name Email  
14.
Which single-row function could you use to return a specific portion of a character string?
  • [A]
    INSTR
  • [B]
    SUBSTR
  • [C]
    LPAD
  • [D]
    LEAST
  • Answer & Explanation
  • Report
Answer : [B]
Explanation :
SUBSTR returns part of the string. INSTR returns a number. LPAD adds to a character string. LEAST does not change an input string.
Report
Name Email  
15.
Which function(s) accept arguments of any datatype? (Choose all that apply.)
  • [A]
    SUBSTR
  • [B]
    NVL
  • [C]
    ROUND
  • [D]
    DECODE
  • [E]
    SIGN
  • Answer & Explanation
  • Report
Answer : [B,D]
Explanation :
ROUND does not accept character arguments. SUBSTR accepts only character arguments. SIGN accepts only numeric arguments.
Report
Name Email