Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 Question - Choose the best

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
CIS777
Currently Banned

New User


Joined: 16 Sep 2005
Posts: 6

PostPosted: Sat Sep 24, 2005 7:17 am    Post subject: DB2 Question - Choose the best
Reply with quote

TABLEA has the following primary key definition:
PRIMARY KEY ( COL1 )
TABLEB has the following foreign key definition:
FOREIGN KEY FK1 ( COLY ) REFERENCES TABLEA ON DELETE CASCADE
What is the result when the SQL UPDATE statement below is executed?
DELETE FROM TABLEA WHERE COL1 = HV1

A. The delete will fail because a primary key value cannot be deleted.

B. The row will be deleted in all cases.

C. The row will be deleted from TABLEA and all rows from TABLEB where COLY = HV1 will also be deleted.

D. The row will be deleted only if no rows exist in TABLEB where COLY = HV1.

E. The row will be deleted only if a separate delete statement is executed before the next COMMIT, deleting all rows from TABLEB where COLY = HV1 if any such rows exist.
Back to top
View user's profile Send private message

chowdamhemalatha

New User


Joined: 25 Sep 2005
Posts: 2
Location: bangalore

PostPosted: Sun Sep 25, 2005 8:04 pm    Post subject: option C
Reply with quote

Hi,
option C is correct one.

ON DELETE CASCADE means whenever a row in PARENT table (TABLEA) is requested to delete, corresponding rows in all child tables dependent on the parent table (TABLEA) will be deleted. This cascade applies to all lower level child tables that are inturn depent on TABLEB using ON DELETE CASCADE option.

Regards,
Hema.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts SQL Order By related question Joseph K Thomas DB2 8 Fri Mar 18, 2016 12:53 pm
No new posts DFSort Question krrp DFSORT/ICETOOL 9 Mon Mar 07, 2016 7:11 pm
No new posts Question: REORG on LOB tablespaces rakesh1155 DB2 1 Fri Aug 14, 2015 2:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us