[Free] 2018(Jan) Latesttests Dumpsleader Oracle 1z0-051 Dumps with VCE and PDF Download 171-180

Latesttests 2018 Jan Oracle Official New Released 1z0-051
100% Free Download! 100% Pass Guaranteed!
http://www.Latesttests.com/1z0-051.html

Oracle Database: SQL Fundamentals I

Question No: 171 – (Topic 2)

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

Latesttests 2018 PDF and VCE

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

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

  2. finding the number of customers, in each city, whose marital status is #39;married#39;

  3. finding the average credit limit of male customers residing in #39;Tokyo#39; or #39;Sydney#39;

  4. listing of those customers whose credit limit is the same as the credit limit of customers residing in the city #39;Tokyo#39;

  5. 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 lt; result_of_previous_query ; Alternatively, this example uses one statement with a subquery:

select last_name from employees where salary lt; (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);

Question No: 172 – (Topic 2)

Examine the following SQL commands:

Latesttests 2018 PDF and VCE

Which statement is true regarding the execution of the above SQL commands?

  1. Both commands execute successfully.

  2. The first CREATE TABLE command generates an error because the NULL constraint is not valid.

  3. The second CREATE TABLE command generates an error because the CHECK constraint is not valid.

  4. The first CREATE TABLE command generates an error because CHECK and PRIMARY KEY constraints cannot be used for the same column.

  5. The first CREATE TABLE command generates an error because the column PROD_ID cannot be used in the PRIMARY KEY and FOREIGN KEY constraints.

Answer: B Explanation: Defining Constraints

The slide gives the syntax for defining constraints when creating a table. You can create constraints at either the column level or table level. Constraints defined at the column level are included when the column is defined. Table-level constraints are defined at the end of the table definition and must refer to the column or columns on which the constraint pertains in a set of parentheses. It is mainly the syntax that differentiates the two; otherwise, functionally, a columnlevel constraint is the same as a table-level constraint.

NOT NULL constraints must be defined at the column level.

Constraints that apply to more than one column must be defined at the table level.

Question No: 173 – (Topic 2)

SLS is a private synonym for the SH.SALES table.

The user SH issues the following command: DROP SYNONYM sls;

Which statement is true regarding the above SQL statement?

  1. Only the synonym would be dropped.

  2. The synonym would be dropped and the corresponding table would become invalid.

  3. The synonym would be dropped and the packages referring to the synonym would be dropped.

  4. The synonym would be dropped and any PUBLIC synonym with the same name becomes invalid.

Answer: A Explanation:

A synonym is an alias for a table (or a view). Users can execute SQL statements against the synonym, and the database will map them into statements against the object to which the synonym points.

Private synonyms are schema objects. Either they must be in your own schema, or they must be qualified with the schema name. Public synonyms exist independently of a schema. A public synonym can be referred to by any user to whom permission has been granted to see it without the need to qualify it with a schema name.

Private synonyms must be a unique name within their schema. Public synonyms can have the same name as schema objects. When executing statements that address objects without a schema qualifier, Oracle will first look for the object in the local schema, and only if it cannot be found will it look for a public synonym.

Question No: 174 – (Topic 2)

Which three statements are true regarding views? (Choose three.)

  1. Views can be created only from tables.

  2. Views can be created from tables or other views.

  3. Only simple views can use indexes existing on the underlying tables.

  4. Both simple and complex views can use indexes existing on the underlying tables.

  5. Complex views can be created only on multiple tables that exist in the same schema.

  6. Complex views can be created on multiple tables that exist in the same or different

schemas.

Answer: B,D,F Explanation:

Creating a Sequence (continued)

CYCLE | NOCYCLE Specifies whether the sequence continues to generate values after reaching its maximum or minimum value

(NOCYCLE is the default option.)

CACHE n | NOCACHE Specifies how many values the Oracle server preallocates and keeps in memory (By default, the Oracle server caches 20 values.)

Question No: 175 – (Topic 2)

Which two statements are true about WHERE and HAVING clauses? (Choose two)

  1. A WHERE clause can be used to restrict both rows and groups.

  2. A WHERE clause can be used to restrict rows only.

  3. A HAVING clause can be used to restrict both rows and groups.

  4. A HAVING clause can be used to restrict groups only.

  5. A WHERE clause CANNOT be used in a query of the query uses a HAVING clause.

  6. A HAVING clause CANNOT be used in sub queries.

    Answer: B,D Explanation:

    B: WHERE clause cannot be use to restrict groups

    WHERE clause cannot be use when there is group functions. D: A HAVING clause can only e used to restrict GROUPS.

    Note: HAVING clause to specify which groups are to be displayed and thus further restrict the groups on

    the basis of aggregate information. The Oracle server performs the following steps when you use the Having clause

    1. rows are grouped

    2. the group function is applied to the group

    3. the group that match the criteria in the Having clause are displayed.

      Incorrect Answers :

      1. Where clause cannot be use to restrict groups

C. A HAVING clause can only e used to restrict GROUPS.

  1. WHERE clause cannot be use when there is group function, instead HAVING is to be use.

  2. There is no constraint to use HAVING clause in a sub queries.

Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Aggregating Data using Group Functions, p. 5-20

Question No: 176 – (Topic 2)

Which statements are true regarding the WHERE and HAVING clauses in a SELECT statement?

(Choose all that apply.)

  1. The HAVING clause can be used with aggregate functions in subqueries.

  2. The WHERE clause can be used to exclude rows after dividing them into groups.

  3. The WHERE clause can be used to exclude rows before dividing them into groups.

  4. The aggregate functions and columns used in the HAVING clause must be specified in the SELECT list of the query.

  5. The WHERE and HAVING clauses can be used in the same statement only if they are applied to different columns in the table.

Answer: A,C

Question No: 177 – (Topic 2)

You own a table called EMPLOYEES with this table structure:

EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25)

HIRE_DATE DATE

What happens when you execute this DELETE statement? DELETE employees;

  1. You get an error because of a primary key violation.

  2. The data and structure of the EMPLOYEES table are deleted.

  3. The data in the EMPLOYEES table is deleted but not the structure.

  4. You get an error because the statement is not syntactically correct.

Answer: C

Explanation: Explanation: You can remove existing rows from a table by using the DELETE statement.

DELETE [FROM] table

[WHEREcondition]; Incorrect answer:

AStatement will not cause error

BDelete statement will not delete the table structure DStatement will not cause error

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

Question No: 178 – (Topic 2)

Which statement is true regarding transactions? (Choose all that apply.)

  1. A transaction can consist only of a set of DML and DDL statements.

  2. A part or an entire transaction can be undone by using ROLLBACK command.

  3. A transaction consists of a set of DML or DCL statements.

  4. A part or an entire transaction can be made permanent with a COMMIT.

  5. A transaction can consist of only a set of queries or DML or DDL statements.

Answer: B,C

Question No: 179 – (Topic 2)

EMPLOYEES and DEPARTMENTS data: EMPLOYEES

Latesttests 2018 PDF and VCE

DEPARTMENTS

Latesttests 2018 PDF and VCE

On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID.

On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement.

UPDATE employees SET mgr_id = (SELECT mgr_id FROMemployees WHERE dept_id=

(SELECT department_id

FROM departments

WHERE department_name = #39;Administration#39;)), Salary = (SELECT salary

FROM employees

WHERE emp_name = #39;Smith#39;) WHERE job_id = #39;IT_ADMIN#39;;

What happens when the statement is executed?

  1. The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.

  2. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.

  3. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.

  4. The statement fails because there is more than one row matching the employee name Smith.

  5. The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.

  6. The statement fails because there is no #39;Administration#39; department in the DEPARTMENTS table.

Answer: D Explanation:

#39;=#39; is use in the statement and sub query will return more than one row. Employees table has 2 row matching the employee name Smith.

The update statement will fail. Incorrect Answers :

  1. The Update statement will fail no update was done.

  2. The update statement will fail no update was done.

  3. The update statement will fail no update was done.

  1. The update statement will fail but not due to job_it=#39;IT_ADMIN#39;

  2. The update statement will fail but not due to department_id=#39;Administration#39;

Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Sub queries, p. 6-12

Question No: 180 – (Topic 2)

Evaluate this SQL statement:

SELECT ename, sal, 12*sal 100 FROM emp;

The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as quot;monthly salary plus a monthly bonus of $100, multiplied by 12quot;?

  1. No change is required to achieve the desired results.

  2. SELECT ename, sal, 12*(sal 100) FROM emp;

  3. SELECT ename, sal, (12*sal) 100 FROM emp;

  4. SELECT ename, sal 100,*12 FROM emp;

Answer: B Explanation:

to achieve the result you must add 100 to sal before multiply with 12. Select ename, sal, 12*(sal 100) from EMP;

Incorrect answer:

AMultiplication and division has priority over addition and subtraction in Operator precedence.

CGive wrong results DWrong syntax

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

100% Free Download!
Download Free Demo:1z0-051 Demo PDF
100% Pass Guaranteed!
Download 2018 Latesttests 1z0-051 Full Exam PDF and VCE

Latesttests ExamCollection Testking
Lowest Price Guarantee Yes No No
Up-to-Dated Yes No No
Real Questions Yes No No
Explanation Yes No No
PDF VCE Yes No No
Free VCE Simulator Yes No No
Instant Download Yes No No

2018 Latesttests IT Certification PDF and VCE