Hcl Technologies 3+ Experienced Sql server Questions

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what you will do when you struck in traffic ?

1063


aptitude

709


speak 1min on topic Travelling,memorable moment ,memorable day?

1750


HI SIR I WANT PREVIOUS QUESTION PAPER OF HPCL I M CHEMICAL ENGG.

1953


Danlaw placement questions and answers

1373






printf("%d",printf("%d",printf("%d",printf("%s","ILOVECPROGRAM")))); whats the output

1406


my question is : reverse a string in COBOL program (please write a code asap) input file: 1234abcdef abc*$#1___ cdef____ghi a_z_k_h___ 4_3_2_1___ ______5678 output file: 8765_____ 1_2_3_4__ h_k_z_a__ ihg____ghi 1#$*cba__ fedcb4321

1212


A frog wants to climb a pole which is 15 feet in height, frog can jump 3 feet every minute after which he rests for a minute where he slips down 2 feet. How much time will the frog take to reach the top of the pole?

614


What are the frequently asked questions for interview in capital iq company ?

1338


Recently conducted Apptitude test

1417


what is bidirectional?

1400


Sks Microfinance

998


what is placement paper?

2165


email me previous question papers of bob bank for po exams

2075


i want the sample placement paper of goldman sachs urgently. please send it to me

3937