You are on page 1of 12

1. What is an oracle instance?

2. What is a view?
3. What is referential integrity?
4. Name the data dictionary that stores user-defined constraints?
5. What is a collection of privileges?
6. What is a snapshot?
7. What is a synonym?
8. What is a cursor?
9. What is a sequence?
10. What is a trigger?
11. What is an exception?
12. What is a partition of table?
13. What are pseudo-columns in SQL? Provide examples.
14. What are the Data Control statements?
15. What is a schema?
16. What is a type?
17. What is a data model?
18. What is a relation?
19. Advantages of redo log files?
20. What is an Archiver?
21. What is a database buffer cache?
22. What are the background processes in Oracle?
23. %type and %rowtype are attributes for…?
24. What are the steps in a two-phase commit?
25. What is a union, intersect, minus?
26. What is a join, explain the types of joins?
27. What is a co-related sub-query?
28. ODBC stands for…?
29. Data-type used to work with integers is?
30. Describe data models?
31. Describe the Normalization principles?
32. What are the types of Normalization?
33. What is de-normalization?

1. What is an Oracle instance?

Overview of an Oracle Instance

Every running Oracle database is associated with an Oracle instance. When a


database is started on a database server (regardless of the type of computer),
Oracle allocates a memory area called the System Global Area (SGA) and
starts
one or more Oracle processes. This combination of the SGA and the Oracle
processes is called an Oracle instance. The memory and processes of an
instance
manage the associated database’s data efficiently and serve the one or multiple
users of the database.

The Instance and the Database

After starting an instance, Oracle associates the instance with the specified
database. This is called mounting the database. The database is then ready to
be
opened, which makes it accessible to authorized users.

Multiple instances can execute concurrently on the same computer, each


accessing
its own physical database. In clustered and massively parallel systems (MPP),
the Oracle Parallel Server allows multiple instances to mount a single database.

Only the database administrator can start up an instance and open the database.
If a database is open, the database administrator can shut down the database so
that it is closed. When a database is closed, users cannot access the
information that it contains.

Security for database startup and shutdown is controlled via connections to


Oracle with administrator privileges. Normal users do not have control over
the
current status of an Oracle database.

Q: What is a view?

View

A view is a tailored presentation of the data contained in one or more tables


(or other views). Unlike a table, a view is not allocated any storage space, nor
does a view actually contain data; rather, a view is defined by a query that
extracts or derives data from the tables the view references. These tables are
called base tables.

Views present a different representation of the data that resides within the
base tables. Views are very powerful because they allow you to tailor the
presentation of data to different types of users.

Views are often used to:

• provide an additional level of table security by restricting access to a


predetermined set of rows and/or columns of a table
• hide data complexity
• simplify commands for the user
• present the data in a different perspective from that of the base table
• isolate applications from changes in definitions of base tables
• express a query that cannot be expressed without using a view

What is referential integrity?

Rules governing the relationships between primary keys and foreign keys of
tables within a relational database that determine data consistency. Referential
integrity requires that the value of every foreign key in every table be matched
by the value of a primary key in another table.

Tech Interviews comment by JH Surya Kanth

2. Name the data dictionary that stores user-defined constraints?


USER_CONSTRAINTS

Tech Interviews comment by Krishna

3. What is a collection of privileges?


user_tab_privs_made
user_tab_privs_recd

Tech Interviews comment by Krishna

4. Snapshot: A snapshot is a read-only copy of a table or a subset of a table.

Tech Interviews comment by Krishna

5. Can i execute Stored Procedures & Functions from SQL prompt ? If yes how
can i execute ?

Tech Interviews comment by Koteswara Rao

6. Hi Krishna
What is a collection of privileges?
collection of privilages is role.
sasi242@yahoo.com

Tech Interviews comment by Sasidhar

7. What is a cursor?
Ans:
cursor is a private sql work area used to perform manipulations on data using
pl\sql.
adv:
1.mainly used for multiple row manipulations and locking columns.
note: data which is populated into the cursor is known as active dataset.
cursors are of two types
1.implicit
2.explicit
implicit
———
attributes or properties for implicit cursor
1.sql%is open:attribute returns a boolean value stating wether the cursor is
open or closed.
2.sql % found: returns boolean value stating whether the record is found in the
cursor.
3.sql%notfound : returns a boolean value stating whether the record is not
found in the cursor
4.sql %rowcount :returns a pneumeric value stating no.of rows executed in the
cursor.

explicit cursors—retrives multiple rows.


************
adv: users can perform locks on th data in the cursor
attributes
1.% is open
2.% found
3.% not found
4.% rowcount

Note: DATA which is populated in the cursor is known as active data set.

WE CAN WRITE TWO CURSORS IN ONE PROGRAM

WE CAN WRITE A CURSOR SPECIFYING PARAMETERS

CURSOR WITH UPDATE CLAUSE IS USED TO PERFORM LOCKS ON


DATA.
Happy Coding
sasi242@yaho.com

Tech Interviews comment by Sasidhar

8. What is a sequence?
Ans:It is a database object to auto generate numbers.
Happy Coding
sasi242@yahoo.com

Tech Interviews comment by Sasidhar

9. Name the data dictionary that stores user-defined Stored procedures?


ans :- user_objects
Tech Interviews comment by Aravind Kumar

10. hi ,
i would like know more about sql advanced queries .

Tech Interviews comment by mrs

11. Question:Why Use Sql* Loader in Oracle Database?


Answer: The Sql Loader module of the oracle database Management System
loads data into an existing ORACLE table from an external files.It is available
locally only on CMS and PCs with oracle version 5. Throughout this
documentation the CAR database described in Referance A is used for
illustration.
There are several methods others than using SQL *Loader of inserting data
into a table.
1. The Sql insert command may be used from the SQL * Plus module,
for Example :
insert into CAR values(…)
where the values to be inserted into a row of the table are listed inside the
parentheses. Dates and Characters data must be Surrounded by single quotes;
items are seperated by commas.
2. Sql*Forms allows you to add rows interactively using forms. The forms may
contain default values and checks for invalid data.
3. ODL loads the table from a control file and separate fixed format data file.
ODL is available on all versions of ORACLE . SQL * Loader is much more
flexible than ODL and will eventually supersede it on all systems.

Tech Interviews comment by Shashi

12. We can execute a function in sql query

select functionname(paramaters) from dual;

Suppose i am created a function add which returns the addition of two numbers
then

select add(3,4) from dual;


7

ODBC stands for open database connectivity

trigger is a stored procedure which auotomatically fired on a table whenever


any dml operation is affected in the table.
we can create ddl trigger,database trigger(logon,logoff,startup,startoff),audit
triggers
pseudo column the column which does not exist in a table
ex;rownum,rowid,level etc

Tech Interviews comment by Dinkocet

13. Thanks a lot for providing answers for the above questions…i am grateful to
all of you

Regards

Ravi Prakash

Tech Interviews comment by Ravi Prakash

14. Answer to some of the questions above:


ODBC stands for Open Database Connectivity. It is used to connect the
frontend with the backend(database)

Normalization is the techinque of designing the database with the least


redundancy and duplicacy of data. Types of Normalization:
1 NF
2 NF
3 NF
BCNF
5 NF
6NF : Impossible to achieve this level of normalization

Tech Interviews comment by Vick

15. hi
i have problem with import
i have export file on linux os and oracle8i
i want import on windows platform
what should i do?

Tech Interviews comment by rekhalal

16. Hi Krishna ,
Thanks a lot for the Answers

Tech Interviews comment by sangeetha

17. Hi All,

Thank you for all posting the Q & A.

Tech Interviews comment by Pranesh


18. what is a synonym ?

Ans. A synonym is an alternative name for tables,views,procedures and other


database objects
generally when we have more than one schema and we wish to access an
object of a different schema then we create synonyms for that object in the
schema where we wish to access the object.

Syntax:
create synonym synonym-name for schemaname.object-name

what is an exception ?

Exception is an event that causes suspension of normal program execution.


In oracle there are serveral types of exceptions
1) Pre-defined exceptions like NO_DATA_FOUND,TOO_MANY_ROWS
2) User-defined exceptions which would validate the business logic
3) unnamed system exceptions which are raised due to errors in the application
code .. you can name these exceptions using PRAGMA EXCEPTION_INIT
4)Unnamed programmer-defined exceptions. Exceptions that are defined and
raised in the server by the programmer. In this case, the programmer provides
both an error number (between -20000 and -20999) and an error message, and
raises that exception with a call to RAISE_APPLICATION_ERROR.

for all the exceptions raised oracle fills in sqleerm and sqlcode variable which
provide the error message and error code for the exception raised.

What are pseudo-columns in SQL? Provide examples?

A pseudocolumn behaves like a table column, but is not actually stored in the
table. You can select from pseudocolumns, but you cannot insert, update, or
delete their values.

Examples:
CURRVAL,NEXTVAL,ROWID,LEVEL

what is a schema ?
A schema is a oracle database user account.

Tech Interviews comment by Rajesh B

19. What is a schema ?

A database user account is called a schema.

Tech Interviews comment by thevampirea@yahoo.co.in


20. What is a schema ?
A schema is a logical collection of database objects like tables, views, pkgs,
procedures, triggers, etc. It usually has an associated database user.

Tech Interviews comment by Anil Kuppa

21. this is just to subscribe

Tech Interviews comment by Natraj

22. What is a co-related sub-query?

It is very similar to sub-queries where the parent query is executed based on


the values returned by sub-quries. but when come’s to co-related subqueries for
every instance of parent query subquery is executed and based on the result od
sub-query the parent query will display the record as we will have refernce of
parent quries in su-queries we call these as corelated subquries.

so, we can define co-related sub query as for every record retrival from the sub
query is processed and based on result of process the parent record is
displayed.

Tech Interviews comment by Natraj

23. wht is the major difference b/w oracle 8i & 9i

Tech Interviews comment by renjith

24. what is trigger?


Trigger is an event. It is used prevent the invalid entries of the data.There
has a different types of trigger are available.
1)rowlevel trigger
before insert,before delete,before update
after insert,after delete,after update
2)statement level trigger
before insert,before delete,before update
after insert,after delete,after update
3)INSTEAD OF trigger
4)Schema level Triggers
5)System level Triggers

Tech Interviews comment by Ramananth

25. co-related sub-query - I assume you mean correlated sub-query?

Tech Interviews comment by Mark


26. Hi
i want to get information about coalescing to tablespace?
Send theinformation to me through the mail id i have mentioned above.

Regards
Lucky

Tech Interviews comment by Lucky

27. i want to know how to use rownum and rowid efficiently in sql*plus queries

Tech Interviews comment by sudha

28. hi
will u plezzzz tell me
can we return cursor in the function if yes than what the process?
can we define exceptions twice in same block?
what is max. no. of statment that can specified in triggers?
in cursor where the cursor variable used in package body?

Tech Interviews comment by lekha reddy

29. is there any solution to delete a particular colum in a database by sql

Tech Interviews comment by manraj

30. How can I assigned two table in a single block (database block) in forms6i?

Tech Interviews comment by Sudipta

31. Q. Is there any solution to delete a particular colum in a database by sql?


A. This is cant be done in versions before 9i.
In 9i
SQL> alter table delete column ;

Tech Interviews comment by Gaurav Sachan

32. pseudo columns in sql are currval and nextval.These are used with sequences
to retreive the next sequence value and current sequence value.
The usage is as follows
suppose abc is the sequence name if i want to see the currval of the sequence
we issue the sql statement
select abc.currval from dual;
if we want to see the next value of the sequence we issue the command
select abc.nextval from dual;

Tech Interviews comment by satish


33. Hi here i would like to give simple answer for question #1
What is an oracle instance?
An Oracle instance consists of the System Global Area (SGA) memory
structure and the background processes used to manage a database. An instance
is identified by using methods specific to each operating system. The instance
can open and use only one database at a time.

Srinivasa Reddy

Tech Interviews comment by Srinivasa Reddy

34. hi,
what is the major difference between normal FOR LOOP and CURSOR
LOOP?

-Regards
Muttappa S.T.

Tech Interviews comment by Muttappa S.T.

35. Hi,
when we install the new version of Oracle then what happens to our earlier
forms?

Tech Interviews comment by Ujjwala

36. what is overloading of packages in oracle

Tech Interviews comment by jyothi

37. is it possible to create a cursor which is based on more than one table.

Tech Interviews comment by vasundhara

38. The correct answer for this question is


Q. Is there any solution to delete a particular colum in a database by sql?
A. alter table drop column
or
first mark the column unused
alter table set unused column
then drop it
alter table drop unused columns.
This will drop all the columns marked as unused. If a particular column has to
be dropped, mention the column name after columns

Tech Interviews comment by Ram


39. the answer thevampirea@yahoo.co.in for “What is a schema?” is wrong.

A schema is a collection of logical objects owned by a user. A user in that


regard is an account registered with the Oracle server.

Once u login into ur account/user, u can access other user’s schema objects like
i can write scott.emp, if at all i’ve acces to scott user’s emp table.

Tech Interviews comment by rahul

40. Data Model: The logical data structure developed during the logical database
design process is a data model or entity model. It is also a description of the
structural properties that define all entries represented in a database and all the
relationships that exist among them.

%ROWTYPE is used to declare a record with the same types as found in the
specified database table, view or cursor
%TYPE is used to declare a field with the same type as that of a specified
table’s column.

Index for a physical structure (b-tree) to help you query run faster.
Table partition is a method of breaking a large table into smaller tables grouped
by some logical separators. in your case, having both index and partition will
make things faster.

Data Control statements


These are used to control the data using DCL (data control language) ex: Grant
etc.

Trigger : A program in a database that gets called each time a row in a table is
INSERTED, UPDATED, or DELETED. Triggers allow you to check that any
changes are correct, or to fill in missing information before it is commited.
Triggers are normally written in PL/SQL or Java.

Relation: Mathematical term for a table.

Redo Log: A set of files that record all changes made to an Oracle database. A
database MUST have at least two redo log files. Log files can be multiplexed
on multiple disks to ensure that they will not get lost. Also see thread.

Oracle ARCHiver Process. ARCH is an Oracle background process created


when you start an instance in ARCHIVE LOG MODE. The ARCH process
will archive on-line redo log files to some backup media.

Buffer Cache: The portion of the SGA that holds copies of Oracle data blocks.
All user processes that connect to an instance share access to the buffer cache.
Performance of the buffer cache is indicated by the BCHR (Buffer Cache Hit
Ratio).

Background Process: Non-user process that is created when a database


instance is started. These processes are used to manage and monitor database
operations. Example background processes: SMON, PMON etc.

Two-Phase Commit: A strategy in which changes to a database are temporarily


applied. Once it has been determined that all parts of a change can be made
successfully, the changes are permanently posted to the database. The steps
involved are the “prepared” and “commit request”

Union: All the distinct rows are selected by either query.


Intersect: All distinct rows selected by both queries
Minus: All distinct rows that are selected by the first SELECT statement and
that are not selected in the second SELECT statement.
Join: The process of combining data from two or more tables using matching
columns. Types of join are Equi Join, Outer Join, Self Join, Natural Join, etc.
Equi Join: An Equi Join (aka. Inner Join or Simple Join) is a join statement that
uses an equivalency operation (i.e: colA = colB) to match rows from different
tables. The converse of an equi join is a nonequijoin operation.
Outer Join: Similar to the Equi Join, but Oracle will also return non matched
rows from the tale with the outer join operator (+). Missing values are filled
with null values.
Self Join: A join in which a table is joined with itself.
Natural Join: A join statement that compares the common columns of both
tables with each other. One should check whether common columns exist in
both tables before doing a natural join.

Integer Data Types: VARCHAR2 (Size), NUMBER (Precision, Size)

Denormalization: The opposite of data normalization (almost). In a


denormalized database, some duplicated data storage is allowed. The benefits
are quicker data retrieval and/or a database structure that is easier for end-
users.

Regards.

Tech Interviews comment by Jenis John K

You might also like