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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories >> Software >> Databases
 
  SQL-Server (546)  MS-Access (6)  MySQL (108)  Postgre (3)  Sybase (8)
  DB-Administration (82)  DB-Development (27)  SQL-PLSQL (402)  Databases-AllOther (38)
 


 

Back to Questions Page
 
Question
what is cluster and nin-cluster index?
Rank Answer Posted By  
 Question Submitted By :: Guest
I also faced this Question!!   © ALL Interview .com
Answer
There can be only 1 Clustered index in a table

where as nonclustered index can be upto 249 

Clustered is physical sorted index..

non clustered is logical stored index is faster than 
clustered index

thats all i know
 
0
Rajkumar
 
 
Question
What is cursor
Rank Answer Posted By  
 Question Submitted By :: Sagar Joshi
This Interview Question Asked @   TCS
I also faced this Question!!   © ALL Interview .com
Answer
A cursor is a SELECT statement that is defined within the 
declaration section of your PLSQL code. We'll take a look 
at three different syntaxes for cursors.

Cursor without parameters (simplest)
The basic syntax for a cursor without parameters is:

CURSOR cursor_name
IS
    SELECT_statement;



For example, you could define a cursor called c1 as below.

CURSOR c1
IS
    SELECT course_number
      from courses_tbl
      where course_name = name_in;

The result set of this cursor is all course_numbers whose 
course_name matches the variable called name_in.



Below is a function that uses this cursor.

CREATE OR REPLACE Function FindCourse
   ( name_in IN varchar2 )
   RETURN number
IS
    cnumber number;

    CURSOR c1
    IS
       SELECT course_number
        from courses_tbl
        where course_name = name_in;

BEGIN

open c1;
fetch c1 into cnumber;

if c1%notfound then
     cnumber := 9999;
end if;

close c1;

RETURN cnumber;

END;
 
0
Ramdeep Garg
 
 
Question
If I have a select statment which retrives 2 rows, & that 
rows have the same data in all the fields except the last 
field and I want to merge the 2 rows to be in 1 row with 
concatenating the last field which have the different 
data.... eg:  the 1st row has these fields: A-B-C 
the second row has: A-B-X ........ i want to merge the two 
row to be in one row like ----> A- B- C,X
Rank Answer Posted By  
 Question Submitted By :: Meldo
I also faced this Question!!   © ALL Interview .com
Answer
Try this...Hope this will give the Required Answer
create table testsamp(a char,b char,c char);
insert into testsamp values ('A','B','C');
insert into testsamp values ('A','B','X');

select a,b,c from(
 select a , b,
 c||lead(c,1) over (partition by a,b order by a,b) c from 
testsamp ) tmp where rownum=1;

Regards,
Murali
 
0
Murali Mohan
 
 
 
Question
One Table having two rows with one colomn having values 
Like"Male" and "Female". how to upadte these values 
Like "Female" and "Male" in single update statement.
Rank Answer Posted By  
 Question Submitted By :: Swamy
This Interview Question Asked @   Polaris
I also faced this Question!!   © ALL Interview .com
Answer
Try this,


update testsamp1 set c=decode
(c,'MALE','FEMALE','FEMALE','MALE');


Regards,
Murali
 
0
Murali Mohan
 
 
Question
HOW TO RENAME A COLUMN NAME
Rank Answer Posted By  
 Question Submitted By :: Rabinmeher
I also faced this Question!!   © ALL Interview .com
Answer
SP_Rename 'dbo.table_name.column_name','new column_name'.
 
0
Ravikv
 
 
Question
How many max. conditions can b written under the WHERE 
clause?

Like select * from [tabnam] WHERE 
(cond1...or..cond2....or...cond3...and.....so on.....???
(upto how much extent))?????
Rank Answer Posted By  
 Question Submitted By :: Surjit
This Interview Question Asked @   SAP-Labs
I also faced this Question!!   © ALL Interview .com
Answer
23
 
0
Raj
 
 
Question
what is difference between primary key and Unique
Rank Answer Posted By  
 Question Submitted By :: Rabinmeher
I also faced this Question!!   © ALL Interview .com
Answer
Primary key:it can not be null

Unique:it can have only one null value in a table.
 
0
Naresh
 
 
Question
how many type of subquery?
Rank Answer Posted By  
 Question Submitted By :: Rabinmeher
I also faced this Question!!   © ALL Interview .com
Answer
As database developer, you must have ever written 
subqueries in either SQL Server or any other database 
platform. This article will describe shortly about types of 
subquery.

  
A subquery is inner query that will be used by outer query. 
A subquery could return scalar value or a series of value. 
Based on query dependency, a subquery could be self-
contained or correlated one. A self-contained subquery is a 
subquery independent from outer query, and correlated 
subquery is a subquery that is referencing to a row in 
outer query.

  
Self-contained subquery is easier to debug than correlated 
subquery. And it is executed only once whereas correlated 
subquery is executed once for each row of outer query.

  
Sample of self-contained subquery that returns scalar value 
is shown below :

  
Select customerid

From dbo.orders

Where employeeid = (select employeeid from dbo.employees 
where lastname = ‘RAJ’);

  
This query returns customers list whose employee is RAJ.
 
0
Rajkumar
 
 
Question
how to rename the table
Rank Answer Posted By  
 Question Submitted By :: Rabinmeher
I also faced this Question!!   © ALL Interview .com
Answer
SP_RENAME 'OLDTABLE NAME', 'NEW TABLE NAME'
eg:
SP_RENAME 'TBL_EMPLOYEE', 'TBL_EMP'
 
4
Rajkumar
 
 
Question
how to select alphabets in a one column , for this the 
table name is PA_TASKS and column name is TASK_NUMBER, In 
TASK_NUMBER the data like this 
1.1.3NN,1.1.4NN,1.5.1NN,1.3.2NE,1.5NN,1NN,1.2NE,1CE , For 
this i need to disply output as only NN,but not other 
alphabets, if NN is thre means i should display , otherwise 
leave that blank or empty  Its some urgent 
requirement ,thanks in advance
Rank Answer Posted By  
 Question Submitted By :: Surendra Babu Yadav
I also faced this Question!!   © ALL Interview .com
Answer
SELECT CASE WHEN instr(TASK_NUMBER,'NN')>0 THEN 'NN' ELSE 
null END FROM PA_TASKS;
 
0
Reddibasha
 
 
Question
can i gat any proper material for sybase 
 if possible plz let me know 
balaji.cc1@gmail.com
Rank Answer Posted By  
 Question Submitted By :: Bala
I also faced this Question!!   © ALL Interview .com
Answer
sybase.com
infocenter.sybase.com
 except this sites
 
0
Bala
 
 
 
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