It is more faster and easier to pass the Oracle 1z0 051 dumps pdf exam by using Breathing Oracle Oracle Database: SQL Fundamentals I questuins and answers. Immediate access to the Update 1z0 051 pdf Exam and find the same core area 1z0 051 practice test questions with professionally verified answers, then PASS your exam with a high score now.


♥♥ 2021 NEW RECOMMEND ♥♥

Free VCE & PDF File for Oracle 1Z0-051 Real Exam (Full Version!)

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 1Z0-051 Exam Dumps (PDF & VCE):
Available on: http://www.surepassexam.com/1Z0-051-exam-dumps.html

Q51. - (Topic 1) 

You need to generate a list of all customer last names with their credit limits from the CUSTOMERS table. Those customers who do not have a credit limit should appear last in the list. Winch two queries would achieve the required result? (Choose two.) 

A. SELECT cust_last_name. cust_credit_limit FROM customers ORDER BY cust_credit_limit DESC: 

B. SELECT cust_last_name. cust_credit_limit FROM customers ORDER BY cust_credit_limit: 

C. SELECT cust_last_name. cust_credit_limit FROM customers ORDER BY cust_credit_limit NULLS LAST: 

D. SELECT cust_last_name. cust_credit_limit FROM customers ORDER BY cust_last_name. cust_credit_limit NULLS LAST: 

Answer: B,C 

Explanation: 

If the ORDER BY clause is not used, the sort order is undefined, and the Oracle server may not fetch rows in the same order for the same query twice. Use the ORDER BY clause to display the rows in a specific order. Note: Use the keywords NULLS FIRST or NULLS LAST to specify whether returned rows containing null values should appear first or last in the ordering sequence. ANSWER C Sorting The default sort order is ascending: 

Numeric values are displayed with the lowest values first (for example, 1 to 999). 

Date values are displayed with the earliest value first (for example, 01-JAN-92 before 01-JAN-95). 

Character values are displayed in the alphabetical order (for example, “A” first and “Z” last). 

Null values are displayed last for ascending sequences and first for descending sequences. 

-ANSWER B 

. You can also sort by a column that is not in the SELECT list. 


Q52. - (Topic 1) 

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables: 

Which DELETE statement is valid? 

A. DELETE FROM employeesWHERE employee_id = (SELECT employee_id FROM employees); 

B. DELETE * FROM employeesWHERE employee_id=(SELECT employee_id FROM new_employees); 

C. DELETE FROM employeesWHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = ‘Carrey’); 

D. DELETE * FROM employeesWHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = ‘Carrey’); 

Answer:


Q53. - (Topic 2) 

View the Exhibit and examine the structure of the CUSTOMERS table. 

Which two tasks would require subqueries or joins to be executed in a single statement? (Choose two.) 

A. listing of customers who do not have a credit limit and were born before 1980 

B. finding the number of customers, in each city, whose marital status is 'married' 

C. finding the average credit limit of male customers residing in 'Tokyo' or 'Sydney' 

D. listing of those customers whose credit limit is the same as the credit limit of customers residing in the city 'Tokyo' 

E. finding the number of customers, in each city, whose credit limit is more than the average credit limit of all the customers 

Answer: D,E 

Explanation: 

Describe the Types of Problems That the Subqueries Can Solve There are many situations where you will need the result of one query as the input for another. Use of a Subquery Result Set for Comparison Purposes Which employees have a salary that is less than the average salary? This could be answered by two statements, or by a single statement with a subquery. The following example uses two statements: select avg(salary) from employees; select last_name from employees where salary < result_of_previous_query ; 

Alternatively, this example uses one statement with a subquery: 

select last_name from employees where salary < (select avg(salary)from employees); 

In this example, the subquery is used to substitute a value into the WHERE clause of the 

parent query: it is returning a single value, used for comparison with the rows retrieved by 

the parent query. 

The subquery could return a set of rows. For example, you could use the following to find 

all departments that do actually have one or more employees assigned to them: 

select department_name from departments where department_id in 

(select distinct(department_id) from employees); 


Q54. - (Topic 1) 

You need to create a table with the following column specifications: 

1. 

Employee ID (numeric data type) for each employee 

2. 

Employee Name (character data type) that stores the employee name 

3. 

Hire date, which stores the date of joining the organization for each employee 

4. 

Status (character data type), that contains the value 'ACTIVE' if no data is entered 

5. 

Resume (character large object [CLOB] data type), which contains the resume submitted by the employee 

Which is the correct syntax to create this table? 

A. CREATE TABLE EMP_1 

(emp_id NUMBER(4), 

emp_name VARCHAR2(25), 

start_date DATE, 

e_status VARCHAR2(10) DEFAULT 'ACTIVE', 

resume CLOB(200)); 

B. CREATE TABLE 1_EMP 

(emp_id NUMBER(4), 

emp_name VARCHAR2(25), 

start_date DATE, 

emp_status VARCHAR2(10) DEFAULT 'ACTIVE', 

resume CLOB); 

C. CREATE TABLE EMP_1 

(emp_id NUMBER(4), 

emp_name VARCHAR2(25), 

start_date DATE, 

emp_status VARCHAR2(10) DEFAULT "ACTIVE", 

resume CLOB); 

D. CREATE TABLE EMP_1 

(emp_id NUMBER, 

emp_name VARCHAR2(25), 

start_date DATE, 

emp_status VARCHAR2(10) DEFAULT 'ACTIVE', 

resume CLOB); 

Answer:

Explanation: 

CLOB Character data (up to 4 GB) 

NUMBER [(p,s)] Number having precision p and scale s (Precision is the total number of 

decimal digits and scale is the number of digits to the right of the decimal point; precision 

can range from 1 to 38, and scale can range from –84 to 127.) 


Q55. - (Topic 2) 

Examine the structure of the PROMOS table: 

You want to display the list of promo names with the message 'Same Day' for promos that started and ended on the same day. 

Which query gives the correct output? 

A. SELECT promo_name, NVL(NULLIF(promo_start_date, promo_end_date), 'Same Day') 

FROM promos; 

B. SELECT promo_name, NVL(TRUNC(promo_end_date - promo_start_date), 'Same 

Day') FROM promos; 

C. SELECT promo_name, NVL2(TO_CHAR(TRUNC(promo_end_date-promo_start_date)), 

NULL,'Same Day') 

FROM promos; 

D. SELECT promo_name, DECODE((NULLIF(promo_start_date, promo_end_date)), 

NULL,'Same day') FROM promos; 

Answer:

Explanation: 

The NULLIF Function The NULLIF function tests two terms for equality. If they are equal the function returns a null, else it returns the first of the two terms tested. The NULLIF function takes two mandatory parameters of any data type. The syntax is NULLIF(ifunequal, comparison_term), where the parameters ifunequal and comparison_term are compared. If they are identical, then NULL is returned. If they differ, the ifunequal parameter is returned ANSWER A - date and String incompatibl;a datatypes for NVL function The Date TRUNC Function The date TRUNC function performs a truncation operation on a date value based on a specified date precision format. The date TRUNC function takes one mandatory and one optional parameter. Its syntax is TRUNC(source date, [date precision format]). The source date parameter represents any value that can be implicitly converted into a date item. The date precision format parameter specifies the degree of truncation and is optional. If it is absent, the default degree of truncation is day. This means that any time component 


Q56. - (Topic 2) 

Which SQL statement returns a numeric value? 

A. SELECT ADD_MONTHS(MAX(hire_Date), 6) FROM EMP; 

B. SELECT ROUND(hire_date) FROM EMP; 

C. SELECT sysdate-hire_date FROM EMP; 

D. SELECT TO_NUMBER(hire_date + 7) FROM EMP; 

Answer:

Explanation: 

DATE value subtract DATE value will return numeric value. 

Incorrect Answer: Adoes not return numeric value Bdoes not return numeric value Ddoes not return numeric value 

Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 9-13 


Q57. - (Topic 2) 

Which two statements are true regarding constraints? (Choose two.) 

A. A table can have only one primary key and one foreign key. 

B. A table can have only one primary key but multiple foreign keys. 

C. Only the primary key can be defined at the column and table levels. 

D. The foreign key and parent table primary key must have the same name. 

E. Both primary key and foreign key constraints can be defined at both column and table 

levels. 

Answer: B,E 


Q58. - (Topic 1) 

Evaluate the following SQL commands: 

The command to create a table fails. Identify the reason for the SQL statement failure? 

(Choose all that apply.) 

A. You cannot use SYSDATE in the condition of a CHECK constraint. 

B. You cannot use the BETWEEN clause in the condition of a CHECK constraint. 

C. You cannot use the NEXTVAL sequence value as a DEFAULT value for a column. 

D. You cannot use ORD_NO and ITEM_NO columns as a composite primary key because ORD NO is also the FOREIGN KEY. 

Answer: A,C 

Explanation: 

CHECK Constraint The CHECK constraint defines a condition that each row must satisfy. The condition can use the same constructs as the query conditions, with the following exceptions: References to the CURRVAL, NEXTVAL, LEVEL, and ROWNUM pseudocolumns Calls to SYSDATE, UID, USER, and USERENV functions Queries that refer to other values in other rows A single column can have multiple CHECK constraints that refer to the column in its 

definition. 

There is no limit to the number of CHECK constraints that you can define on a column. 

CHECK constraints can be defined at the column level or table level. 

CREATE TABLE employees 

(... 

salary NUMBER(8,2) CONSTRAINT emp_salary_min 

CHECK (salary > 0), 


Q59. - (Topic 2) 

The PRODUCTS table has these columns: 

PRODUCT_ID NUMBER(4) 

PRODUCT_NAME VARCHAR2(45) 

PRICE NUMBER(8,2) 

Evaluate this SQL statement: 

SELECT * 

FROM PRODUCTS 

ORDER BY price, product_name; 

What is true about the SQL statement? 

A. The results are not sorted. 

B. The results are sorted numerically. 

C. The results are sorted alphabetically. 

D. The results are sorted numerically and then alphabetically. 

Answer:

Explanation: 

the result is sort by price which is numeric and follow by product_name which is alphabetically. 

Incorrect Answer: Athe results are sorted Bthe results are sorted with alphabetically as well Cthe results are sorted with numerically as well 

Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 2-2 


Q60. - (Topic 1) 

Examine these statements: 

CREATE ROLE registrar; 

GRANT UPDATE ON student_grades TO registrar; 

GRANT registrar to user1, user2, user3; 

What does this set of SQL statements do? 

A. The set of statements contains an error and does not work. 

B. It creates a role called REGISTRAR, adds the MODIFY privilege on the STUDENT_GRADES object to the role, and gives the REGISTRAR role to three users. 

C. It creates a role called REGISTRAR, adds the UPDATE privilege on the STUDENT_GRADES object to the role, and gives the REGISTRAR role to three users. 

D. It creates a role called REGISTRAR, adds the UPDATE privilege on the STUDENT_GRADES object to the role, and creates three users with the role. 

E. It creates a role called REGISTRAR, adds the UPDATE privilege on three users, and gives the REGISTRAR role to the STUDENT_GRADES object. 

F. It creates a role called STUDENT_GRADES, adds the UPDATE privilege on three users, and gives the UPDATE role to the registrar. 

Answer:

Explanation: the statement will create a role call REGISTRAR, grant UPDATE on student_grades to registrar, grant the role to user1,user2 and user3. 

Incorrect Answer: Athe statement does not contain error Bthere is no MODIFY privilege Dstatement does not create 3 users with the role Eprivilege is grant to role then grant to user Fprivilege is grant to role then grant to user