Oracle interview Questions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Oracle Concepts and Architecture
Qus. 7. Difference between SUBSTR and INSTR?
Ans: INSTR (String1, String2 (n, (m)),
INSTR returns the position of the m-th occurrence of the string 2 in string1.
The search begins from nth position of string1.
SUBSTR (String1 n, m)
SUBSTR returns a character string of size m in string1, starting from n-th
position of string1.
Qus. 8. Explain UNION, MINUS, UNION ALL and INTERSECT?
Ans: INTERSECT - returns all distinct rows selected by both queries.
MINUS - returns all distinct rows selected by the first query but not by the
second.
UNION - returns all distinct rows selected by either query
UNION ALL - returns all rows selected by either query, including all
duplicates.
Qus. 9. What is ROWID?
Ans: ROWID is a pseudo column attached to each row of a table. It is
18 characters long, blockno, rownumber are the components of ROWID.
Qus. 0. What is the fastest way of accessing a row in a table?
Ans: Using ROWID.
CONSTRAINTS
Qus. 1. What is an integrity constraint?
Ans: Integrity constraint is a rule that restricts values to a column in a
table.
Qus. 2. What is referential integrity constraint?
Ans: Maintaining data integrity through a set of rules that restrict the
values of one or more columns of the tables based on the values of primary key
or unique key of the referenced table.
Qus. 3. What is the usage of SAVEPOINTS?
Ans: SAVEPOINTS are used to subdivide a transaction into smaller
parts. It enables rolling back part of a transaction. Maximum of five save
points are allowed.
Qus. 4. What is ON DELETE CASCADE?
Ans: When ON DELETE CASCADE is specified Oracle maintains referential
integrity by automatically removing dependent foreign key values if a
referenced primary or unique key value is removed.
Qus. 5. What are the data types allowed in a table?
Ans: CHAR, VARCHAR2, NUMBER, DATE, RAW, LONG and LONG RAW.
Qus. 6. What is difference between CHAR and VARCHAR2? What is the maximum
SIZE allowed for each type?
Ans: CHAR pads blank spaces to the maximum length.
VARCHAR2 does not pad blank spaces.
For CHAR the maximum length is 255 and 2000 for VARCHAR2.
Qus. 7. How many LONG columns are allowed in a table? Is it possible to use
LONG columns in WHERE clause or ORDER BY?
Ans: Only one LONG column is allowed. It is not possible to use LONG column
in WHERE or ORDER BY clause.
Qus. 8. What are the pre-requisites to modify datatype of a column and to add
a column with NOT NULL constraint?
Ans: - To modify the datatype of a column the column must be empty.
- To add a column with NOT NULL constrain, the table must be empty.
.1 2 3 4 5 6 7 8 9 10 11 12 13
14 15