Oracle Flashcards

0
Q

SQL

A

Structured query language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Relational db

A

Uses relations or two-dimensional tables to store information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ANSI

A

American national standards institute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Data retrieval operator

A

Select

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

DML

A

Data manipulation language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

DML operators

A

Insert
Update
Delete
Merge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

DDL

A

Data definition language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

DDL operators

A
Create
Alter
Drop
Rename
Truncate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Transactional control operators

A

Commit
Rollback
Savepoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

DCL

A

Data control language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

DCL operators

A

Grant

Revoke

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Suppress duplicates keyword

A

Distinct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Arithmetic expressions containing null evaluate to …

A

null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Oracle SQL concatenation operator

A

||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Literal value is .., … or …

A

character, number or date

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Display strucutre of table in SQL*Plus

A

Desc[ribe]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

‘Like’ condition wildcard for one character

A

_

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

‘Like’ condition wildcard for zero or many character

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Rules of precedence

A
Arithmetic
Concatenation
Comparison
LIKE, IS NULL, IN
BETWEEN
NOT
AND
OR
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Order by default order

A

Ascending

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Reverse order by order with

A

desc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Oracle functions can be

A

Single-row and multiple-row

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Single-row functions hierarchy

A
Character
Number
Date
Conversion
General (nvl, nullif, case, decode)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Character functions can be

A

Case-manipulation and character-manipulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Case-manipulation functions
Lower Upper Initcap
25
Character-manipulation
``` Concat Substr Length Instr Lpad rpad Trim Replace ```
26
Number functions
Round Trunc Mod
27
Default date format
DD-MON-RR
28
Translate Explicit
Явный
29
Coalesce
Returns the first non-null expression in the expression list
30
Nullif
Returns null if expressions are equal, returns 1 expression if not
31
SQL Conditional expressions
Case | Decode
32
When join is omitted or invalid we recieve
Cartesian product
33
Equijoin Simple join Inner join
Values on both tables must be equal
34
Nonequijoin
Condition contains other than an equality operator
35
When outer join is used
To see rows that do not meet the join condition
36
Where does the + resides (outer join)?
Table with missing information
37
Cross join is equal to
Cartesian product
38
Natural join is based on
all columns in 2 tables that have the same name. | Columns should be of the same type
39
Natural join with the using clause
can be used as equijoin
40
Group founction operate on ... to give ...
sets of rows to give one result per group
41
All group functions ... null values
ignore
42
Clause to restrict groups
Having
43
Group functions can be nested to a depth ...
of two
44
Multiple-row comparison operators
IN Any All
45
SQL placeholder for var name
&
46
WITH CHECK OPTION
progibits from changing rows that are not in the subquery
47
Merge statement provides the ability
to conditionally update or insert data | Performs update if the row exists and insert otherwise
48
Merge syntax
``` merge into table_name as table_alias using (table|view|sub_query) as alias on (join condition) when matched then update set col1 = col1_val, col2 = col2_val when not matched then insert (column_list) values (column_values) ```
49
Transaction ends when
Commit or rollback is issued DDL or DCL executes (auto commit) User exits System crashes
50
If a snigle DML fails what is rolled back?
Only that statement. Oracle implements an implicit savepoint. Other changes are retained and should be terminated explicitly.
51
Уровни изолированности транзакций
Read uncommited Read commited Repeatable read Serializable
52
Как в oracle включить уровень изолированности serializable?
alter session set isolation_level = serializable
53
Oracle lock modes:
Exclusive | Share
54
Oracle table naming rules
``` Begin with a letter 1 to 30 characters long Contain A-Z, a-z, 0-9, _, $, # Unique Not reserved word ```
55
Default keyword can be used
When creating tables | In insert statement
56
Tables in Oracle are divided into 2 groups:
User | Data dictionary
57
Oracle datatypes
``` Varchar2(n) Char[(n)] Date Long Lob, clob, blob Raw, long raw Bfile Rowid ```
58
Rowid is
Hexadecimal string representing the unique address of a row in table
59
Bfile is
Binary data stored in an external file
60
Clob is
Character data up to 4 Gb
61
How to mark column as unused in Oracle?
Set unused
62
Truncate table statement ...
Removes all rows | Releases the storage space
63
Can truncate be rollbacked?
No
64
Table DDL statements
``` Create Alter Drop Rename Truncate Comment ```
65
Constraints are
rules at table level
66
FK constraint keywords
Foreign key References On delete cascade On delete set null
67
Constraint types
``` Not null Unique Primary key Foreign key Check ```
68
Force keyword when creating view means
view will be created regardles of whether or not the base table exists
69
With check option when creating view
only rows accessible to the view can be inserted or updated
70
With read only when creating view
no DML can be performed on the view
71
Cannot add data through view if view includes:
``` Group functions Group by Distinct Rownum Columns defined by expressions Not null columns in tables not selected by view ```
72
Inline view is
a subquery with an alias
73
Top-n analysis SQL structure
Select column_list, rownum from (select column_list from t order by 1) where rownum <= N
74
What is a sequence?
Sharable DB object for generating integers
75
Sequence pseudocolumns
Nextval and currval
76
When Nextval and Currval cant be used?
``` Select list of view Select with distinct Select with group by, having, order by Subquery in select, delete or update Default in create table or alter table ```
77
What is and index?
Schema object that cna speed up the retrival of rows by using a pointer.
78
When not to create index?
``` Small table Columns are not used in query condition Most queries retrieve > 4% data Table is updated frequently Indexed columns are referenced as part of expression ```
79
Set operatiors
Union/Union all Intersect Minus
80
What is the difference between union and union all?
Union eliminates duplicates
81
Rollup operator
Used with group by to generate subtotals
82
Cube operator
Used with group by to generate subtotals and produces all possible combination of groups
83
Scalar subquery
returns exactly one column value from one row
84
Correlated subquery
executes for each row
85
Exists operator
tests for existence of rows in th results set of the subquery
86
With clause
is used for reusing sql block