Here’s a neat way to update a Table using SQL Subquery. Subqueries’ the real purpose is you can use more than one table. Simple SQL query fetches records from one table and the same for Update too. In the case of SQL Subquery, you can use more than one table in Update.
How to write a SQL subquery with two tables, I will present here. Frankly, you can say the ability to write a subquery is an advanced skill. Don’t worry, here I have simplified it for you.
DB2: Subquery to Update a Table
I use here two tables EMP1 and EMP2. I will update EMP1 Table when I get the matching row from EMP2 Table. I would say the benefit is you can use Two Tables.
Subquery used in WHERE clause of main query.
SET SAL = 100000
WHERE EMP_NO IN
WHERE DEPT_NO IS NULL); ===> Subquery
The Subquery fetches employee number for who dept_no is NULL from EMP2 Table. Based on this, you can easily update the EMP1 Table with new salary. This is useful query for DB2 developers who are working in Retail projects.
Here is the top B-Tree index mechanism that followed in DB2. It is a helpful explanation for DB2 developers.
Here are three top processing steps to convert Bigdata to useful information.
Amazon SQS’s powerful feature is you can use this for communication between distributed components. Here is its architecture and default retention period.