Tag: databases

Questions Related to databases

Which of the following will be a consequence of defining the column IDCOL2 in TABLE2 as a foreign key referencing the primary key (IDCOL1) of TABLE1?

  1. DB2 will no longer allow updating the value of IDCOL1 in TABLE1.

  2. When inserting a row in TABLE2, the only values that DB2 will allow for IDCOL2 are the existing values of IDCOL1.

  3. When inserting a row in TABLE2, DB2 will only allow foreign values for IDCOL2, that is values which do not exist in IDCOL1.

  4. When a SELECT statement joins TABLE1 with TABLE2, DB2 will automatically add the condition TABLE1.IDCOL1=TABLE2.IDCOL2 if not specified in the statement


Correct Option: B

A DRDA host database resides on a z/OS or an i5/OS system and listens on port 446. The TCP/IP address for this system is 192.168.10.1 and the TCP/IP host name is myhost. Which of the following commands is required to update the local node directory so that a DB2 client can access this DRDA database?

  1. CATALOG TCPIP NODE myhost REMOTE db2srv SERVER 446

  2. CATALOG TCPIP NODE mydb2srv REMOTE myhost SERVER 446

  3. CATALOG TCPIP NODE myhost REMOTE db2srv SERVER 192.168.10.1

  4. CATALOG TCPIP NODE mydb2srv REMOTE myhost SERVER 192.168.10.1


Correct Option: B

A stored procedure object is created into which DB2 object?

  1. Alias

  2. Schema

  3. Package

  4. Routine Space


Correct Option: B
  1. Data can be retrieved by SQL

  2. Data can be retrieved by XQUERY

  3. XML Columns must be altered to accommodate additional parent and child relationships

  4. Access to any portion of an XML document can be direct ,without reading whole document


Correct Option: C

An application needs to store a 5MB JPEG image in a DB2 table. Which datatype should be used to specify a column that will be used for storing A image ?

  1. GRAPHIC

  2. BINARY

  3. IMAGE

  4. BLOB


Correct Option: D
Explanation:

To solve this question, the user needs to know the different datatypes that can be used to store binary data, such as images, in a DB2 table.

Now, let's go through each option and explain why it is right or wrong:

A. GRAPHIC: This datatype is used to store fixed-length character data in Unicode format. It is not appropriate for storing binary data such as images.

B. BINARY: This datatype is used to store binary data in a fixed-length format. It is a valid option for storing images, but it does not provide compression capabilities.

C. IMAGE: This datatype is used to store large objects in a compressed format. It is an option for storing images, but it is not recommended as it has been deprecated in recent versions of DB2.

D. BLOB: This datatype is used to store large binary objects in a compressed format. It is the recommended option for storing images in a DB2 table as it provides compression capabilities and can handle large objects.

Therefore, the correct answer is:

The Answer is: D. BLOB