1. SELECT SUM(sal) as “Gross Salary” from EMPLOYEES;

2. SELECT MAX(sal) as “Highest Salary” from EMPLOYEES;

ouput should be in table format

Answer Posted / sandeep modapathi

select sum(Gross_Salary),sum(Highest_Salary) from (

SELECT SUM(Salary) as Gross_Salary,0 as Highest_Salary from
EmpSalaryDetails
UNION
SELECT 0,MAX(Salary) from dbo.EmpSalaryDetails
) as rowset

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain in brief about Microsoft SQL server?

549


What are the types of user defined functions in sql server?

504


what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration

569


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

583


What is blocking and how would you troubleshoot it? : sql server database administration

591






Determine how to use the inserted and deleted pseudo tables?

539


What are the steps to process a single select statement?

514


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

622


What is the difference between inner join and equi join?

492


You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?

644


Explain difference between cross join and full outer join?

563


Can we call future method from trigger?

514


What is identity?

557


How to delete a database in ms sql server?

565


What are the two modes of authentication in sql server?

524