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 >> Data-Warehouse
 
  Teradata (22)  Business-Objects (374)  Cognos (385)  Informatica (524)  Crystal-Enterprise-Suite (23)
  Actuate (19)  Ab-Initio (49)  Data-Stage (66)  SAS (273)  Micro-Strategy (8)
  ETL (136)  Data-Warehouse-General (148)
 


 

Back to Questions Page
 
Question
write a query to display to 10 max record from the employee
table?
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
select * from emp x where &n=(select count(distinct sal) 
from emp y where x.sal<=y.sal)

it will prompt for the value give the values as 10 u will 
get the output
 
0
Narender.v
 
 
Answer
select * from emp a
where (select count(distinct sal) from emp b where
a.sal<b.sal)=&n order by sal desc
/


this is the exact query........when there are duplicate
salaries are there also........
 
0
Madhoo
 
 
Answer
To find nth value

select salary from emp a where &n=(select count(distinct
salary) from emp b where a.empno<=b.empno);

to find max by nth value a.empno<=b.empno
to find min by nth value a.empno>=b.empno

OR

To find 10 max records 

select * from (select * from emp order by salary desc) where
rownum<=&n;
 
0
Rajasivam.p
 
 
 
Question
write a query to display the third record from the employee
table?
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
To display the 3rd record of emp table we can write query as
select * from emp where rownum<4 minus select * from emp
where rownum<3;
 
0
M M Naidu
 
 
Answer
select * from (select rownum r,emp.* from emp) where r=3;
 
0
Srinu
 
 
Question
what is an sid (surrogate key)?
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   IBM , Oracle
I also faced this Question!!   © ALL Interview .com
Answer
surrogate key: It has system generated artificial key
values, which allows to maintain historical records in the
data warehouse more effectively.
 
0
M M Naidu
 
 
Question
What is the difference between macro & Parameter
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
Parameter:Specifies the parameter that is satisfied by 
values chosen in the prompt control.

Applies to
Date & Time Prompt, Date Prompt, Generated Prompt, Interval 
Prompt, Select & Search Prompt,
Text Box Prompt, Time Prompt, Tree Prompt, Value Prompt

Macro:A macro is a runtime object, which uses the parameter 
maps and sesssion parameters in developing the conditional 
query subjects.
 
0
M M Naidu
 
 
Question
What is the difference between filter & Condition?   	   
   	   	
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
Filter: A filter is a condition which restricts the amount 
of data displayed in the report.

Condition:An expression that yields a boolean value. 
Conditions are used in query expressions, query filters, 
and boolean report variables that can be used for 
conditional formatting, styles, data sources, layouts and 
blocks.
 
0
M M Naidu
 
 
Question
what is filter?give me one example that you created a report
in your project?
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
Filter is a condition which restricts the amount 
of data displayed in the report.

Eg: You have history data from year 2000 to 2008. But
your report is to display only the "monthly trend for year 
2007", in such scenario you will have to put filter in year 
= 2007.
-palz-
 
0
Palzkumar
 
 
Question
how many types of keys are there i.e primary key and foreign
key etc..?
Rank Answer Posted By  
 Question Submitted By :: Sekhar
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
Primary key,Secondary key,Candidate Key or Alternate 
key,Composite key or concatenate key,Sort Or control 
key,Foreign Key.
 
0
Suja
 
 
Question
How to list Top 10 salary, without using Rank Transmission?
Rank Answer Posted By  
 Question Submitted By :: Kumar
This Interview Question Asked @   Infosys
I also faced this Question!!   © ALL Interview .com
Answer
use sorter transformation with ascending,sequence and filter....
 
0
Cool
 
 
Answer
if it is flat file ur answer is write,if it is relational 
souce then go to source qualifier properties there u write 
the query like
   select distinct a.* from t1 a where 10=(select sal from 
t1 b where a.sal>b.sal)
  i think it is working
 
0
Sarvesh
 
 
Answer
only use the Aggregator function.....
   
    first(sal>=values)
 
0
Murugan
 
 
Answer
SQL:
SELECT id, salary from <table name> where rownum <= 10
       ORDER BY salary DESC;
 
5
Raka
 
 
Answer
it can achieve with inline view query in sqt/r
 
0
Jaipal
 
 
Question
How to display First letter of Names in Caps?
Rank Answer Posted By  
 Question Submitted By :: Kumar
I also faced this Question!!   © ALL Interview .com
Answer
by using Initcap function
 
0
Harry
 
 
Answer
We can get this one by using upper(substr(name,1,1))
 
0
Tejeya
 
 
Answer
by using expression transformation ...we can use this function  
 init caps...
 
2
Murugan
 
 
Answer
by using initcaps() function in exp tansformation
 
0
Raju
 
 
Question
How to merge First Name & Last Name?
Rank Answer Posted By  
 Question Submitted By :: Kumar
I also faced this Question!!   © ALL Interview .com
Answer
Find the space by using the Instr() function and then split 
into two.. then merge.
 
0
Tejeya
 
 
Answer
it is very simple by using expression trans
 
0
Sarvesh
 
 
Question
In a table, 4 person having same salary. How to get Third
person record only?
Rank Answer Posted By  
 Question Submitted By :: Kumar
I also faced this Question!!   © ALL Interview .com
Answer
How can you say which is thir record when all the salaries 
are same...
 
0
Boss
 
 
Answer
We can do this by adding the rownum pesudo coulmn in the sql
overrider and take the thrid one since all the values are same,

like select col1,col2,rownum
from tab1
where rownum=3
 
0
Rag
 
 
Answer
Based on the empid(assuming the persons are employees) us 
can fire a quiry on that id.
 
0
Guest
 
 
Answer
hi all,
 suppose 4 emp geting same sal as 4000... select * from emp 
where sal=4000 and/having rowid=3
 
0
Pooja
 
 
Answer
Hi pooja,

would rowid be 3?
can u use having clause in ur query?

pl let me know poojaa
 
0
Vaas
 
 
Question
How to retrieve last two days updated records?
Rank Answer Posted By  
 Question Submitted By :: Kumar
I also faced this Question!!   © ALL Interview .com
Answer
If you have any update date column in ur table, u can query 
where sysdate-2 to get the last two days records.
 
0
Tejeya
 
 
Question
How to get EVEN & ODD numbers separately?
Rank Answer Posted By  
 Question Submitted By :: Kumar
I also faced this Question!!   © ALL Interview .com
Answer
By using the Sequence generator and Mod() in Expression tfn.
 
0
Tejeya
 
 
 
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