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
your project to describe and tell about : 1. My favorite things 2. My favorite places at home 3. Animals *Choose one of them to describe *Write on your paper *If you done, Send me *Did you get it
Recently conducted Apptitude test
Danlaw placement questions and answers
Do we have vacancy for HR RECRUITER ?
what is placement paper?
If anybody knows the recruitment procedure of IOTL & POWER MECHANICAL. send me the placement papers if u hav... very urgent ...
why didn't get placed so far?
printf("%d",printf("%d",printf("%d",printf("%s","ILOVECPROGRAM")))); whats the output
What were the occupations of the people who lived within the Mauryan Empire?
speak 1min on topic Travelling,memorable moment ,memorable day?
i want the sample placement paper of goldman sachs urgently. please send it to me
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?
what you will do when you struck in traffic ?
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
Zero setting of sejong rottary press