Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Update the salary of each manager to be double the average salary of the employees he/she manages

create table employee(empid int,empname  varchar(20),manageri
d int  not
null, sal int)

insert into employee  values(1,'ranga',22,
5000)
insert into employee  values(2,'satish',22
,8000)
insert into employee  values(3,'sunil',11,
4500)
insert into employee  values(4,'sridhar',2
2,2000)
insert into employee  values(5,'ramesh',33
,12000)
insert into employee  values(6,'srini',22,
16000)
insert into employee  values(7,'sashi',33,
54000)
insert into employee  values(8,'rajani',22
,71000)
insert into employee  values(9,'praveen',1
1,6060)
insert into employee  values(10,'bhaskar',
22,11120)
insert into employee  values(11,'baba',33,
9000)

create table employment (managerid int,managername varchar(20),sal int)

insert into  employment  values(11,'rob',2500
)
insert into  employment  values(22,'babu',500
0)
insert into  employment  values(33,'ram',6000
)



now my problem is

Update the salary of each manager to be double the average
salary of the employees he/she manages

pls help

sati


Report this thread to moderator Post Follow-up to this message
Old Post
satish
03-23-06 12:38 PM


Re: Update the salary of each manager to be double the average salary of the employees he/she manage
UPDATE employment
SET sal=(
SELECT AVG(employee.sal)*2
FROM employee
WHERE employment.managerid=employee.managerid)


Report this thread to moderator Post Follow-up to this message
Old Post
markc600@hotmail.com
03-23-06 12:38 PM


Re: Update the salary of each manager to be double the average salary of the employees he/she manage
thank u very much


Report this thread to moderator Post Follow-up to this message
Old Post
satish
03-23-06 12:38 PM


Re: Update the salary of each manager to be double the average salary of the employees he/she manage
"satish" <satishkumar.gourabathina@gmail.com> wrote in
news:1143108467.298649.60900@j33g2000cwa.googlegroups.com:

>
>
> now my problem is
>
> Update the salary of each manager to be double the average
> salary of the employees he/she manages
>
> pls help
>
> sati
>


What are you going to do when you actually have to answer
this question on the exam, and you can't cheat using
the newsgroup?


Report this thread to moderator Post Follow-up to this message
Old Post
Eric J. Holtman
03-24-06 01:34 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 09:35 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006