Sub query in the update command, Database Management System

Assignment Help:

Sub query in the UPDATE command:

Example:  //Double  the  commission  for  employees,  who  have  got  at  least  2 increments.

UPDATE EMP

SET COMM = COMM * 2

WHERE 2 <= (   SELECT COUNT (*) FROM INCR WHERE INCR.EMPNO = EMP.EMPNO

GROUP BY EMPNO);

Be advised that the use of subquery that counts the number of increments given to every employee stored in the INCR table. Please note the comparison, instead of ......>=2, we have written reverse of it as 2 <= .....

DELETE Command

In the following example, the deletion will be performed in EMP table.No deletion will be performed in the INCR table.

Example: Delete the records of employees who have got no increment.

DELETE FROM EMP

WHERE EMPNO NOT IN (SELECT EMPNO FROM INCR);


Related Discussions:- Sub query in the update command

What are the states of transaction, What are the states of transaction? ...

What are the states of transaction? The states of transaction are:- a) Active b) Partially committed c) Failed d) Aborted e )Committed   f) Terminated

Determine the two special events, What are two special events? The two ...

What are two special events? The two special events are as "entry" and "exit". Any action which is marked as linked to entry event is executed whenever given state is entered v

What is thread splitting, What is Thread splitting A thread of cont...

What is Thread splitting A thread of control is a path by which a set of state diagrams on that a single object is active at a time. Objects are shared between threads

Construct a conceptual data model, Competition entrants can be either Indiv...

Competition entrants can be either Individuals, or Teams. A Team is usually sponsored by a business, and, in that case, the team members would all wear T-shirts with the sponsoring

Explain clustering file organization, Explain Clustering file organization ...

Explain Clustering file organization (i) Determine if a record of file is physically ordered on a nonkey field - that does not comprise a different value for each record - that

In oracle what is system global area and how is it organized, In Oracle wha...

In Oracle what is system global area and how is it organized? The SGA is a collection of shared memory fields which along with the Oracle processes constitute an Oracle instan

Explain the functional mode with help of an example, Explain the Functional...

Explain the Functional Mode with help of an example. Functional Model  The functional model shows a computation and functional derivation of data values in it without ind

How many types of views are there, How many types of Views are there? ...

How many types of Views are there? There are Four types of views:- Database View Help View Projection View Maintenance View

The need for three level architecture, The need for three level architectur...

The need for three level architecture The aim of the three level architecture is to divide each user's view of the database from the way the database is physically shown.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd