If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > question from db2 v9 certification guide

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-29-09, 09:39
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
question from db2 v9 certification guide

control question from DB2 v9 certification book:

in the following SQL statements are execute in the order shown:

create table orders
(col1 interger not null,
col2 varchar(35),
col3 numeric(5,2));

create unique index idx_col1 ON orders(col1);

which of the following describe the resulting behavior?

A. every COL1 value entered must be unique; whenever the orders table is queried rows should be displayed in order of increasing COL1 values;

B. every COL1 value entered must be unique; whenever the orders table is queried rows will be displayed in no particular order;

C....
D....

I am pretty sure the correct answer is B, but in the book it is A. Am I crazy?

The explanation in the book is:
.. the creation of an index provides a logical ordering of the rows for a table so in this example, rows inserted into the orders table will be ordered COL1 values, in ascending order.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #2 (permalink)  
Old 12-29-09, 11:25
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I sure hope it's not an IBM Press book...
Reply With Quote
  #3 (permalink)  
Old 12-29-09, 12:18
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
DB2 9 Fundamentals Certification Guide Exam 730 by Roger E.Sanders
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #4 (permalink)  
Old 12-29-09, 14:55
schintala schintala is offline
Registered User
 
Join Date: Apr 2005
Location: USA
Posts: 119
Probably they might have mistyped it. I agree correct answer is B
Reply With Quote
  #5 (permalink)  
Old 12-29-09, 16:56
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by MarkhamDBA View Post
rows inserted into the orders table will be ordered COL1 values, in ascending order.
This statement doesn't make any sense to me. I think it should say:
keys inserted into the orders index will be....

rows are inserted using:
IBM DB2 9.5 Information Center for Linux, UNIX, and Windows


I also agree Answer B is correct.

Answer A maybe true if idx_col1 is used to access the table but there is no guarantee...
Reply With Quote
  #6 (permalink)  
Old 12-29-09, 20:08
yhangw yhangw is offline
Registered User
 
Join Date: Nov 2009
Posts: 5
Quote:
Originally Posted by MarkhamDBA View Post
control question from DB2 v9 certification book:

in the following SQL statements are execute in the order shown:

create table orders
(col1 interger not null,
col2 varchar(35),
col3 numeric(5,2));

create unique index idx_col1 ON orders(col1);

which of the following describe the resulting behavior?

A. every COL1 value entered must be unique; whenever the orders table is queried rows should be displayed in order of increasing COL1 values;

B. every COL1 value entered must be unique; whenever the orders table is queried rows will be displayed in no particular order;

C....
D....

I am pretty sure the correct answer is B, but in the book it is A. Am I crazy?

The explanation in the book is:
.. the creation of an index provides a logical ordering of the rows for a table so in this example, rows inserted into the orders table will be ordered COL1 values, in ascending order.
u'r right and the answer you are quoted is totally wrong.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On