select name of emplyoee whose total salary is 130 from
following table.
id name salary
1 a 100
2 b 20
3 c 50
1 a 30
2 b 70
Post the resulantant Query?
Answers were Sorted based on User's Feedback
Answer / mahavir bansal
select Name as Sal from emplyoee
group by Name
having sum(salary)=130
Is This Answer Correct ? | 17 Yes | 3 No |
Answer / anonymous
select name as Sal
from emplyoee
group by id
having sum(salary)=130
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / kuntal bhattacharya
select name from
(select name ,sum(salary) as Sal from emplyoee
group by id ,name)as s
where Sal=130
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ajay kumar
select sum(salary) as Sal from emplyoee
group by id
having sum(salary)=130
Is This Answer Correct ? | 8 Yes | 8 No |
Answer / kumar.t
Select id, name, sum(salary) from emp
group by id, name
Having sum(salary) =130
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vikas kant
select emp_name, sum(salary)
from emp
group by emp_name
having sum(salary)=130
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / supriya gupta
SELECT Name FROM Employee
WHERE salary =130
Is This Answer Correct ? | 1 Yes | 6 No |
How will you decide the active and passive nodes?
What happens if you add a new index to large table?
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
Explain what role entity and relationship play in an ER diagram.
What is the use of nvl work?
Do you have any idea about the tcl commands?
Please explain what is “asynchronous” communication in sql server service broker?
Where views are stored in sql server?
What is data source object?
What is data block and how to define data block size?
Which command using Query Analyzer will give you the version of SQL server and operating system?
How to choose all records from the table?