10 free sample questions from a bank of 364, with the correct answers and explanations. No signup required — start practising right now.
1Examine the description of the PROMOTIONS table: You want to display the unique promotion costs in each promotion category.
Which two queries can be used? (Choose two.)
SELECT DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1;
SELECT DISTINCT promo_cost || ' in ' || DISTINCT promo_category FROM promotions ORDER BY 1;
SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1;
SELECT promo_category DISTINCT promo_cost, FROM promotions ORDER BY 2;
SELECT promo_cost, promo_category FROM promotions ORDER BY 1;
Answer:
2The STORES table has a column START_DATE of data type DATE, containing the date the row was inserted.
You only want to display details of rows where START_DATE is within the last 25 months.
Which WHERE clause can be used?
WHERE TO_NUMBER(start_date - SYSDATE) <= 25
WHERE MONTHS_BETWEEN(start_date, SYSDATE) <= 25
WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25
WHERE ADD_MONTHS(start_date, 25) <= SYSDATE
Answer: C
3Examine the BRICKS table: You write this query: How many rows will the query return?
4
6
16
0
1
10
Answer: B
4Examine this query:
SELECT INTERVAL ‘100’ MONTH DURATION FROM DUAL;
What will be the output?
an error
DURATION -
----------
+100
DURATION -
----------
+08
DURATION -
----------
+08-04
Answer: D
5Examine this query:
SELECT TRUNC(ROUND(156.00,-2),-1) FROM DUAL;
What is the result?
150
200
160
100
16
Answer: B
6You want to write a query that prompts for two column names and the where condition each time it is executed in a session but only prompts for the table name the first time it is executed.
The variables used in your query are never undefined in your session.
Which query can be used?
Answer:
7Which three statements are true about indexes and their administration in an Oracle database? (Choose three.)
The same table column can be part of a unique and non-unique index.
A descending index is a type of function-based index.
An INVINSIBLE index is not maintained when DML is performed on its underlying table.
If a query filters on an indexed column then it will always be used during execution of the query.
An index can be created as part of a CREATE TABLE statement.
An UNUSABLE index is maintained when DML is performed on its underlying table.
Answer:
8Examine this description of the EMP table: You execute this query: What is the result?
only departments where the total salary is greater than 3000, returned in no particular order
only departments where the total salary is greater than 3000, ordered by department
all departments and a sum of the salaries of employees with a salary greater than 3000
an error
Answer: D
9Which two are true about virtual columns? (Choose two.)
They can be indexed.
They can be referenced in the column expression of another virtual column.
They cannot have a data type explicitly specified.
They can be referenced in the set clause of an update statement as the name of the column to be updated.
They can be referenced in the where clause of an update or delete statement.
Answer:
10A session's NLS_DATE_FORMAT is set to DD Mon YYYY.
Which two queries return the value 1 Jan 2019? (Choose two.)
SELECT TO_DATE('2019-01-01') FROM DUAL;
SELECT DATE '2019-01-01' FROM DUAL;
SELECT '2019-01-01' FROM DUAL;
SELECT TO_DATE('2019-01-01', 'YYYY-MM-DD') FROM DUAL;