| 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  |
| 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........  |
| 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;  |
| 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;  |
| M M Naidu |
| |
| |
| Answer | select * from (select rownum r,emp.* from emp) where r=3;  |
| 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.  |
| 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.  |
| 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.  |
| 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-  |
| 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.  |
| 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....  |
| 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  |
| Sarvesh |
| |
| |
| Answer | only use the Aggregator function.....
first(sal>=values)  |
| Murugan |
| |
| |
| Answer | SQL:
SELECT id, salary from <table name> where rownum <= 10
ORDER BY salary DESC;  |
| Raka |
| |
| |
| Answer | it can achieve with inline view query in sqt/r  |
| 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  |
| Harry |
| |
| |
| Answer | We can get this one by using upper(substr(name,1,1))  |
| Tejeya |
| |
| |
| Answer | by using expression transformation ...we can use this function
init caps...  |
| Murugan |
| |
| |
| Answer | by using initcaps() function in exp tansformation  |
| 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.  |
| Tejeya |
| |
| |
| Answer | it is very simple by using expression trans  |
| 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...  |
| 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  |
| Rag |
| |
| |
| Answer | Based on the empid(assuming the persons are employees) us
can fire a quiry on that id.  |
| Guest |
| |
| |
| Answer | hi all,
suppose 4 emp geting same sal as 4000... select * from emp
where sal=4000 and/having rowid=3  |
| Pooja |
| |
| |
| Answer | Hi pooja,
would rowid be 3?
can u use having clause in ur query?
pl let me know poojaa  |
| 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.  |
| 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.  |
| Tejeya |
| |
| |
|
| |
|
Back to Questions Page |