Mandalika has Published 470 Articles

How will you find the ORDER_ID of all the orders having ORDER_TOTAL greater than the average of ORDER_TOTAL in ORDER's DB2 table

Mandalika

Mandalika

Updated on 30-Nov-2020 09:32:42

207 Views

We can find all the ORDER_ID which are having ORDER_TOTAL greater than the average value of all the ORDER_TOTAL present in the ORDERS table using the sub-query.For example, if we have below ORDERS table.ORDER_IDORDER_TOTALA223451867A629985634A569027615A5691187960A56915132A5691880363Below is the subquery to find out the desired data.ExampleSELECT ORDER_ID, ORDER_TOTAL FROM ORDERS    WHERE ORDER_TOTAL ... Read More

Behaviour of a COBOL-DB2 program when number of locks exceed the limit

Mandalika

Mandalika

Updated on 30-Nov-2020 09:31:38

1K+ Views

Problem: How will the COBOL-DB2 program behave once the number of locks placed on the table space exceeds the defined limit?SolutionThe number of locks which an application can place on a DB2 resource such as page, table row, etc., is defined in DSNZPARM. Once the number of page and row ... Read More

How to find out the access path selected by optimizer for a particular query?

Mandalika

Mandalika

Updated on 30-Nov-2020 09:30:38

304 Views

DB2 optimizer plays an important role in the overall performance of the database. The optimizer selects the optimal access path for each query through which data can be fetched from the database. It identifies the indexes to follow, query predicates, etc.The optimizer selects the access path automatically and we can ... Read More

Purpose and usage of ROW-ID and SEQUENCE in a DB2

Mandalika

Mandalika

Updated on 30-Nov-2020 09:29:16

1K+ Views

Problem: How can you implement a logic to automatically generate a unique value in a DB2 column for every new row inserted?SolutionWe can implement a logic in a DB2 table through which we can have one column which will have an automatically generated value for every new row inserted. This ... Read More

Purpose and usage of subqueries in DB with the help of an example

Mandalika

Mandalika

Updated on 30-Nov-2020 09:27:33

192 Views

Problem: What are DB2 subqueries and what is the use of subqueries? Explain subqueries with the help of an example on the ORDERS table.SolutionA subquery in DB2 is a query within a query, i.e., nested query. A subquery is executed first followed by its parent query. We can have a ... Read More

What are the limitations of using OUTER JOIN on a DB2 table?

Mandalika

Mandalika

Updated on 30-Nov-2020 09:26:31

506 Views

The result of OUTER JOIN includes matched and unmatched rows in the WHERE clause. There are two main limitations of OUTER JOINS in DB2.The WHERE clause of OUTER JOIN can only have ‘=’ relational operator. , etc are not allowed in case of OUTER JOIN of two or more tables. ... Read More

How to provide & remove user access to/from DB2 object? Give the DB2 commands?

Mandalika

Mandalika

Updated on 30-Nov-2020 09:25:20

740 Views

DB2 has a concept of DCL, through which we can control the access to DB2 objects like table, plan, etc. DCL stands for Data Control Language and using this we can provide and remove user access to the DB2 objects.GRANT command will give the user access to the mentioned object ... Read More

How will you keep the locks on the resources even after a ROLLBACK?

Mandalika

Mandalika

Updated on 30-Nov-2020 09:23:42

279 Views

DB2 places locks on the resources like table, tablespace, etc., when any application is using that resource. In a COBOL-DB2 program, if we are modifying or deleting data from a table then DB2 places locks. When we give the ROLLBACK statement to revert the changes made in the database, all ... Read More

Purpose and usage of SAVEPOINT in COBOL-DB2 program

Mandalika

Mandalika

Updated on 30-Nov-2020 09:22:26

3K+ Views

Problem: How to use SAVEPOINT in a DB2? What is the purpose of SAVE-POINT in DB2? Explain with the help of an example.SolutionThe SAVEPOINT is used as a marker or tag to save the changes without committing in the database. After making the changes in the database, we can give ... Read More

What is STORED PROCEDURE in a DB2? How will you create a new stored procedure?

Mandalika

Mandalika

Updated on 30-Nov-2020 09:19:19

7K+ Views

The DB2 STORED PROCEDURE are the programs which are directly managed by DBMS. The STORED PROCEDURE generally contains SQLs and they can be called by application programs. The STORED PROCEDURE processes the query and returns the result to the application program. The STORED PROCEDURES can be used for the SQLs ... Read More

Previous 1 ... 5 6 7 8 9 ... 47 Next
Advertisements