You are on page 1of 8

1. What are the different types of joins?

 
2. Explain normalization with examples. 
3. What cursor type do you use to retrieve multiple recordsets? 
4. Diffrence between a “where” clause and a “having” clause 
5. What is the difference between “procedure” and “function”? 
6. How will you copy the structure of a table without copying the data? 
7. How to find out the database name from SQL*PLUS command prompt? 
8. Tadeoffs with having indexes 
9. Talk about “Exception Handling” in PL/SQL? 
10.What is the diference between “NULL in C” and “NULL in Oracle?” 
11.What is Pro*C? What is OCI? 
12.Give some examples of Analytical functions. 
13.What is the difference between “translate” and “replace”? 
14.What is DYNAMIC SQL method 4? 
15.How to remove duplicate records from a table? 
16.What is the use of ANALYZing the tables? 
17.How to run SQL script from a Unix Shell? 
18.What is a “transaction”? Why are they necessary? 
19.Explain Normalizationa dn Denormalization with examples. 
20.When do you get contraint violtaion? What are the types of constraints? 
21.How to convert RAW datatype into TEXT? 
22.Difference ­ Primary Key and Aggregate Key 
23.How functional dependency is related to database table design? 
24.What is a “trigger”? 
25.Why can a “group by” or “order by” clause be expensive to process? 
26.What are “HINTS”? What is “index covering” of a query? 
27.What is a VIEW? How to get script for a view? 
28.What are the Large object types suported by Oracle? 
29.What is SQL*Loader? 
30.Difference between “VARCHAR” and “VARCHAR2  datatypes. 
31.What is the difference among “dropping a table”, “truncating a table” and
“deleting all records” from a table. 
32.Difference between “ORACLE” and “MICROSOFT ACCESS” databases. 
33.How to create a database link? 
Read all | Browse topics: Database 
FloatingFrame

FloatingFrame

32 Comments » 
1. Qestion No 1.
Different Types of Joins­
Inner Join
Outer Join ­ Right Outer Join
Left Outer Join
Cross Join 
Tech Interviews comment by Sanjay 
2. Answer to question number 2: Please refer http://dev.mysql.com/tech­
resources/articles/intro­to­normalization.html 
Tech Interviews comment by Jim 
3. 6. How will you copy the structure of a table without copying the data? 
create table xyz
as ( select * from abc where 1=0) 
Tech Interviews comment by Zuber 
4. Questoin 27: View is a logical perspective of a Table. It is a predefined set of
query on a table through which we can perform any kind of select queries instead
of redefining the condition every time. Update or Insert Statements cannot be
performed through this. 
Tech Interviews comment by Vikram 
5. Question 27: Sorry, Update or Insert statements cannot be performed ON View. 
Tech Interviews comment by Vikram 
6. Joins are used in queries to explain how different tables are related. Joins also let
you select data from a table depending upon data from another table. 
Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs
are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL
OUTER JOINS. 
Tech Interviews comment by ash 
7. Question 27: Sorry, Update or Insert statements cannot be performed ON View.
No. As I know, if a view meets certain criteria you can update it and such
operation will be reflected in the original table. Also, if you are using materialized
view, you can insert or update it. 
Tech Interviews comment by ZHOU 
8. Qn24 : it’s a piece of sql that is activitied when a certain event happens. 
Tech Interviews comment by Dhanya 
9. Qestion 4:
The order of the clauses in a query syntax using a GROUP BY clause is as
follows:
select …where..group by…having…order by…
Where filters, group by arranges into groups, having applies based on group by
clause. Having is applied with group by clause. 
Tech Interviews comment by Srini M 
10.Question 3:
REF cursor in oracle 
Tech Interviews comment by Srini M 
11.Q & A:
# What cursor type do you use to retrieve multiple recordsets?
REF Cursor
# Diffrence between a “where” clause and a “having” clause
See above, my comment
# What is the difference between “procedure” and “function”?
I think, one returns a value, the other does not.
# How will you copy the structure of a table without copying the data?
create table New_tbl as select * from Old_tbl where rownum 
Tech Interviews comment by Srini M 
12.Answer of
6. How will you copy the structure of a table without copying the data?
is
select top 0 * into xyz from try
not
create table xyz
as ( select * from abc where 1=0) 
Tech Interviews comment by SAYED FAROOQ ALI 
13.Qn0=>4 Diffrence between a “where” clause and a “having” clause
Answers
1.”where” is used to filter records returned by “Select”
2.”where” appears before group by clause
3.In “where” we cannot use aggrigate functions like where count(*)>2 etc
4.”having” appears after group by clause
5.”having” is used to filter records returned by “Group by”
6.In”Having” we can use aggrigate functions like where count(*)>2 etc
there are two more 
Tech Interviews comment by SAYED FAROOQ ALI 
14.24 Trigger is also set of sql comments written together same as stored procedure
but the difference is that trigger will be activated each & everytime addition or
deletion takes place. 
Tech Interviews comment by Archana 
15.31 DROP…..It will drop the table completely.(all values& table structure)
TRUNCATE……All the values in the table will be deleted.(the structure wont be)
DELETE….Can be use to delete particular row or all values i table.(structure
wont be deleted) 
Tech Interviews comment by Archana 
16.32 ORACLE ….can be use with a no of platform eg unix,windown,solaris.SQL
that is use for retriving data from oracle is known as Transact SQL.ORACLE is
very big database compare with MSAcess.
MSAcess……Can be use with windows only.SQL use is known just as SQL. 
Tech Interviews comment by Archana 
17.The basic difference between oracle and MS access is that oracle is a database
server and access is on a single user database not a server. 
Tech Interviews comment by Shikhar 
18.Q.15 How to remove duplicate records from a table?
Sol. DELETE FROM table_name WHERE id=1 LIMIT 1; 
Tech Interviews comment by Shikhar 
19.Answer to question. 28 . –> What are the Large object types suported by Oracle?
1)bfile ­ Up to 4 gigabytes –> File locators that point to a read­only binary object
outside of the database
2)blob ­ Up to 4 gigabytes. –> LOB locators that point to a large binary object
within the database
3)clob ­ Up to 4 gigabytes. –> LOB locators that point to a large character object
within the database
4)nclob ­ Up to 4 gigabytes. –>LOB locators that point to a large NLS character
object within the database 
Tech Interviews comment by Bhuvana 
20.Q. 28
What are the Large object types suported by Oracle?
These are the large object type supported bye oracle
• CLOB and LONG for large fixed­width character data
• NCLOB for large fixed­width national character set data
• BLOB and LONG RAW for storing unstructured data
• BFILE for storing unstructured data in operating system files 
Tech Interviews comment by Soji 
21.Q 33. How to create a database link?
A database link is an object in the local database that allows you to access objects
on a remote database or to mount a secondary database in read­only mode.
CREATE [PUBLIC] DATABASE LINK dblink
[CONNECT TO user IDENTIFIED BY password]
[USING ‘connect_string’] 
Tech Interviews comment by Soji Joseph 
22.q.32 Difference between “ORACLE” and “MICROSOFT ACCESS” databases.
MSA support only in windows platforms. But oracle available in all platforms.
No security and there is no conceprs of schema,users,privilages in access. Aceess
is used in small and medium organizations. Oracle is a collection of large no
database tools for mangaing data. 
Tech Interviews comment by Soji Joseph 
23.q.29 What is SQL*Loader? 
SQL*Loader is a bulk loader utility used for moving data from external files into
the Oracle database. One can load data into an Oracle database by using the sqlldr
(sqlload on some platforms) utility. 
Tech Interviews comment by Soji Joseph 
24.The statement’s makeup is unknown until run time then such statements can
change from execution to execution. They are aptly called dynamic SQL
statements.The main advantage of DYnamic Sql $ is it Accept or build dynamic
SQL statements that contain an unknown number of select­list items or place­
holders and Take explicit control over datatype conversion between Oracle9i and
COBOL types
This is example of update statemnet that comply Dynamic Sql 4
MOVE ‘UPDATE EMP SET COMM = :C WHERE EMPNO = :E’ TO STMT. 
Tech Interviews comment by Soji Joseph 
25.Q.14
Please refer http://download­
west.oracle.com/docs/cd/B10501_01/appdev.920/a97269/pc_13dyn.htm#688 
Tech Interviews comment by Soji Joseph 
26.Q.17
The below example shows how to interact oracle from Shell script
sqlplus /nolog 
Tech Interviews comment by Soji Joseph 
27.command to connect sql plus from Shell Script
sqlplus /nolog 
Tech Interviews comment by Soji Joseph 
28.Exception Handling in PL/SQL.
2 types of Exception In User­defined & Pre­defined.Any Error can be Handled by
Pre­defined Exception Handler (Ex. no_data_found,too_many_rows etc.)
In User­defined exception has to declare in Declaration section and any exception
can be handled by that Exception name.
Any types of Exception(User­defined & Pre­defined) can be Handled by When
Others exception Handler. 
Tech Interviews comment by Rudra Khatai 
29.Question.9 ­ Exception Handling in PL/SQL.
2 types of Exception In User­defined & Pre­defined.Any Error can be Handled by
Pre­defined Exception Handler (Ex. no_data_found,too_many_rows etc.)
In User­defined exception has to declare in Declaration section and any exception
can be handled by that Exception name.
Any types of Exception(User­defined & Pre­defined) can be Handled by When
Others exception Handler. 
Tech Interviews comment by Rudra Khatai 
30.there are three types of joins
1 Cross join
2 Inner Join(Equy join)
3 Outer join —–a) left outer b)Right outer c) Full outer join 
Tech Interviews comment by Birendra Singh Bisht 
31.Question 4: In SQL Server, procedures and functions can return values. (In
Oracle, procedures cannot directly return a value). 
The major difference with a function is that it can be used in a value assignment.
Such as:
–system function
Declare @mydate datetime
Set @mydate = getdate()
–user function (where the user has already coded the function)
Declare @My_area
Set @My_area = dbo.fn_getMy_area(15,20) 
Tech Interviews comment by KarmaBlast 
32.User can perform update/insert on a view unless the user tries to update/insert any
row which can affect any IDENTITY column(in case of Sybase)of the table. The
changes will be reflected onto the original table itself. 

You might also like