Академический Документы
Профессиональный Документы
Культура Документы
ExamEssentials
Understand the ORDER BY clause. The ORDER BY clause is used to sort the result
set from a query. You can specify ascending order or descending order for the sort.
Ascending order is the default. Also know that column alias names can be used in
the ORDER BY clause. You can also specify columns by their position.
Know how to specify string literals using the operator.
Know the order of clauses in the SELECT statement. The SELECT statement
must have a FROM clause. The WHERE clause, if it exists, should follow the FROM
clause and precede the ORDER BY clause.
Literal Character Strings
-Date and character literal values must be enclosed within single quotation marks.
SELECT last_name ||' is a '||job_id
AS "Employee Details"
FROM employees;
Know the use of the DUAL table. The DUAL table is a dummy table in Oracle
with one column and one row. This table is commonly used to get the values of
system variables such as SYSDATE or USER.
Know the characters used for pattern matching. The % character is used to
match zero or more characters .The _ character is used to match one, and only one,
character .The SQL operator used with a pattern-matching character is LIKE.
Know the sort order of NULL values inquiries with ORDER BY clause. By
default, in an ascending-orders or the NULL values appear at the bottom of the
result set; that is, NULLs are sorted higher. For descending-order sorts, NULL
values appear at the top of the result setagain, NULL values are sorted higher.
Page 1 of 17
ExamEssentials
Know the effect sthat NULL values can have on arithmetic and other functions.
Any arithmetic operation on a NULL results in a NULL. This is true of most
functions as well. Use the NVL, NVL2, and COALESCE functions to deal with NULLs.
Review the character-manipulation functions. Understand the arguments and
the result Of using character-manipulation functions such as INSTR, SUBSTR,
REPLACE, and TRANSLATE.
Page 2 of 17
ExamEssentials
Understand the numeric functions. Know the effects of using TRUNC and ROUND
with-nas the second argument. Also practice using LENGTH and INSTR, which
return a numeric result, inside SUBSTR and other character functions.
Know how date arithmetic works. When adding or subtracting numeric values
from a DATE datatype, whole numbers represent days. Also, the date/time
intervals INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND can be added
or subtracted from date/time datatypes. You need to know how to interpret and
create expressions that add intervals to or subtract intervals from dates.
Page 3 of 17
ExamEssentials
Know the data types for the various date/time functions. Oracle has many
date/time functions to support the date/time datatypes. You need to know the
return datatypes for these functions. SYSDATE and CURRENT_DATE return a DATE
datatype. CURRENT_TIMESTAMP and SYSTIMESTAMP return a TIMESTAMP WITH
TIMEZONE datatype. LOCALTIMESTAMP returns a TIMESTAMP datatype.
Understand the use of the DECODE function. DECODE acts like a case statement in
C,Pascal, or Ada.Learn how this function works and how to use it.
Page 4 of 17
ExamEssentials
Page 5 of 17
ExamEssentials
TO_CHAR function.
The TO_CHAR function converts a date or number to a TEXT expression in a
specified format. This function is typically used to format output data.
Note: Output format is specified in the expression itself.
TO_NUMBER function.
The TO_NUMBER function converts a formatted TEXT expression to a number.
SELECT TO_NUMBER('$1210.73', 'L9999.99') FROM DUAL
RESULT= 1210.73
Page 6 of 17
ExamEssentials
ExamEssentials
Understand the usage of DISTINCT in group functions. When
DISTINCT is specified, only one of each non-NULL value is applied to the
function. To apply all non-NULL values, the key word ALL should be used.
COUNT
COUNT(expr) returns the number of rows with non-null values for the expr.
COUNT(DISTINCT expr) returns the number of distinct non-null values of the expr.
SELECT COUNT(DISTINCT department_id)
FROM employees;
Know where group functions can be used. Group functions can be used in
GROUP BY, ORDER BY,and HAVING clauses.They cannot be used in WHERE
clauses.
Page 7 of 17
ExamEssentials
Know how MIN and MAX sort date and character data. Older dates
evaluate to lower values, while newer dates evaluate to higher values.
Character data, even if it contains numbers, is sorted according to the
NLS_SORT specification.
Know which expressions in a SELECT list must appear in a GROUP BY
clause. If any grouping is performed, all non group function expressions
and non constant expressions must appear in the GROUP BY clause.
Know the order of precedence for evaluating nested functions. You
may need to evaluate an expression containing nested functions. Make
sure you understand the left-to-right order of precedence used to evaluate
these expressions.
Page 8 of 17
ExamEssentials
Page 9 of 17
ExamEssentials
Page 10 of 17
ExamEssentials
CH 7 Manipulating Data
Know the syntax for the INSERT statement. When a subquery is used
to add rows to a table, the VALUES clause should not be used.
Practice UPDATE statements The UPDATE statement can update multiple
columns in the same row using a subquery. Multiple subqueries can also
be used to update columns in a single row.
Understand what will begin and end a transaction. A transaction will
begin with an INSERT, UPDATE, DELETE, MERGE, or SELECT FOR UPDATE
statement. A COMMIT or ROLLBACK will end a transaction. A DDL
statement can also end a transaction.
Know how to set and roll back to save points. Savepoints are set with
the SAVEPOINT statement. Data changes made after a savepoint are undone
when a ROLLBACK TO SAVEPOINT statement is executed. ROLLBACK TO
SAVEPOINT is a partial undo operation.
Understand the scope of data changes and consistency. Statement- level
consistency is automatic and will ensure that each SELECT will see an image
of the database consistent with the beginning of the statements execution.
Transaction-level consistency will ensure that all SELECT statements within
a transaction will see an image of the database consistent with the
beginning of the transaction
.
Page 11 of 17
ExamEssentials
Page 12 of 17
ExamEssentials
Know how a constraint can be defined. You can use the CREATE TABLE or
ALTER TABLE statement to define a constraint on the table.
Page 13 of 17
ExamEssentials
Know the precise syntax for obtaining sequence values. You should
understand how to use sequence_name. NEXTVAL and
sequence_name. CURRVAL to obtain the next and most recently
generated number from a sequence.
Page 14 of 17
ExamEssentials
Page 15 of 17
ExamEssentials
B-Tree Index
-Suited for high cardinality columns (columns having many distinct values)
-Excels at servicing simple queries( not having many OR & AND statements )
Bitmap Index
-Suited for high cardinality columns, male/femal, direction N , S , E, W.
The index expression is built from table columns, constants, SQL functions,
and user-defined functions.
Page 16 of 17
ExamEssentials
Page 17 of 17