Click here to Skip to main content
15,909,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Some queries of update and delete, Some are completed and some are left to be complete, which i don't understand, please help me to correct mistakes if there any.Thanks

Insert new employee’s records having empno 123 and name Ronaldo
Ans) insert into emp(empno and name) values(123,Ronaldo);


Delete the records of Sales department
Ans) Delete from salesdepart;

Change the employees address for Smith
Ans)


Update the salary of each employee to 5000.
Ans) Update emp set salary= sal+5000;

Change the Mgr of each employee 7934.
Ans)

Change the commission of department 20 to 1000.

Ans)
Change the hiredate of all clerk to 02-04-2000.
Ans) Update emp set hiredate= 02-04-2000 where job="Clerk";
Change the hiredate of all salesman to 02-March-99 where department no is 30.
Ans)
Update the salary of each employee whose name start with ‘A’.
Ans)
Delete all the records having deptno 20.
Ans) Delete from emp where deptno=20;

Delete all records where salary is greater than 2000.
Ans) Delete from emp where salary > 2000;
Posted
Comments
kankeyan 1-Nov-13 3:26am    
http://w3schools.com/sql/default.asp
Member 9411249 1-Nov-13 3:27am    
Have seen already but not to clear about these one's
kankeyan 1-Nov-13 3:28am    
use where condition for update and delete, for particular record

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900