0% found this document useful (0 votes)
51 views11 pages

Oracle 1z0 061

Oracle Database Administrator Associate dups

Uploaded by

Fat Soldiers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views11 pages

Oracle 1z0 061

Oracle Database Administrator Associate dups

Uploaded by

Fat Soldiers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

s@lm@n

Oracle
Exam 1z0-061
Oracle Database 12c: SQL Fundamentals
Verson: Demo

[ Total Questions: 10 ]
Oracle 1z0-061 : Practice Exam
Question No : 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.

Which two queries would achieve the required result?

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

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).

Leaders in it certification 2
Oracle 1z0-061 : Practice Exam
• 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.

Question No : 2

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

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?

Leaders in it certification 3
Oracle 1z0-061 : Practice Exam

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

Answer: C

Question No : 3

YOU need to display the date ll-oct-2007 in words as ‘Eleventh of October, Two Thousand
Seven'.

Which SQL statement would give the required result?

A. Option A

Leaders in it certification 4
Oracle 1z0-061 : Practice Exam
B. Option B
C. Option C
D. Option D

Answer: A

Question No : 4

View the Exhibit and examine the data in the products table.

You need to display product names from the products table that belong to the
'software/other' category with minimum prices as either S2000 or S4000 and no unit of
measure.

You issue the following query:

Which statement is true regarding the above query?

A. It executes successfully but returns no result.


B. It executes successfully and returns the required result.
C. It generates an error because the condition specified for PROD_UNIT_OF_MEASURE
is not valid.
D. It generates an error because the condition specified for the prod category column is not
valid.

Answer: A

Leaders in it certification 5
Oracle 1z0-061 : Practice Exam
Question No : 5

The customers table has the following structure:

You need to write a query that does the following tasks:

1. Display the first name and tax amount of the customers. Tax is 5% of their credit limit.

2. Only those customers whose income level has a value should be considered.

3. Customers whose tax amount is null should not be considered.

Which statement accomplishes all the required tasks?

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

Answer: B

Leaders in it certification 6
Oracle 1z0-061 : Practice Exam
Question No : 6

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. Option A
B. Option B
C. Option C
D. Option D

Answer: A
Explanation:
The SUBSTR(string, start position, number of characters) function accepts three
parameters and returns a string consisting of the number of characters extracted from the
source string, beginning at the specified start position:

substr('http://www.domain.com', 12, 6) = domain


The position at which the first character of the returned string begins.
When position is 0 (zero), then it is treated as 1.
When position is positive, then the function counts from the beginning of string to find the
first character.
When position is negative, then the function counts backward from the end of string.
substring_length
The length of the returned string. SUBSTR calculates lengths using characters as defined
by the input character set. SUBSTRB uses bytes instead of characters. SUBSTRC uses
Unicode complete characters.

Leaders in it certification 7
Oracle 1z0-061 : Practice Exam
SUBSTR2 uses UCS2 code points. SUBSTR4 uses UCS4 code points.
When you do not specify a value for this argument, then the function

The INSTR(source string, search item, [start position], [nth occurrence of search item])
function returns a number that represents the position in the source string, beginning from
the given start position, where the nth occurrence of the search item begins:
instr('http://www.domain.com', '.', 1, 2) = 18

Question No : 7

Which two statements are true regarding single row functions?

A. MOD: returns the quotient of a division


B. TRUNC: can be used with number and date values
C. CONCAT: can be used to combine any number of values
D. SYSDATE: returns the database server current date and time
E. INSTR: can be used to find only the first occurrence of a character in a string
F. TRIM: can be used to remove all the occurrences of a character from a string

Answer: B,D
Explanation:
ROUND: Rounds value to a specified decimal
TRUNC: Truncates value to a specified decimal
MOD: Returns remainder of division
SYSDATE is a date function that returns the current database server date and time.

Date-Manipulation Functions
Date functions operate on Oracle dates. All date functions return a value of the DATE data
type except MONTHS_BETWEEN, which returns a numeric value.
MONTHS_BETWEEN(date1, date2): Finds the number of months between date1 and
date2. The result can be positive or negative. If date1 is later than date2, the result is
positive; if date1 is earlier than date2, the result is negative. The noninteger part of the
result represents a portion of the month.
ADD_MONTHS(date, n): Adds n number of calendar months to date. The value of n must
be an integer and can be negative.
NEXT_DAY(date, 'char'): Finds the date of the next specified day of the week ('char')
following date. The value of char may be a number representing a day or a character

Leaders in it certification 8
Oracle 1z0-061 : Practice Exam
string.
LAST_DAY(date): Finds the date of the last day of the month that contains date
The above list is a subset of the available date functions. ROUND and TRUNC number
functions can also be used to manipulate the date values as shown below:
ROUND(date[, 'fmt']): Returns date rounded to the unit that is specified by the format model
fmt. If the format model fmt is omitted, date is rounded to the nearest day.
TRUNC(date[, 'fmt']): Returns date with the time portion of the day truncated to the unit that
is specified by the format model fmt. If the format model fmt is omitted, date is truncated to
the nearest day.

The CONCAT Function


The CONCAT function joins two character literals, columns, or expressions to yield one
larger character expression. Numeric and date literals are implicitly cast as characters
when they occur as parameters to the CONCAT function. Numeric or date expressions are
evaluated before being converted to strings ready to be concatenated. The CONCAT
function takes two parameters. Its syntax is CONCAT(s1, s2), where s1 and s2 represent
string literals, character column values, or expressions resulting in character values.
The INSTR(source string, search item, [start position], [nth occurrence of search item])
function returns a number that represents the position in the source string, beginning from
the given start position, where the nth occurrence of the search item begins:
instr('http://www.domain.com', '.', 1, 2) = 18
The TRIM function literally trims off leading or trailing (or both) character strings from a
given source string:

Question No : 8

Examine the structure of the sales table:

Leaders in it certification 9
Oracle 1z0-061 : Practice Exam
Evaluate the following create table statement:

Which two statements are true about the creation of the SALES1 table?

A. The SALES1 table is created with no rows but only a structure.


B. The SALES1 table would have primary key and unique constraints on the specified
columns.
C. The SALES1 table would not be created because of the invalid where clause.
D. The SALES1 table would have not null and unique constraints on the specified columns.
E. The SALES1 table would not be created because column-specified names in the select
and create table clauses do not match,

Answer: A,D

Question No : 9

In which three situations does a transaction complete?

A. When a DELETE statement is executed


B. When a ROLLBACK command is executed
C. When a PL/SQL anonymous block is executed
D. When a data definition language (DDL) statement is executed
E. When a TRUNCATE statement is executed after the pending transaction

Answer: B,D,E

Question No : 10

Evaluate the following SQL commands:

Leaders in it certification 10
Oracle 1z0-061 : Practice Exam

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

Leaders in it certification 11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy