Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasescreate 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
Post Follow-up to this messageUPDATE employment SET sal=( SELECT AVG(employee.sal)*2 FROM employee WHERE employment.managerid=employee.managerid)
Post Follow-up to this messagethank u very much
Post Follow-up to this message"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?
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread