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 is serialization and where it is used, What is serialization? Where it...

What is serialization? Where it is used and why?  Serialization is a basic term used for mechanisms which enable objects and object structures to be converted into portable for

Database Normalization, I have a homework assignment due today by midnight....

I have a homework assignment due today by midnight. I need help understanding databasse normalization and determining the type of form violation & how to fix the violation.

Managing Data in Databases, Answer SQL Queries to extract data from data ta...

Answer SQL Queries to extract data from data tables and questions on mapping conceptual data models into relational data model.

What are the benefits of ooa technology, What are the benefits of OOA techn...

What are the benefits of OOA technology? Using OOA technology can produce many benefits, such as:  i) Reusability of code  ii) Productivity is gained through direct mappi

What are the disadvantages of file-processing system, What are the disadvan...

What are the disadvantages of file-processing system?  Ans: The Disadvantages of File-Processing System a. Data redundancy and inconsistency - Data redundancy means not nece

Illustrate the diagram - association as a cache, Association as a cache ...

Association as a cache This association must be updated when any new element is added to it, but testing for overlap using association is more efficient.    Figure:

What are segments in oracle, What are segments in oracle? Segments - Ea...

What are segments in oracle? Segments - Each table has single field of disk space, known as segment, set aside for it in the tablespace. Segments consist of contiguous sections

Note gate, i want notes on this topic

i want notes on this topic

Database recovery and security, Database Recovery And Security Introdu...

Database Recovery And Security Introduction In this part we will introduce two main issues relating to database management systems. A computer system suffers from dissi

Update anomaly-data redundancy, Update Anomaly : This anomaly is occurred d...

Update Anomaly : This anomaly is occurred due to data redundancy. Redundant information makes updates more complex since, for example, varying the name of the instructor of MCS-014

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