ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 


 

Company >> DELL >> Interview Questions >> SQL PLSQL Interview Questions
 
  USA Dependent Visa H4 Visa Interview Questions (1)   Everything Else AllOther Interview Questions (1)   Teaching Interview Questions (1)
  General Knowledge_Current Affairs Interview Questions (1)   Call Centre AllOther Interview Questions (44)   Accounting AllOther Interview Questions (4)
  Human Resources Interview Questions (1)   Marketing Sales Interview Questions (1)   Engineering AllOther Interview Questions (1)
  SD Interview Questions (1)   ABAP Interview Questions (3)   VoIP IP Telephony Interview Questions (1)
  Project Management Interview Questions (1)   HR Questions Interview Questions (5)   SAS Interview Questions (1)
  Data Stage Interview Questions (1)   Cognos Interview Questions (1)   HTML DHTML Interview Questions (1)
  IBM MainFrame AllOther Interview Questions (1)   Servers AllOther Interview Questions (1)   Manual Testing Interview Questions (5)
  Load Runner Interview Questions (1)   Operating Systems General Concepts Interview Questions (1)   Linux Threads Interview Questions (1)
  SQL PLSQL Interview Questions (5)   SQL Server Interview Questions (1)   Dot Net Remoting Interview Questions (9)
  ADO.NET Interview Questions (2)   COM+ Interview Questions (3)   ASP.NET Interview Questions (14)
  Networking AllOther Interview Questions (1)   Networking Administration Interview Questions (1)   CGI Perl Interview Questions (1)
 
Back to Questions Page
Question   Differences between UNIQUE and DISTINCT in select statements Rank Answer Posted By  
 Interview Question Submitted By :: Cutepa1
I also faced this Question!!   © ALL Interview .com
Answer
UNIQUE and DISTINCT
 
0 Guest
 
 
Answer
UNIQUE(Constraint):- Can be only once for a   column in  a  
table


DISTINCT(Clause):- Useed in select query to retrive distinct
(non repeated) data from table(s)
 
5 Manoj
[Verinon]
 
 
Answer
Yeah Manoj, Thatz ok, UNIQUE as a constraint. But I like to
know about the diff while its usage in select statement. For
me it seems very similar to DISTINCT, can anyone give me if
there is any difference, please.
 
0 Cutepa1
[Verinon]
 
 
 
Answer
see cautiously the major difference  b/w  unique and 
distinct

UNIQUE  :Allways take part on DATA INSERTION (In brief)
DINTINCT:Allways concern on data retrival     (In brief)

Now we will take following case
when 

case 1: UNIQUE KEY is defined (may b 4 one or more column)

       It means this constraint will not allow us to
       INSERT duplicate record/column_value(s)(i.e. exactly 
same record/column_value(s) again for specified key column
(s)only) 


NOW if u use DISTINCT clause in query 
(select DISTINCT.from.)the will b same as simple query 
(select....from...)

Bcoz  data are already not repeated (bcoz of constraint)


case 2:if UNIQUE not defined

data may b repeated and DISTINCT will  now useful


Have eye on Major difference

(and we never use UNIQUE CONS.. in select.....)
 
0 Manoj
[Verinon]
 
 
Answer
yeah Manoj, this was analysed with your previous answer
itself  but please try these statements and help me with
it's significance on the statements.
select unique(<clomun_name>) from <table_name>;
select distinct(<clomun_name>) from <table_name>;
 
0 Cutepa1
[Verinon]
 
 
Answer
Buddy i dont found any difference in using distinct and 
unique in the select statement, as both are performing same 
operation in the select statement, almost every diff you 
have discussed i want to add one that is u cant use 
distinct in the create whereas unique u can.
 
4 Gourvendra Singh
[Verinon]
 
 
Answer
the diff between unique and distinct is 
unique is applied before insertion and retrival.it consists
of non duplicate values.if unique constraint is given it
does not take duplicate values.distinct is used in retrival
it gives the suppressed row(ex  if two rows are same it will
show single row and non duplicate row) therefore distinct is
the combination of  suppressed duplicate and non duplicate rows.
 
0 Chandra Sekhar
[Verinon]
 
 
Answer
DISTINCT AND UNIQUE are same operation.
But, You cannot specify DISTINCT if the select_list 
contains LOB columns.
 
0 Howard Cheon
[Verinon]
 
 
Answer
Hi Howard Cheon,
               you are currect... but we cant able to use 
both DISTINCT and UNIQUE, if the select_list contains LOB, 
LONG columns. It may not a difference.

Could anyone plz give some another major difference..

Thanks in Advance

Vijay Reddy.
 
0 Vijay Mohan Reddy
[Verinon]
 
 
Question   How do you retrieve set of records from database server. {Set max records = 100 & use paging where pager page no or records = 10 & after displaying 100 records again connect to database retrieve next 100 } Rank Answer Posted By  
 Interview Question Submitted By :: Hemanth Desai
I also faced this Question!!   © ALL Interview .com
Answer
Hi the above posted Querry is wrong


this is Correct

Select * from TableName
where rowid in(
Select rowid from TableName
where rownum =&upto(EX <=100,200
minus
select rowid from TableName
where rownum<=&from(EX =1,101)
)
 
0 Pandu
 
 
Answer
select top 100 * from <tablename>
 
0 Padma
 
 
Question   Types of cursor locks and explanation each of them ? Rank Answer Posted By  
 Interview Question Submitted By :: Hemanth Desai
I also faced this Question!!   © ALL Interview .com
Answer
a
 
5 Rtr
 
 
Answer
acLockPesimistic - locks the row when it read it and hold 
the lock still updates it.
adLockOptimistic - locks the row whenit updates it.
adLockOptimistic - locks the row at the time it updates it.
adlockforwardonly - readonly.
 
1 Mehul Patel
 
 
Question   Types of cursors and explanation each of them ? Rank Answer Posted By  
 Interview Question Submitted By :: Hemanth Desai
I also faced this Question!!   © ALL Interview .com
Answer
Cursor is a pointer or handler to context area.there are 
three types if cursors
1.implicit cursor: Every SQL statment between begin and end 
are implicit cursors.
2.explicit cursor:As a name user has to explicitly 
create,open and close cursors.
3. ref cursor: Reference cursor is a datatype which holds 
the value of a cursor.
 
0 Sohail
 
 
Question   What is NOCOPY? Rank Answer Posted By  
 Interview Question Submitted By :: Bikramdas11
I also faced this Question!!   © ALL Interview .com
Answer
well is it mean NCOPY command ..?
 
0 Payal
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com