Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Hcl Technologies 3+ Experienced Sql server Questions

Answers were Sorted based on User's Feedback



Hcl Technologies 3+ Experienced Sql server Questions..

Answer / susmita

6. HOW TO FIND 6TH HIGHEST SALARY?




with ta
as
(
select distinct top 6 salary from tblemp order by salary desc
)
select min(salary) from ta

Is This Answer Correct ?    2 Yes 1 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / basha

2)Dispaly all managers from table(Manager id is same as Empid)

select * from employee where empid in
(select distinct mgrid from employee)

Is This Answer Correct ?    0 Yes 0 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / sahil chawla

Select MIN(s.salary) FROM
(SELECT salary FROM Employee ORDER BY salary DESC limit 6)s

Is This Answer Correct ?    0 Yes 0 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / daisy

1) select all the Employees who does not have phone?

select * from employees where empid not in (select empid
from phone)

2)Dispaly all managers from table(Manager id is same as
Empid)

select * from employees emp where emp.employeeid = emp.mgrid

3)How to know How many tables contain Empno as a column in
database?

4)Find duplicate rows in a table or if we have table with
one column which
has many records which are not distinct. How to find out
the distinct
values from that column and number of times it's repeated?

select salary,count(salary) as Repeat from employees group
by salary having salary > 1

5) How to delete the rows which are duplicate?(Don't remove
both duplicate
records.)
WITH [T ORDERED BY ROWID] AS

(SELECT ROW_NUMBER() OVER (ORDER BY product_name ASC) AS
ROWID, * FROM product where product_name ='Scale')

DELETE FROM [T ORDERED BY ROWID] WHERE ROWID <> 1

6)How to find the 6th highest salary?

SELECT TOP 1 salary

FROM (

SELECT DISTINCT TOP 6 salary

FROM employee

ORDER BY salary DESC) a

ORDER BY salary

Is This Answer Correct ?    14 Yes 15 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / kotesh

6)How to find the 6th highest salary?

select level,max(salary)
from employee
where level=6
connect by prior salary >salary
group by level;

Is This Answer Correct ?    7 Yes 8 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / anil babu

How to find the 6th highest salary?


select s.salary from
(select ROW_NUMBER() over (order by salary desc) as sno,Empid,salary from tbl_Emp )s where sno=6

Is This Answer Correct ?    0 Yes 1 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / sabarinathan

HOW TO FIND 6TH HIGHEST SALARY?

SELCT * FROM(
SELECT *,RANK() OVER(ORDER BY SALARY) RN FROM TBLSALARY) S
WHERE RN=6

Is This Answer Correct ?    1 Yes 2 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / sabarinathan

How many tables contain Empno as a column in database?

select count(*) from database.sys.columns where name='comp_id'

Is This Answer Correct ?    1 Yes 2 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / pasha

How to find sixth highest salary?

--count number of rows first

select count(salary) from employee

select salary from employee where salary=(select max(salary)
from (select top 6 salary from (select top 6 salary from
employee order by salary asc) b order by salary asc) c)

Is This Answer Correct ?    0 Yes 3 No

Hcl Technologies 3+ Experienced Sql server Questions..

Answer / noopur shrivastava

delete empid from employee e ,phone p where e.rowid !=
p.rowid;

Is This Answer Correct ?    8 Yes 16 No

Post New Answer

More Placement Papers Interview Questions

RAMCO PLACEMENT PAPERS

1 Answers   Ramco,


Written Test And Interview With IBM ( Kolkata) ---- My Experience

2 Answers   IBM,


INFOSYS PLACEMENT PAPERS ----- Placement Paper 14

1 Answers   Infosys,


placement papers of panacea biotech ltd., mohali. for RA

2 Answers   Nandi, Panacea,


IBM PLACEMENT PAPERS ------ IBM placement Paper 4

3 Answers   IBM,


mechanical engg questions

1 Answers   Nalco,


2011 Teh Maindra placement papers

0 Answers   TVS, TVS Group,


Mico Bosch-Bangalore Placement paper 2008

1 Answers   Bosch, L&T, Mico, WeP Peripherals,


DIPLOMA IN ELELCTRICAL ENNG

2 Answers   MahaGenco,


PHILIPS PLACEMENT PAPERS ________ Placement Paper 2

1 Answers   Philips, Samsung,


INFOSYS PLACEMENT PAPERS ----- Placement Paper 2

1 Answers   Infosys,


X.25 protocol encapsulates the follwing layers

1 Answers  


Categories