Sub query in the update command, Database Management System

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);

Posted Date: 3/11/2013 1:11:58 AM | Location : United States







Related Discussions:- Sub query in the update command, Assignment Help, Ask Question on Sub query in the update command, Get Answer, Expert's Help, Sub query in the update command Discussions

Write discussion on Sub query in the update command
Your posts are moderated
Related Questions
What is OLTP (Online Transaction Processing)? In OLTP - online transaction processing systems relational database design use the discipline of data modeling and generally follo

Guidelines for creation of table: Table name should begin with an alphabet. In table name, single quotes and blank spaces are not allowed. Reserve words of that DBM

What are the properties of transaction? There are three properties of transactions :- A)     Atomicity B)      Consistency C)       Isolation

What is bucket overflow and how bucket overflow is handled through Over Flow Chaining or Closed Hashing? Ans: Bucket: unit of storage holding records. Bucket is a disk block

What are data models? Explain it detail? Entity relationship model Rectangles Ellipse Diamonds Lines Relational model Relational model use a collection

Critically evaluate the bulleted list of information-related items in this case study. How are each contradictory to the notion of being an information-literate knowledge worker?

Illustrate about the advanced object design Advanced object design is a complex task. The objects discovered through analysis serve as a skeleton of design. The operations reco

Determine the language that needs a user to specify the data to be retrieved with no specifying exactly how to get it is Ans: Non-Procedural DML

please give me introduction to full data in D B M S in a short assignment

Problem 1. Write an assembly program to find the smallest among two numbers Writing an assembly program to find the smallest among two numbers 2. Explain the intern