[Free] 2019(Nov) EnsurePass Oracle 1z0-061 Dumps with VCE and PDF 91-100

Get Full Version of the Exam
http://www.EnsurePass.com/1z0-061.html

Question No.91

Consider these three statements:

create synonym s1 for employees; create public synonym s1 for departments; select * from s1; Which of the following statements is correct?

  1. The second statement will fail because an object S1 already exists.

  2. The third statement will show the contents of EMPLOYEES.

  3. The third statement will show the contents of DEPARTMENTS.

  4. The third statement will show the contents of the table S1, if such a table exists in the current schema.

Correct Answer: B

Explanation:

The order of priority is to search the schema namespace before the public namespace, so it will be the private synonym (to EMPLOYEES) that will be found.

Question No.92

Which two statements are true regarding subqueries?

  1. A subquery can retrieve zero or more rows.

  2. Only two subqueries can be placed at one level.

  3. A subquery can be used only in SQL query statements.

  4. A subquery can appear on either side of a comparison operator.

  5. There is no limit on the number of subquery levels in the WHERE clause of a SELECT statement.

Correct Answer: AD

Explanation:

Using a Subquery to Solve a Problem

Suppose you want to write a query to find out who earns a salary greater than Abel#39;s salary.

To solve this problem, you need two queries: one to find how much Abel earns, and a second query to find who earns more than that amount. You can solve this problem by combining the two queries, placing one query inside the other query. The inner query (or subquery) returns a value that is used by the outer query (or main query).

Using a subquery is equivalent to performing two sequential queries and using the result of the first query as the search value in the second query.

Subquery Syntax

A subquery is a SELECT statement that is embedded in the clause of another SELECT statement. You can build powerful statements out of simple ones by using subqueries. They can be very useful when you need to select rows from a table with a condition that depends on the data in the table itself.

You can place the subquery in a number of SQL clauses, including the following:

image

image

image

WHERE clause HAVING clause FROM clause

In the syntax:

operator includes a comparison condition such as gt;, =, or IN

Note:

Comparison conditions fall into two classes: single-row operators (gt;, =, gt;=, lt;, lt;gt;, lt;=) and multiple-row operators (IN, ANY, ALL, EXISTS). The subquery is often referred to as a nested SELECT, sub-SELECT, or inner SELECT statement. The subquery generally executes first, and its output is used to complete the query condition for the main (or outer) query.

Guidelines for Using Subqueries

Enclose subqueries in parentheses. Place subqueries on the right side of the comparison condition for readability. (However, the subquery can appear on either side of the comparison operator.) Use single-row operators with single-row subqueries and multiple- row operators with multiple-row subqueries.

Subqueries can be nested to an unlimited depth in a FROM clause but to quot;onlyquot; 255 levels in a WHERE clause. They can be used in the SELECT list and in the FROM, WHERE, and HAVING clauses of a query.

Question No.93

See the Exhibits and examine the structures of PRODUCTS, SALES and CUSTOMERS table:

image

You issue the following query:

image

Which statement is true regarding the outcome of this query?

  1. It produces an error because the NATURAL join can be used only with two tables

  2. It produces an error because a column used in the NATURAL join cannot have a qualifier

  3. It produces an error because all columns used in the NATURAL join should have a qualifier

  4. It executes successfully

Correct Answer: B

Explanation:

Creating Joins with the USING Clause

Natural joins use all columns with matching names and data types to join the tables. The USING clause can be used to specify only those columns that should be used for an equijoin.

The Natural JOIN USING Clause

The format of the syntax for the natural JOIN USING clause is as follows: SELECT table1.column, table2.column

FROM table1

JOIN table2 USING (join_column1, join_column2…); While the pure natural join contains the NATURAL keyword in its syntax, the JOIN…USING syntax does not.

An error is raised if the keywords NATURAL and USING occur in the same join clause. The JOIN…USING clause allows one or more equijoin columns to be explicitly specified in brackets after the USING keyword. This avoids the shortcomings associated with the pure natural join. Many situations demand that tables be joined only on certain columns, and this format caters to this requirement.

Question No.94

You are currently located in Singapore and have connected to a remote database in Chicago. You issue the following command:

image

PROMOTIONS is the public synonym for the public database link for the PROMOTIONS table. What is the outcome?

  1. Number of days since the promo started based on the current Chicago data and time

  2. Number of days since the promo started based on the current Singapore data and time.

  3. An error because the WHERE condition specified is invalid

  4. An error because the ROUND function specified is invalid

Correct Answer: A

Question No.95

Which two are true about aggregate functions? (Choose two.)

  1. You can use aggregate functions in any clause of a SELECT statement.

  2. You can use aggregate functions only in the column list of the select clause and in the WHERE clause of a SELECT statement.

  3. You can mix single row columns with aggregate functions in the column list of a SELECT statement by grouping on the single row columns.

  4. You can pass column names, expressions, constants, or functions as parameter to an aggregate function.

  5. You can use aggregate functions on a table, only by grouping the whole table as one single group.

  6. You cannot group the rows of a table by more than one column while using aggregate functions.

Correct Answer: AD

Question No.96

Evaluate this SQL statement: SELECT e.emp_name, d.dept_name

FROM employees e JOIN departments d USING (department_id)

WHERE d.department_id NOT IN (10, 40) ORDER BY dept_name;

The statement fails when executed. Which change fixes the error?

  1. remove the ORDER BY clause

  2. remove the table alias prefix from the WHERE clause

  3. remove the table alias from the SELECT clause

  4. prefix the column in the USING clause with the table alias

  5. prefix the column in the ORDER BY clause with the table alias

  6. replace the conditionquot;d.department_id NOT IN (10, 40)quot;in the WHERE clause withquot;d.department_id lt;gt; 10 AND d.department_id lt;gt; 40quot;

Correct Answer: CE

Explanation:

Prefix the column in the ORDER BY Clause would cause the statement to succeed, assuming that the statement failed because the dept_name existed in employee amp; department tables.

Not C: Removing the alias from the columns in the SELECT clause would cause the Statement to fail if the columns existing in both tables.

Question No.97

See the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS and ITEMS tables:

image

The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table. Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the CUSTOMERS and TIMES tables, respectively.

Evaluate the following the CREATE TABLE command:

image

Which statement is true regarding the above command?

  1. The NEW_SALES table would not get created because the column names in the CREATE TABLE command and the SELECT clause do not match

  2. The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified columns would be passed to the new table

  3. The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the column definition

  4. The NEW_SALES table would get created and all the FOREIGN KEY constraints defined on the specified columns would be passed to the new table

Correct Answer: B

Explanation:

Creating a Table Using a Subquery

Create a table and insert rows by combining the CREATE TABLE statement and the AS subquery option.

CREATE TABLE table [(column, column…)] AS subquery;

Match the number of specified columns to the number of subquery columns. Define columns with column names and default values.

Guidelines

The table is created with the specified column names, and the rows retrieved by the SELECT statement are inserted into the table.

The column definition can contain only the column name and default value. If column specifications are given, the number of columns must equal the number of columns in the subquery SELECT list.

If no column specifications are given, the column names of the table are the same as the column names in the subquery.

The column data type definitions and the NOT NULL constraint are passed to the new table. Note that only the explicit NOT NULL constraint will be inherited. The PRIMARY KEY column will not pass the NOT NULL feature to the new column. Any other constraint rules are not passed to the new table. However, you can add constraints in the column definition.

Question No.98

Which statements are correct regarding indexes? (Choose all that apply.)

  1. For each data manipulation language (DML) operation performed, the corresponding indexes are automatically updated.

  2. A nondeferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a unique index.

  3. A FOREIGN KEY constraint on a column in a table automatically creates a non unique key

  4. When a table is dropped, the corresponding indexes are automatically dropped

Correct Answer: ABD

Question No.99

The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this?

  1. GRANT select ON deptTO ALL_USERS;

  2. GRANT select ON deptTO ALL;

  3. GRANT QUERY ON deptTO ALL_USERS

  4. GRANT select ON deptTO PUBLIC;

Correct Answer: D

Explanation:

view the columns associated with the constraint names in the USER_CONS_COLUMNS view.

Incorrect answer:

A.table to view all constraints definition and names B.show all object name belong to user

C.does not display column associated E.no such view

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

Question No.100

Which two statements are true regarding working with dates? (Choose two.)

  1. The default internal storage of dates is in the numeric format.

  2. The RR date format automatically calculates the century from the SYSDATE function but allows the user to enter the century if required.

  3. The default internal storage of dates is in the character format.

  4. The RR date format automatically calculates the century from the SYSDATE function and does not allow the user to enter the century.

Correct Answer: AB Explanation: Working with Dates

The Oracle Database stores dates in an internal numeric format, representing the century, year, month, day, hours, minutes, and seconds.

The default display and input format for any date is DD-MON-RR.

RR Date Format

The RR date format is similar to the YY element, but you can use it to specify different centuries. Use the RR date format element instead of YY so that the century of the return value varies according to the specified two digit year and the last two digits of the current year. The table in the slide summarizes the behavior of the RR element.

image

Note the values shown in the last two rows of the above table. As we approach the middle of the century, then the RR behavior is probably not what you want.

This data is stored internally as follows:

CENTURY YEAR MONTH DAY HOUR MINUTE SECOND 19 87 06 17 17 10 43

Get Full Version of the Exam
1z0-061 Dumps
1z0-061 VCE and PDF

You must be logged in to post a comment.

Proudly powered by WordPress   Premium Style Theme by www.gopiplus.com