You are on page 1of 19

1.

Assume a table which contains the following columns


Emp_id
Emop_name
Phone
Email
Salary
Which of the following is the simplest way to restrict user from viewing salary
information
While still allowing them to see the other values?
A.encrypt the tables data
B.create a view that does not contain the salary column. Grant access to
the view and revoke access from the original table.
C.revoke select access from the original table from the salary column from users
who should not see salary data
D.store salary data in a separate table and grant select privilege for that table to
the appropriate users
----------------------------------------------------------------------------------------------------------------------------------------2.Which of the following is not a tool that comes with db2
A.db2 command window
B.db2 command line processor
C.db2 script editor
D.db2 first steps
---------------------------------------------------------------------------------------------------------------------------------------3.Which of the following options will perform an offline table space recovery?
A.restore database sample(my tbsp) offline from/tbspbkp
B.restore database sample tablesapce(mytbsp)from/tbspbkp
C.restore database sample tablespace(mytbsp) online from/tbspkp

D.there is no option to restore a table space in db2


---------------------------------------------------------------------------------------------------------------------------------------4.Which of the following is false about views
A.do not contain real data
B.can be used interchanging with tables when retrieving data
C.when changes are made to data through a view,the data is changed in the
underlying table
D.any view can be updated,independent of its definition
---------------------------------------------------------------------------------------------------------------------------------------5)a company has a large amount of data to store on wants to be able to do the
following with the data
a)text files
b)database
c)spreadsheets
d)comma delimited data files
---------------------------------------------------------------------------------------------------------------------------------------6)given the following table definition
Sales
Sales_date
Sales_person

date
char(20)

a)delete * from sales where year(sales_date)=1995


b)drop from sales where year(sales_date)=1995
c)drop * from sales where year(sale_date)=1995
d)delete from sales where year(sales_date)=1995
----------------------------------------------------------------------------------------------------------------------------------------

7)which of the following db2 client/driver packages is not suitable for developing
odbc application
a)Ibm data server client
b)ibm data server for odbc & cli
c)Ibm data server runtime client
d)ibm data server driver package
---------------------------------------------------------------------------------------------------------------------------------------8)which of the following statement is false
a)primary key uniquely identifies a row in a table
b)foreign key is asset of column that refers to a primary key of another table
c)a primary key must always be defined in a table
d)primary keys and foreign key are used to enforce data integrity
---------------------------------------------------------------------------------------------------------------------------------------9)given the following two tables:
Names
Student _name

Student_number

Wayne gretzky

99

Jaromirjagr

68

Bobby orr

Brett hull

23

Mario Lemieux

66

Marks(table)
Name

Marks

Wayne gretzky
Bobby orr

80
94

Brett hull

77

Mario Lemieux

83

How many rows would be returned using the following statement?


Select distinct student_name from names,marks
a)5
b)20
c)9
d)6
---------------------------------------------------------------------------------------------------------------------------------------10)given the following update statement
Update employees set workdept=(select deptno from department)where workdept
is null
Which of the following describes the result if this statement is executed?
a)the statement will fail because an update statement will not contain a subquery
b)the statement will fail because the workdept column appears in the set and
where clause at the same time
c)the statement will succed if table dept has only one row
d)the statement will only succed if every record in the employees table has a null
value in the workdept column
---------------------------------------------------------------------------------------------------------------------------------------11)given the following create table statement
Create table student_marks
a)select student_name from student_marks where phys=
b) select student_name from student_marks where phys=NULL
c) select student_name from student_marks where phys=0
d)select student_name from student_marks where phys is NULL

---------------------------------------------------------------------------------------------------------------------------------------12)which of the following best describes the benifit of supporting xquerys transform
expression in db2
a)it can be used to modify both xml and relational data,providing a common
language for developers to handle the database data
b)when used in a update statement , it simplifies the update of xml
documents stored in the database
c)it is very useful to transform xml documents into other formats using style sheets
d)it can be used to automatically clean up unnecessary tags in a xml
documents,providing smaller documents thus saving space in the database
13)Consider the following scenario. You have 3 tables with the same
name(TABLE_1)under 3 different schemas( SYSIBM,DEFAULT AND DB2INSTL).You
are cancelled to a db2 database in your linux server as default and issue the
following statement.
Select * from table_1
Which table will you be selected data from.

a)you get an error because your query is ambious,as the table schema is not
specified.
b)db2 inst1.table_1
c)default _table_1
d)sysibm_table_1
---------------------------------------------------------------------------------------------------------------------------------------14)when using a relational database which of the following is false?
a)retrieve data using sqls data manipulation language(dml)
b)define the datbase structure using sqls ddl
c)store the data in class instance and fields
d)use normalisation to avoid redundant data in your tables.

---------------------------------------------------------------------------------------------------------------------------------------16. which of the following is false about the information model?


a. provides the details to implement objects in dbs.
b. defines relationships between manged objects.
c. provides an abstract mangement of objects to a conceptual level.
d. provides a conceptual/abstract model for designers.
---------------------------------------------------------------------------------------------------------------------------------------17)A company has a large amount of data to store and wants to be able to do the
following the data.
Have a stands interface for acccessing the data.
Have multiple users with the abilty to insert,update and delete data.
Have changes to the data without risk of losing data and its consistancy.
Have the capabilty to handle huge amounts of volume of data and users.
Have tools for data backup,restore and recovery
what data storage method is the must optimal solution for the company??
a)text files
b)database
c)spread sheets
d)comma delimited dat files
---------------------------------------------------------------------------------------------------------------------------------------18)col_1

col_2

10

12

14

Col_A

col_B

21

23

25

Assuming the following results are desired


Col_1

col_2

col_A

col_B

10

21

12

14

23

25

19.)Which of the following joins will produce the desired results?


a. Select * from tab1 inner join tab2 on col_1=col_A.
b. Select * from tab1 left outer join tab2 on col_1=col_A
c. Select * from tab1 right outer join tab2 on col_1=col_A
d. Select * from tab1full outer join tab2 on col_1=col_A
---------------------------------------------------------------------------------------------------------------------------------------20)What is trusted context?
a)It is a special area in a buffer pool that can be written only by a seletec set of
users.
b)it is a db2 capabilty that allows application to change users without breaking the
connection to the database .
c)it is a db2 capability that allows users to establish a connection to the
database without providing username or password.
d)it is a types of container in a table space that allows faster I/O operations.
---------------------------------------------------------------------------------------------------------------------------------------21)what functionality does automatic storage provide?

a. automatic storage simplifies storage management by allowing you to


specify storage paths where the database management can place tables
space data
b . automatic storage is an option that allows transactions that are eritten to do
database to be automatically comitted
c. automatic storage is a function of database that allows tables to be backedup
automatically on a set schedule
d. auto storage can be used to automatically reorganize the data as a physical
media is order to improve performance
---------------------------------------------------------------------------------------------------------------------------------------22)what is sql/xml ?
a. Sql /xml is a communication protocol of db2 database.
b. Sql/xml is a part of the xquery standard and provide various
publishing functions to transform xml data into relational form
and viceversa.
c. Sql/xml is naother name for pure xml technology.
d. Sql/xml is an extension to sql standard and provide various functions to
transform xml data into relational form and viceversa.
----------------------------------------------------------------------------------------------------------------------------------------23)consider the following xml document.
<customerinfo>
<name>john smith</name>
<addr country=canada>
<street>fourth</street>
<prov_state>alberta</prov_state>
<pcode_zip>m1t 2A9</pcode_zip>
</addr>
<phone type=work>963-289-4136</phone>

</customerinfo>
Consider the following update expression
Update xml customer
Set info=xmlquery(transform copy$new:=$i
Modify(
Do insert <phone type=cell>777-555-3333</phone> after 4new/customer
info/addr,for$j in
$new/customer info/addr/phone
Return do rename $j as telephone
)
Return $new passing info as i
Where cid=1000;
Which of the following represents the xml document after the transform repression
has been executed.
a) <customerinfo>
<name>john smith</name>
<addrcountry=canada>
<street>fourth</street>
<prov_state>alberta</prov_state>
<pcode_zip>m1t 2A9</pcode_zip>
</addr>
<phone.type=work>963-289-4136</phone>
<phone.type=work>777-555-3333</phone>
</customerinfo>
b) <customerinfo>
<name>john smith</name>
<addrcountry=canada>

<street>fourth</street>
<prov_state>alberta</prov_state>
<pcode_zip>m1t 2A9</pcode_zip>
</addr>
<phone.type=work>777-555-3333</phone>
<telephone.type=work>963-289-4136</telephone>
</customerinfo>

c) <customerinfo>
<name>john smith</name>
<addrcountry=canada>
<street>fourth</street>
<prov_state>alberta</prov_state>
<pcode_zip>m1t 2A9</pcode_zip>
</addr>
<phone.type=work>777-555-3333</phone>
<telephone.type=work>963-289-4136</telephone>
</customerinfo>

d) <customerinfo>
<name>john smith</name>
<addrcountry=canada>
<street>fourth</street>
<prov_state>alberta</prov_state>
<pcode_zip>m1t 2A9</pcode_zip>
<phone.type=work>777-555-3333</phone>

</addr>
<telephone.type=work>963-289-4136</telephone>
</customerinfo>

24.Which of the following is created automatically when a db2 database is created?


a. Temp space1 table space
b. Sys cat space table space
c. IBMDEFAULT buffer pool
d. All the above
---------------------------------------------------------------------------------------------------------------------------------------25.Which of the following is true about the information model?
a. Provides the specific of objects in a detailed level
b. Describes objects but not relationships between them
c. Provides the details to implement objects in database
d. Provides conceptual abstract in database
---------------------------------------------------------------------------------------------------------------------------------------26.which data model was created with the focus of providing better data
independence?
a. Relational
b. Hierarchical
c. Semi structured
d. Entity relationship
---------------------------------------------------------------------------------------------------------------------------------------27.Buffer pools

a. A table space can only be associated with a buffer pools that


has the same page size
b. A table space can only be associated with a buffer pool that has a
smaller or same page size
c. A table space can only be a associated with buffer pool that has larger
or same page size
d. A table space can only be associated with a buffer that has a larger
size
---------------------------------------------------------------------------------------------------------------------------------------28.what are the advantages of using stored procedures?
e. Reduce network traffic
f. Centralize the location where code is stored and changed
g. Enforcement of business rules
h. All the above
---------------------------------------------------------------------------------------------------------------------------------------29.Consider a table tab1 having the following value
Col1

col2

10

20

30

40
a. Delete from tab1 Insert into tab1 values(c 40) Insert into values(d
40)
b. Update tab1 set col1null where col2in (10,20)
c. Delete from tab1 where col2 not in (30,40)
d. Delete from tab1 where col2 in (30,40)

---------------------------------------------------------------------------------------------------------------------------------------30.Create table color


a. Only rows in table color will be affected
b. Rows in both color and object with

c_id=2 will be deleted

c. Only rows in table object will be affected


d. No rows will be deleted
---------------------------------------------------------------------------------------------------------------------------------------31.Which of the following stores db2 configuration information?
a. Dbmcfg
b. Dbcfg
c. Db2 profile registey
d. All the above
---------------------------------------------------------------------------------------------------------------------------------------32.If secondary log files are to be allocated until the unit of work commits or stores
is exhausted , which type of logging is used
a. Infinite logging
b. Archival logging
c. Circular logging
d. It can not be done in db2
----------------------------------------------------------------------------------------------------------------------------------------.33.Which of the following is not a x-query function?
a. Db2 fn:xml column
b. Db2-fn:sql query
c. Db2-fn:xml record
d. None of the above

---------------------------------------------------------------------------------------------------------------------------------------34.which of the following privileges permits a user to create objects with in a


schema?
a. Control
b. Alter
c. References
d. Createin
---------------------------------------------------------------------------------------------------------------------------------------35. The authentication method in a db2 server is defined with in
a. The data base configuration
b. The database manager configuration
c. The db2 registry
d. The systems catalog
---------------------------------------------------------------------------------------------------------------------------------------36. Which of the following is false about keys in the relation model
a. Foreign keys are used to identify foreign columns
b. Primary keys unique identify each tuple of the relation
c. Primary keys are defined by a subset of attributes of a relation
d. A relation can have multiple foreign keys
---------------------------------------------------------------------------------------------------------------------------------------37.Which of the following privileges permits a user to update the comments
associated with a table?
a. Control
b. Alter
c. Createin

d. References
---------------------------------------------------------------------------------------------------------------------------------------38.Which of the following statements is true about pure xml technology?
a. With pure xml technology there is a part of the db2 engine that can
natively handle xquery
b. In pure xml,a query can combine sql with xml constructs;therefore
integrating relational and hierarchical data in one query
c. In pure xml,the format in which xml data is processed is the same as
the format in which it is stored, that is, there is no conversion required
d. All the above
---------------------------------------------------------------------------------------------------------------------------------------39.Which of the following best describe the advantages of executing the set of dml
statements inside a single transactions
a. The dbms records those operations in the audit logs since they are
grouped inside a transaction
b. The dbms stores the transaction operation so that the client
applications can return the transaction easily
c. The dbms guarantees that either all changes performed by the dml are
stored or in case of errors,the changes are undone leaving the
database in a consists state
d. The dbms guarantees that all operations are always executed
successfully
----------------------------------------------------------------------------------------------------------------------------------------

40.Which is false regarding buffer pool


A. a database can only have one buffer pool
B. pagesin buffer pool can be 4k,8k,16k and 32k in size
C .buffer pool work as cache,storing data that is read from table

D. IBMDEFAULT buffer pool is the default buffer pool automatically created when a
database is created
-----------------------------------------------------------------------------------------------------------------------------------------41.BUFFER POOL are associated with table space so that they can increase
performance by cashing data in memory,which is from
A. A tablespace can only be associated with a buffer pool that has same
page size
B. A tablespace can only be associated with a buffer pool that has a smaller or same
page size
C. A tablespace can only be associated with a buffer pool that has larger or same
page size
D. A tablespace can only be associated with a buffer pool that has larger page size
-----------------------------------------------------------------------------------------------------------------------------------------42.which of the following programming language can be used to develop
applications that required access to a DB2 database application
A. java
B. php
C. c#
D.all the above
-----------------------------------------------------------------------------------------------------------------------------------------43.which is not DML statement?
A. alter
B. insert
C. select
D. update
-----------------------------------------------------------------------------------------------------------------------------------------

44.which is false about relational database?


A. each column contains a specific type of information
B. a primary key can be composed of only one attribute
C. each column stores individual piece of information for a record
D. foreign key are an attribute in one relation whose values match primary key of
another relation
---------------------------------------------------------------------------------------------------------------------------------------45.GUESTS
Name

age

Jenny

34

Rodney

36

Oliver

21

Angie

42

Tom

28

Vinlenzo

25

What names would be displayed as the results of the following


SQL Query
Select name from guests where name like %0_
a. Oliver.
b. Vinlenzo
c. Tom
d. Rodney
----------------------------------------------------------------------------------------------------------------------------------------46. col 1
a

col2

colA

10

colB
21

12

14

23
25

assuming following results as designed


col_1
A
B
C

col_2

col_A

10
12
14

col_b

21

23

Which of the following join will produce the desired result


A. SELECT * FROM tab1 INNER JOIN tab2 on COL_1=COL_A
B. SELECT * FROM tab1 LOJ tab2 ON COL1-COL_A
C. SELECT * FROM tab1 ROJ tab2 ON COL1-COL _A
D. SELECT * FROM tab1 FOJ tab2 ON COL_1= COL_A
---------------------------------------------------------------------------------------------------------------------------------------47. DB2 server is defined within
A. database configuration
B. database managed configuration
C. DB2 registery
D.systems catalog
---------------------------------------------------------------------------------------------------------------------------------------48. advantage of stored procedure
A,reduce n/w traffic
B. centralizer the location where code is stored and changed
C. enforcement of buiseness rules
D. all the above

-------------------------------------------------------------------------------------------------------------------------------------49. not XQuery function


A. db2_fn:Xml column
B. db2_fn:sal query
C. db2_xml record
D. none of the above

50. false about keys in relational model


A. foreign keys are used to identify foreign columns and rows in a relationship
B. primary keys uniquely identify each tuple of the relation
C. primary keys are defined by a subset of attribute of a relation
D. a relation can have multiple foreign keys

51. Consider the following scenario.you have 3 tables with the


samename(TABLE_1)under 2 different schemes(SYSIBM,DEFAULT AND
DB2INSTL).you are connect to a db2 database in your linux server as db2inst1 and
issue the following statement.
Select * from table_1
Which table will you be selecting data from.
-----------------------------------------------------------------------------------------------------------------------------------------

You might also like