Multiple choice technology databases

A sequence was created with the DDL statement shown below: CREATE SEQUENCE my_seq START WITH 5 INCREMENT BY 5 CACHE 5 User1 successfully executes the following statements in Connections VALUES NEXT VALUE FOR my_seq INTO :con1hvar VALUES NEXT VALUE FOR my_seq INTO :con1hvar User2 successfully executes the following statement in Connection2: VALUES NEXT VALUE FOR my_seq INTO :con2hvar After User1 & User2 are finished, User3 executes the following statement in Connection3: SELECT NEXT VALUE FOR my_seq FROM sysibm.sysdummy1 Which value will be returned by the query?

  1. 20

  2. 25

  3. 50

  4. 55

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In a DB2 data sharing environment, sequence caches are allocated per member. Connection 1 caches the first 5 values (5 to 25) and uses 5 and 10. Connection 2 caches the next 5 values (30 to 50) and uses 30. Connection 3 caches 55 to 75, returning 55.