Oracle Database: SQL Fundamentals 1Z0-051: Exam
Oracle Database: SQL Fundamentals 1Z0-051: Exam
Oracle Database: SQL Fundamentals 1Z0-051: Exam
1 http://www.hotcerts.com
1Z0-051
QUESTION: 1
Which statement is true regarding the INTERSECT operator?
Answer: D
QUESTION: 2
Which three statements are true regarding the data types in Oracle Database 0g/11g?
(Choose three.)
Answer: A, D, E
QUESTION: 3
Examine the structure of the PROGRAMS table:
Name Null? Type
---------- ------------- ---------------
PROG_ID NOT NULL NUMBER(3)
PROG_COST NUMBER(8,2)
START_DATE NOT NULL DATE
END_DATE DATE
Which two SQL statements would execute successfully? (Choose two.)
2 http://www.hotcerts.com
1Z0-051
D. SELECT NVL(TO_CHAR(MONTHS_BETWEEN(start_date,end_date)),'Ongoing')
FROM programs;
Answer: A, D
QUESTION: 4
View the Exhibit and examine the structure of the PROMOTIONS table. Which two
SQL statements would execute successfully? (Choose two.)
A. UPDATE promotions
SET promo_cost = promo_cost+ 100
WHERE TO_CHAR(promo_end_date, 'yyyy') > '2000';
B. SELECT promo_begin_date
FROM promotions
WHERE TO_CHAR(promo_begin_date,'mon dd yy')='jul 01 98';
C. UPDATE promotions
SET promo_cost = promo_cost+ 100
WHERE promo_end_date > TO_DATE(SUBSTR('01-JAN-2000',8));
D. SELECT TO_CHAR(promo_begin_date,'dd/month')
FROM promotions
WHERE promo_begin_date IN (TO_DATE('JUN 01 98'), TO_DATE('JUL 01 98'));
Answer: A, B
QUESTION: 5
View the Exhibit and evaluate structures of the SALES, PRODUCTS, and COSTS
tables. Evaluate the following SQL statement:
SQL>SELECT prod_id FROM products
INTERSECT
SELECT prod_id FROM sales
MINUS
3 http://www.hotcerts.com
1Z0-051
A. It produces an error.
B. It shows products that were sold and have a cost recorded.
C. It shows products that were sold but have no cost recorded.
D. It shows products that have a cost recorded irrespective of sales.
Answer: C
QUESTION: 6
View the Exhibit and examine the structure of CUSTOMERS and SALES tables.
Evaluate the following SQL statement:
UPDATE (SELECT prod_id, cust_id, quantity_sold, time_id
FROM sales)
SET time_id = '22-MAR-2007'
WHERE cust_id = (SELECT cust_id
4 http://www.hotcerts.com
1Z0-051
FROM customers
WHERE cust_last_name = 'Roberts' AND
credit_limit = 600);
Which statement is true regarding the execution of the above UPDATE statement?
A. It would not execute because two tables cannot be used in a single UPDATE
statement.
B. It would not execute because the SELECT statement cannot be used in place of the
table name.
C. It would execute and restrict modifications to only the columns specified in the
SELECT statement.
D. It would not execute because a subquery cannot be used in the WHERE clause of an
UPDATE statement.
Answer: C
5 http://www.hotcerts.com
1Z0-051
QUESTION: 7
You are currently located in Singapore and have connected to a remote database in
Chicago. You issue the following command:
SQL> SELECT ROUND(SYSDATE-promo_begin_date,0)
FROM promotions
WHERE (SYSDATE-promo_begin_date)/365 > 2;
PROMOTIONS is the public synonym for the public database link for the
PROMOTIONS table. What is the outcome?
Answer: C
QUESTION: 8
You need to display the first names of all customers from the CUSTOMERS table that
contain the character 'e' and have the character 'a' in the second last position. Which
query would give the required output?
A. SELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, -2, 1)='a';
B. SELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')<>'' AND
SUBSTR(cust_first_name, -2, 1)='a';
C. SELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')IS NOT NULL AND
SUBSTR(cust_first_name, 1,-2)='a';
D. SELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, LENGTH(cust_first_name),-2)='a';
Answer: A
QUESTION: 9
6 http://www.hotcerts.com
1Z0-051
A. 16
B. 100
C. 160
D. 200
E. 150
Answer: C
QUESTION: 10
Which two statements are true regarding the COUNT function? (Choose two.)
A. The COUNT function can be used only for CHAR, VARCHAR2, and NUMBER data
types.
B. COUNT(*) returns the number of rows including duplicate rows and rows containing
NULL value in any of the columns.
C. COUNT(cust_id) returns the number of rows including rows with duplicate customer
IDs and NULL value in the CUST_ID column
D. COUNT(DISTINCT inv_amt)returns the number of rows excluding rows containing
duplicates and NULL values in the INV_AMT column.
E. A SELECT statement using the COUNT function with a DISTINCT keyword cannot
have a WHERE clause.
Answer: B, D
QUESTION: 11
View the Exhibits and examine the structures of the PROMOTIONS and SALES tables.
Evaluate the following SQL statement:
SQL>SELECT p.promo_id, p.promo_name, s.prod_id
FROM sales s RIGHT OUTER JOIN promotions p
ON (s.promo_id = p.promo_id);
Which statement is true regarding the output of the above query?
7 http://www.hotcerts.com
1Z0-051
A. It gives the details of promos for which there have been sales.
B. It gives the details of promos for which there have been no sales.
C. It gives details of all promos irrespective of whether they have resulted in a sale or
not.
D. It gives details of product IDs that have been sold irrespective of whether they had a
promo or not.
Answer: C
QUESTION: 12
View the Exhibit and examine the structure of the CUSTOMERS table. Evaluate the
query statement:
SQL> SELECT cust_last_name, cust_city, cust_credit_limit
FROM customers
WHERE cust_last_name BETWEEN 'A' AND 'C' AND cust_credit_limit BETWEEN
1000 AND 3000;
What would be the outcome of the above statement?
8 http://www.hotcerts.com
1Z0-051
A. It executes successfully.
B. It produces an error because the condition on CUST_LAST_NAME is invalid.
C. It executes successfully only if the CUST_CREDIT_LIMIT column does not contain
any null values.
D. It produces an error because the AND operator cannot be used to combine multiple
BETWEEN clauses.
Answer: A
QUESTION: 13
Which two statements are true regarding the USING and ON clauses in table joins?
(Choose two.)
A. Both USING and ON clauses can be used for equijoins and nonequijoins.
B. A maximum of one pair of columns can be joined between two tables using the ON
clause.
C. The ON clause can be used to join tables on columns that have different names but
compatible data types.
D. The WHERE clause can be used to apply additional conditions in SELECT
statements containing the ON or the USING clause.
Answer: C, D
QUESTION: 14
Where can subqueries be used? (Choose all that apply.)
9 http://www.hotcerts.com
1Z0-051
Answer: A, B, C, F
QUESTION: 15
Using the CUSTOMERS table, you need to generate a report that shows 50% of each
credit amount in each income level. The report should NOT show any repeated credit
amounts in each income level. Which query would give the required result?
Answer: C
QUESTION: 16
Which statement is true regarding the UNION operator?
Answer: B
QUESTION: 17
Which two statements are true regarding working with dates? (Choose two.)
10 http://www.hotcerts.com
1Z0-051
C. The RR date format automatically calculates the century from the SYSDATE function
and does not allow the user to enter the century.
D. The RR date format automatically calculates the century from the SYSDATE
function but allows the user to enter the century if required.
Answer: A, D
QUESTION: 18
The ORDERS table belongs to the user OE. OE has granted the SELECT privilege on
the ORDERS table to the user HR. Which statement would create a synonym ORD so
that HR can execute the following query successfully?
SELECT * FROM ord;
Answer: D
QUESTION: 19
View the Exhibit and examine the structure of the PROMOTIONS table. Which SQL
statements are valid? (Choose all that apply.)
11 http://www.hotcerts.com
1Z0-051
Answer: A, B
QUESTION: 20
Evaluate the following SQL statement:
SQL> SELECT cust_id, cust_last_name FROM customers
WHERE cust_credit_limit IN
(select cust_credit_limit
FROM customers
WHERE cust_city ='Singapore');
Which statement is true regarding the above query if one of the values generated by the
subquery is NULL?
A. It produces an error.
B. It executes but returns no rows.
C. It generates output for NULL as well as the other values produced by the subquery.
D. It ignores the NULL value and generates output for the other values produced by the
subquery.
Answer: C
12 http://www.hotcerts.com