Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
Faqs in Oracle

Faqs in Oracle

Ratings: (0)|Views: 6 |Likes:
Published by Mohammed Hafiz
Question on SQL query writing
Question on SQL query writing

More info:

Published by: Mohammed Hafiz on Mar 23, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

03/23/2013

pdf

text

original

 
Oracle FAQ
1.
Difference between group functions and single row functions.
 Group Function Single Row FunctionA group function operates A single row functionon many rows returns one and result for one row.returns single result.Not allowed in Pl/sql procedural Allowed in Pl/SqlProcedural statementsstatements.eg SUM(),AVG,MIN,MAX etc eg UPPER,LOWER,CHR...
2.
Difference between DECODE and TRANSLATE
 
DECODE is value by value TRANSLATE is character bycharacter replacement. replacement.Ex SELECT DECODE('ABC','A',1,'B',2,'ABC',3) eg SELECTfrom dual; o/p 3 TRANSLATE('ABCGH', 'ABCDEFGHIJ',1234567899)FROM DUAL; o/p 12378(DECODE command is used to bring IF,THEN,ELSE logic to SQL.It testsfor the IF values(s) and then aplies THEN value(s) when true, the ELSEvalue(s) if not.)
 
3.
Difference between TRUNCATE and DELETE
 
TRUNCATE deletes much faster than DELETE
 
Truncate Delete
It is a DDL statement It is a DML statementIt is a one way trip,cannot One can RollbackROLLBACKDoesn't have selective features (where clause) HasDoesn't fire database triggers DoesIt requires disabling of referential Does not requireconstraints.
 
Oracle FAQ1
 
4.
What is a CO-RELATED SUBQUERY
 
A CO-RELATED SUBQUERY is one that has a correlationname as table or view designator in the FROM clause of the outerquery and the same correlation name as a qualifier of a searchcondition in the WHERE clause of the subquery.
 
eg
SELECT field1 from table1 X WHERE field2>(select avg(field2) from table1 Y wherefield1=X.field1);
 
(The subquery in a correlated subquery is revaluatedfor every row of the table or view named in the outer query.)
 
5.
What are various joins used while writing SUBQUERIES
 
Self join
-Its a join foreign key of a table references the same table.
 
Outer Join
--Its a join condition used where One can query all therows of one of thetables in the join condition even though they don't satisfy the joincondition.
 
Equi-join
--Its a join condition that retrieves rows from one or moretables in which oneor more columns in one table are equal to one or more columns in thesecond table.
 
6.
What are various constraints used in SQL
 
NULLNOT NULLCHECKDEFAULT
 
7.
What are different Oracle database objects
 
TABLESVIEWSINDEXESSYNONYMSSEQUENCES
Oracle FAQ2
 
TABLESPACES etc 
 
8.
What is difference between Rename and Alias
 
Rename is a permanent name given to a table or column whereasAlias is a temporaryname given to a table or column which do not exist once the SQLstatement isexecuted.
 
9.
What is a view
 
A view is stored procedure based on one or more tables, it’s a virtualtable.
 
What are various privileges that a user can grant to anotheruser
 
SELECTCONNECTRESOURCES
 
10.
What is difference between UNIQUE and PRIMARY KEYconstraints
 
A table can have only one
PRIMARY KEY 
whereas there can be anynumber of 
UNIQUE 
keys.The columns that compose PK are automatically define NOT NULL,whereas a column that compose a
UNIQUE 
is not automatically definedto be mandatory must also specify the column is
NOT NULL.
 
11.
Can a primary key contain more than one columns
 
Yes
 
12.
How you will avoid duplicating records in a query
 
By using
DISTINCT 
 
Oracle FAQ3

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->