web analytics

Braindump2go Free Microsoft Dumps Questions Collection

Latest Real Exam Questions and Answers to help you pass Microsoft and other Hot exam 100%!

2014 Latest 100% Pass Guaranteed Oracle 1Z0-061 Practice Tests(1-10)

QUESTION 1
You need to create a table for a banking application. One of the columns in the table has the following requirements:
1) You want a column in the table to store the duration of the credit period.
2) The data in the column should be stored in a format such that it can be easily added and subtracted with date data type without using conversion functions.
3) The maximum period of the credit provision in the application is 30 days.
4) The interest has to be calculated for the number of days an individual has taken a credit for.
Which data type would you use for such a column in the table?

A.    DATE
B.    NUMBER
C.    TIMESTAMP
D.    INTERVAL DAY TO SECOND
E.    INTERVAL YEAR TO MONTH

Answer: D

QUESTION 2
Which three tasks can be performed using SQL functions built into Oracle Database?

A.    Displaying a date in a nondefault format
B.    Finding the number of characters in an expression
C.    Substituting a character string in a text expression with a specified string
D.    Combining more than two columns or expressions into a single column in the output

Answer: ABC

QUESTION 3
View the Exhibit and examine the data in the employees table:

image
You want to display all the employee names and their corresponding manager names.
Evaluate the following query:

image
Which join option can be used in the blank in the above query to get the required output?

A.    INNER JOIN
B.    FULL OUTER JOIN
C.    LEFT OUTER JOIN
D.    RIGHT OUTER JOIN

Answer: C

QUESTION 4
View the Exhibit and examine the description of SALES and PROMOTIONS tables.

image
You want to delete rows from the sales table, where the PROMO_NAME column in the promotions table has either blowout sale of everyday low prices as values.
Which three delete statements are valid?

image

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: BCD

QUESTION 5
Evaluate the following query:

image
What would be the outcome of the above query?

A.    It produces an error because flower braces have been used.
B.    It produces an error because the data types are not matching.
C.    It executes successfully and introduces an ‘s at the end of each PROMO_NAME in the output.
D.    It executes successfully and displays the literal "{‘s start date was \} * for each row in the output.

Answer: C
Explanation:
So, how are words that contain single quotation marks dealt with? There are essentially two mechanisms available. The most popular of these is to add an additional single quotation mark next to each naturally occurring single quotation mark in the character string
Oracle offers a neat way to deal with this type of character literal in the form of the alternative quote (q) operator. Notice that the problem is that Oracle chose the single quote characters as the special pair of symbols that enclose or wrap any other character literal. These character-enclosing symbols could have been anything other than single quotation marks.
Bearing this in mind, consider the alternative quote (q) operator. The q operator enables you to choose from a set of possible pairs of wrapping symbols for character literals as alternatives to the single quote symbols. The options are any single-byte or multibyte character or the four brackets: (round brackets), {curly braces}, [squarebrackets], or <angle brackets>. Using the q operator, the character delimiter can effectively be changed from a single quotation mark to any other character
The syntax of the alternative quote operator is as follows:
q’delimiter’character literal which may include the single quotes delimiter’ where delimiter can be any character or bracket.
Alternative Quote (q) Operator
Specify your own quotation mark delimiter.
Select any delimiter.
Increase readability and usability.
SELECT department_name || q'[ Department’s Manager Id: ]’ || manager_id
AS "Department and Manager"
FROM departments;
Alternative Quote (q) Operator
Many SQL statements use character literals in expressions or conditions. If the literal itself contains a single quotation mark, you can use the quote (q) operator and select your own quotation mark delimiter.
You can choose any convenient delimiter, single-byte or multi byte, or any of the following character pairs: [ ], { }, ( ), or < >.
In the example shown, the string contains a single quotation mark, which is normally interpreted as a delimiter of a character string. By using the q operator, however, brackets [] are used as the quotation mark delimiters. The string between the brackets delimiters is interpreted as a literal character string.

QUESTION 6
Examine the structure of the transactions table:

image
You want to display the date, time, and transaction amount of transactions that where done before 12 noon. The value zero should be displayed for transactions where the transaction amount has not been entered.
Which query gives the required result?

image

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: B

QUESTION 7
View the Exhibit and examine the structure of the customers table.

image
Using the customers table, you need to generate a report that shows the average credit limit for customers in Washington and NEW YORK.
Which SQL statement would produce the required result?

image

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: C

QUESTION 8
Examine the data in the ename and hiredate columns of the employees table:

image

image
You want to generate a list of user IDs as follows:

image
You issue the following query:

image
What is the outcome?

A.    It executes successfully and gives the correct output.
B.    It executes successfully but does not give the correct output.
C.    It generates an error because the REPLACE function is not valid.
D.    It generates an error because the SUBSTR function cannot be nested in the CONCAT function.

Answer: A
Explanation:
REPLACE (text, search_string, replacement_string) Searches a text expression for a character string and, if found, replaces it with a specified replacement string
The REPLACE Function
The REPLACE function replaces all occurrences of a search item in a source string with a replacement term and returns the modified source string. If the length of the replacement term is different from that of the search item, then the lengths of the returned and source strings will be different. If the search string is not found, the source string is returned unchanged. Numeric and date literals and expressions are evaluated before being implicitly cast as characters when they occur as parameters to the REPLACE function. The REPLACE function takes three parameters, with the first two being mandatory. Its syntax is REPLACE (source string, search item, [replacement term]). If the replacement term parameter is omitted, each occurrence of the search item is removed from the source string. In other words, the search item is replaced by an empty string. .
The following queries illustrate the REPLACE function with numeric and date expressions:
Query 1: select replace(10000-3, ‘9’, ’85’) from dual
Query 2: select replace(sysdate, ‘DEC’, ‘NOV’) from dual

QUESTION 9
Evaluate the following SQL commands:

image
The command to create a table fails. Identify the two reasons for the SQL statement failure?

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: AC
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),

QUESTION 10
View the Exhibit and examine the structure of the SALES table.

image
The following query is written to retrieve all those product IDs from the SALES table that have more than 55000 sold and have been ordered more than 10 times.
Which statement is true regarding this SQL statement?

A.    It executes successfully and generates the required result.
B.    It produces an error because count(*) should be specified in the SELECT clause also.
C.    It produces an error because count{*) should be only in the HAVING clause and not in the WHERE clause.
D.    It executes successfully but produces no result because COUNT (prod_id) should be used instead
of COUNT (*).

Answer: C
Explanation:
Restricting Group Results with the HAVING Clause You use the HAVING clause to specify the groups that are to be displayed, thus further restricting the groups on the basis of aggregate information. In the syntax, group_condition restricts the groups of rows returned to those groups for which the specified condition is true.
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 groups that match the criteria in the HAVING clause are displayed. The HAVING clause can precede the GROUP BY clause, but it is recommended that you place the GROUP BY clause first because it is more logical. Groups are formed and group functions are calculated before the HAVING clause is applied to the groups in the SELECT list.
Note: The WHERE clause restricts rows, whereas the HAVING clause restricts groups.

 

…go to http://www.lead2pass.com/1z0-061.html to download the full version Q&As.

 

try_now

, , , , , ,

Comments are currently closed.