Upload
harish-sundararajan
View
221
Download
2
Tags:
Embed Size (px)
Citation preview
IBM
…
(Test – 000-302)
DB2 9
Database and Application Fundamentals
- Academic Initiative
V9.7
BB/SL/CSE/REC-2
BB/SL/CSE/REC-3
Test 000-302: DB2 9 Database and Application Fundamentals - Academic Initiative
Overview:
This exam is NOT available at Authorized Prometric Testing Centers - it is only available through the Academic Initiative Program.
Request either the 302 or the 302A version of the test, depending on which version of the course materials were used. Version 302 is available through December 2011. Version 302A is available starting July 1, 2011
Test information:
• Number of questions: 60 • Time allowed in minutes: 90 • Required passing score: 60% • Test languages: English, Chinese Simplified, Portuguese, Spanish LA Objectives
This Academic Associate is part of the academic community (student or faculty) who has completed a course that covers the DB2 Academic Associate CE302 course material (including all of the hands-on labs).
The certified individual is knowledgeable in fundamental concepts of RDBMS, basic administration of DB2 9.7 and understands the minimal requirements involved in the development of applications for DB2.
The holder of this certification also demonstrates that the theoretical gap between traditional database courses at college level and real hands-on experience with the DB2 data server has been closed.
Individuals who have successfully attained this certification should have enough knowledge to start building application that utilizes the DB2 database, and perform basic database administration tasks.
Section 1 - Relational Database Concepts (12%)
a. Demonstrate understanding of the concepts of Data, Data Model and Information Model b. Demonstrate knowledge of the Relational Data Model and its components c. Demonstrate knowledge of relational database objects (tables, columns, rows, primary keys and
foreign keys) d. Demonstrate knowledge of what is a Database Management System and its advantages regarding
storage of data Section 2 - Getting Started with DB2 and Data Studio (20%) a. Demonstrate knowledge of the different DB2 editions and features included b. Understanding of the different licenses available for DB2 Data Server c. Demonstrate ability to create and drop DB2 instances and databases, and how to view and modify
their configuration d. Demonstrate knowledge of DB2 storage concepts: table space, containers, buffer pools e. Describe the different DB2 client packages f. Demonstrate knowledge of DB2's administration tools, data movement tools and their purpose g. Demonstrate knowledge of IBM Data Studio and IBM Data Studio h. Demonstrate knowledge of creating, cataloguing, dropping and connecting to DB2 servers and
databases
BB/SL/CSE/REC-4
Section 3 - Working with SQL and Database Objects (20%)
a. Identify basic characteristics of DB2 database objects b. Demonstrate ability to use DDL SQL statements to create different database objects c. Identify the results of a given DML SQL statement d. Demonstrate ability to use SQL to SELECT data from multiple tables using different types of join e. Ability to use SQL to sort or group related data f. Ability to use SQL to update, delete or insert data
Section 4 - Data Concurrency and Locking (8%)
a. Demonstrate knowledge of transactions and the ACID (Atomicity, Consistency, Isolation, Durability) properties
b. Identify the result of operations when COMMIT and ROLLBACK commands are involved c. Demonstrate knowledge of common concurrency issues, timeouts and deadlocks d. Ability to describe Isolation Levels in DB2 9.7 and given a situation, be able to identify the proper
isolation level to be used e. Demonstrate ability to change the isolation level for database operations
Section 5 - Database Security (8%) a. Ability to describe DB2 authentication and authorization methods b. Ability to assign and revoke privileges and authorities to users, user groups and roles using SQL c. Demonstrate knowledge of what is a DB2 Trusted Context and advantages of using Trusted
Connections d. Demonstrate knowledge of Label-Based Access Control and its advantages over regular SQL
privileges
Section 6 - DB2 Backup and Recovery (8%) a. Demonstrate understanding of different logging types in DB2 b. Ability to describe available database and table space backup types in DB2: offline/online, full,
incremental, incremental delta c. Demonstrate knowledge of recovery operations for the different types of backup in DB2
Section 7 - DB2 pureXML (10%) a. Demonstrate basic knowledge of XML, XPath and XSLT and how these technologies are related b. Demonstrate knowledge of storing XML documents in DB2 with pureXML c. Demonstrate ability to insert, update, delete and retrieve XML data in DB2 using SQL d. Demonstrate ability to use IMPORT, EXPORT and LOAD utilities to move XML data e. Demonstrate ability to identify the result of XQuery statements in DB2 f. Demonstrate knowledge of XQuery language and SQL/XML publishing functions g. Demonstrate basic knowledge of XML indexes
Section 8 - DB2 Application Development (12%) a. Ability to identify programming languages and APIs supported by DB2 b. Given a specific API, knowledge of which DB2 client packages are necessary for building and running
applications c. Ability to understand the differences between static and dynamic SQL d. Demonstrate knowledge of different routine types (functions and procedures) and implementations
in DB2 e. Demonstrate understanding of purpose of triggers and supported types of trigger in DB2 f. Demonstrate knowledge of DB2 tools to develop and execute routines
Section 9 - Troubleshooting (2%) a. Understand how to apply DB2 troubleshooting techniques when a problem arises b. Learn how to use the DB2 Information Center to understand concepts or research a problem
BB/SL/CSE/REC-5
1. Application B wants to read a subst of rows from table EMPLOYEE multiple times inside the same transaction. Which isolation level should be used in order to guarantee that every time the same set of rows is returned? a) Currently committed. b) Read stability c) Repeatable Read d) Uncommitted Read
2. What are the entities used to model data in the relational Model?
a) A collection instances of entities. b) Relations, attributes and tuples. c) A collection instances of record types. d) Tables, rows and columns.
3. If TAB1 is created using the following statement CREATE table tab1 (col1 integer not null, col2 char(3) constraint cst1 check (col1 in (1,2,3,4))) Which of the following statements will successfully insert a record into table TAB1?
a) insert into tab1 values(0,’a’) b) insert into tab1 values(null, ‘abc’) c) insert into tab1 values(null, ‘abc’) (4,’a’) d) insert into tab1 values (4,’abcdefhijklmnopq’)
4. When attempting to establish a connection to a database residing on your local machine,
which command can help u determine why the following message was displayed. Sql1013N the database alias name or database name “SAMPLE” could not be found. SQLSTATE=42705
a) list database directory b) list admin node directory c) list node directory d) list dcs directory
5. Which of the following will give u the best performance to large amounts of data into a
db2 table a) Import b) Load c) Fast import d) bulk insert
6. Which of the following is not a supported type of trigger?
a) After b) Before c) During d) Instead of
BB/SL/CSE/REC-6
7. Best define transaction is? a) A sequence of one or more SQL operations grouped together, also known as
single unit of work b) A set of independent operations that can be executed in parallel c) A data isolation level that can help prevent deadlocks by allowing reads on previously
committed data. d) An object of a DB2 database
8. Consider the following cmds:- create table space mytbsp1 managed by automatic what will the command result in?
a) Creation of a normal table space called mytbsp1 that is managed automatically. b) Creation of a user table space called mytbsp1 that is managed automatically. c) Creation of a temporary table space called mytbsp1 that is managed automatically. d) This command will return an error to the user.
9. Which data model was created with the focus of providing better data independence?
a) Relational b) Hierarchical c) Semantic d) Network
10. A dirty read occurs when?
a) A transaction read the same row of data twice and returns diff data values with each read.
b) A search based on some criterion returns additional rows after consecutive searches during a transaction.
c) Uncommitted data is returned, but the transaction that originated them as rolled back.
d) Two transactions read and then attempt to update the same data, the second update will overweight the first update before it is committed.
11. How can an application modify the isolation level of operations running against a db2
database? a) Isolation level can be changed for a particular SQL statement. b) Isolation liven can only because changed for the whole user section and all operations
in that section will be effected. c) Isolation level to be used can be specified by executing the commit operation. d) Isolation level is determined at the moment an application connects to the
database. To change the isolation level, an application is required to create the new connection specifying desired level.
BB/SL/CSE/REC-7
12. Considering the SQL statement below, which option best describes what app.tax is select app.tax(salary) from employee a) user defined function b) stored procedure c) Trigger d) User defined type
13. Which of the following programming languages can be user to develop UDF’s?
java, JavaScript, SQL C/C++, java, .NET languages SQL, C#, .nET , Perl Perl,C/C++, SQL
14. What is authorization?
a) Authorization is a process that checks whether you have sufficient provides to perform the desired databases operation
b) Authorization is the process where the DBA gathers info to see who will have access to the database.
c) Authorization is the process where the DB2 database checks with windows security to see if you have access to the DB2 database
d) Authorization is a process that validates that you are who you clain to be by verifying your user ID and password.
15. If circular logging is used, the following types of backup are allowed
a) online full backup b) offline full backup c) online incremental backup d) offline incremental backup
16. Which of the following is not true?
a) Structured query language is the standard language for manipulating data in relational database management system
b) Dbms act as an interface used to communicate with databases c) The hierarchal data model organizes data in tables with columns and rows. d) DB2 is database management system.
17. When does authentication takes place?
Just before DB2 executes is SQL statement sent by a client application When the user connects to the database When the user disconnects to the database It is part of db2 server process.
BB/SL/CSE/REC-8
18. Your company has asked you to create a database to store and organize data about the structure of the company. You want to store branch and employee data as well as data on the products that each employee in your company deals with. In order to reduce redundancy, how many tables should you create? Consider that your model should be tailored to reduce the possible number of NULL values in the table(s). a) 1 b) 2 c) 3 d) 4
19. Which of the following tools would u use if you need to execute SQL statements against a
Db2 database from the command line? a) DB2 Health center b) Db2 command line processor c) Db2 command line advisor d) Db2 control center
20. Which of the following is true about table spaces in DB2?
a) A table space is a file managed by the operating system where db2 can store data. b) A table spaces is always associated with the buffer pool c) A table space’s to store user’s temporary table data is automatically is created when
database is created. d) A table space can be managed by the database (DB2) or by external application
21. Which of the following statement is true?
a) the owner of a table does not automatically receive control privilege for the table b) the owner of a table automatically receives control privilege, but does not
automatically receive all other table privileges. c) if the control prevailed is revoked from the table owner, all the other privies that
are automatically granted to the owned table ,when the table was created are automatically reviled.
d) If the control privilege is revoked from the table owner, all other privileges that were automatically granted to the owner when the table was created need to be explicitly revoked.
22. Which of the following installation packages does not contain the GUI administration
tools? a) DB2 data server enterprise edition b) Db2 data server express-C edition c) IBM data server client d) IBM data server Runtime
BB/SL/CSE/REC-9
23. Application A is running under the repeatable read isolation level and holds an update lock on table TAB!. Application B wants to query table TAB1 and cannot wait for application A to release its lock. Which isolation level should application B run under to achieve this objective? a) Repeatable Read b) Read stability c) Cursor Stability d) Uncommitted Read
24. Which of the following us characteristic of high availability?
a) It allows compression of data b) It allows definition of a policy to guarantee quality of service to applications. c) It allows replication of data to a standby server that can take over in case of
failure. d) It allows high performance of a DB2 server by distributing workload across several
machines. 25. Which of the following is true about Static SQL?
a) It takes advantage of the table statistics are runtime. b) The structure of the SQL statement must be completely specifies at the
precompilation phase. c) It is compiled and executed by an application at run-time. d) Static SQL does not exist.
26. Which of the following is true about relation databases and the relation data model?
a) A table does not allow duplicates and a relation does. b) A domain is the smallest unit of data. c) A column is the equivalent to tuple. d) A domain is the set of some possible values for a specific field.
27. Which of the following is NOT a SQL/XML function in DB2 9.7? a) XMLQUERY b) XMLEXISTS c) EXISTS d) XMLCAST
28. Which of the following elements are shown in a DB2 access plan?
a) Configuration parameters relevant to optimization. b) Properties for operators. c) Statistics d) All of the above.
BB/SL/CSE/REC-10
29. In embedded SQL, which of the following is an example of how to establish a connection to the sample database in DB2? a) EXEC SQL connect to sample b) DB2 Connect to DB sample c) EXEC connect to sample d) EXEC db2 connect to database sample
30. In db2 9.7 which of the following functions can be used to create tables from XML
documents? a) XMLTABLE b) TABLEXML c) XML2RELATIONAL d) BLE
31. What is the default isolation level in Db2 9.7 for Linux, Unix and windows for new
databases? a) Cursor stability b) Cursor stability with current committed semantics c) Uncommitted read d) None of the above
32. Which of the following statements revoke access to sample database from user TOM?
a) Revoke connect on sample from user tom b) Revoke access from user tom on database c) Revoke access from user tom on sample. d) Revoke connect on database from user tom.
33. Which of the following statements is false regarding buffer pools?
a) Buffer pools work as cache, storing data that is read from table spaces. b) Pages in a buffer pool can be 4k,8k,16k,32k in size c) A database can only have one Buffer pool. d) The size of a buffer pool can be automatically resized STMM.
34. Assuming that you are currently connected to a db2 database which of the following
commands will terminate your connection? a) Db2 connect terminate b) Db2 connect end c) Db2 Connect kill d) Db2 Connect finalise
BB/SL/CSE/REC-11
35. In which of the following Logging type, SECONDARY log files are allocated if Primary Log files are full? a) Incremental b) Circular c) Archival d) Delta
36. Given the option below which of the following it can remove a table from DB2?
a) remove b) delete c) del d) drop
37. Which of the following is true about well-formed xml document?
a) mess or more root nodes b) tags can here at most are attribute c) always has a single document node d) end tags are optional
38. Which of the following is true about table space in DB2?
a) a table space is a file managed by the as where db2 can store data b) a TS is always associates with a buffer pool c) a TS to store user’s temporary table data is automatically created when DB is created d) a TS can be managed by the database (db2) or by an entered application
39. When using Dbms which do not apply
a) Accesses data using DML such as SQL b) define your DB schema using a DDL c) data is stored in a hierarchical model d) you can use normalization to avoid redundant data in tables
40. Which of the following objects you would need create in order to executed a block of
code every time table is up date a) an after trigger b) a UDF c) a stored procedure d) an user defined type
BB/SL/CSE/REC-12
41. Using DB2 CPP to access a remote DB for the 1st time it is necessary a) Catalog the remote system or node and then catalog the DB written the remote
node b) First register the remote system user in system catalog and then setup a SQL
communication to the remote node c) db2 cannot use DB is remote system unless SYSADMIN authority is grated to local
user d) first list all the remote DB with the db2 list DB directly command and the select the
remote DB from the list 42. Which of the following is true about columns?
a) each columns consists of one or more records b) columns are store the individual pieces of info are stores for each record c) columns must be designated a specific data type d) columns are also known as records
43. Which of following delete sample database?
a) db2 drop sample b) db2 delete database sample c) db2 drop sample DB d) db2 drop database sample
44. Which of the following is not part of the x query flow expression?
a) for clause b) let clause c) order by clause d) with clause
45. Which of the following statements is not true regarding table spaces on DB2?
a) a table space is a logical object in between logical table and physical containers. b) All tables, indexes and other data are stored in table space. c) A table space is a logical object required to store data, indexes and tables in temp
memory. d) A table space is always associated to a buffer pool.
46. Which is true about RDBMS
a) a column can store value of different data type b) a table consists of column and rows c) rows in the same table can have a different set columns d) rows are also known as fields of the table
BB/SL/CSE/REC-13
47. Which is true about dynamic SQL a) it is precompiled about binded in dynamic DB b) the structure of an SQL statement must be completely specified at precompile time c) it is compiled and executed by an application at run time d) dynamic SQL does not exist
48. Which is an xml –based language for transforming xml document?
a) XHTML b) XSLT c) HTML d) JAVA
49. What are the entities used to model data in relational model?
a) a collection of instances of entities b) relation attributes and types c) a collection on of instance of record type d) table row and rows
50. SQL used to remove data from table users
a) remove table users b) drop table users c) delete from table users d) alter table users
51. Which of the following describes the fact that a committed transaction guarantee that all
the operations are completed and in a roll backed transaction effected of all operations are reverted a) consistency. b) atomicity c) isolation d) durability
52. Statement that can add records to table
a) addrec b) addrecord c) insert d) add
53. Importing a large amount of data in db2 db. Considering you must have logged intl.about
the row imported and that want to perform the load as fast as possible which of the tools would be best choice for the join a) db2 insert b) db2 import c) db2 load d) db2 clcp
BB/SL/CSE/REC-14
54. Which of the following is characteristic difference b/w cursor stability and currently committed a) reader block reader b) reader block writer c) writer block reader d) writer block writer
55. Which of the following statement is false about transactions
a) operations inside a transaction are executed in a parallel b) only 1 commit statement can be executed inside the same transaction c) transaction guarantee atomicity of a group of operation d) a rollback or commit statement finalize a transaction
56. Assuming that you are current connected to test db which of the following will allow the
view of the database setting with details a) db2 get db cfg b) db2 list db cfg c) db2 list all from db cfg d) db2 get all from db cfg
57. Which of the following statement grants user john the ability to insert data to table 1
a) grant add on table to john b) grant insert on table 1 to john c) grant add on table 1 to user john d) grant insert on table1 to user john
58. When a user is connected to database which of the following privileges is required for the
user to use a package a) bind b) bindadd c) execute d) use
59. Which of the following operation will perform an offline table space recovery
a) restore database sample (mytbsp) offline from/tbspbkp b) restore database sample table space (mytbsp) from / tbspbkp c) restore database table space (mytbsp) online from /tbspbkp d) there is no option to restore a table space in db2
60. Which of the following is a tool to configure automatic database backup
a) Configure automatic maintenance wizard b) design advisor c) explain tool d) export utility
BB/SL/CSE/REC-15
61. Considering the SQL statements below, which option best describes what ABS is UPDATE tb1 SET col1 =ABS (col2)
a) Stored Procedure b) Built in function c) Trigger d) User Defined
62. Which of the following tools can be used to develop stored procedures?
a) DB2CLP b) DB2 command Editor c) IBM Data studio d) All of the above
63. Which of the following options can be used to check the minimum point is time (PIT) for
a table space restore? a) List Table spaces show ALL b) Restore Database sample table space (mytbsp) from 1 tbspbkp) c) Restore database sample table space ( mytbsp) online from / tbspbkp d) get snapshot for Table space on <database>
64. Which of the following is true about relational Databases?
a) A column can store values of different data types., b) A table consists of columns and rows. c) Rows in the same table can have a diff set of columns d) Rows are also known as fields of the table.
65. Best describes what an incremental cumulative backup is?
a) Backup all of the data that has changed since the last successful full or delta backup.
b) Backup of a single table space. c) Backup of the entire database. d) Backup all of the data that has changed since the last full backup.
66. What is SQL/XML?
a) SQL/XML is a communication protocol for DB2 databases. b) is a part of the XQuery standard and provides various publishing functions to
transform XML data into relational form and vice versa. c) SQL.XML is a language that provides various publishing functions to transform XML
data into rational form and vice verso, d) Is an extension to SQL standard and provides various publishing functions to
transform XML data into relational form and vice versa.
BB/SL/CSE/REC-16
67. Which of the following is NOT true about columns? a) Each col consists of one or more fields. b) Each col contains a specific type of information c) Col must be designated a specific data type d) Col are also known as fields.
68. In embedded SQL code, which of the following is true about delimiters?
a) Used by the OS to delimit system variable declaration b) Used by the DB to indicate the end of Column c) Used by the compiler to indicate the end of the program. d) Used by the precompiler to identify sql statements to be translated.
69. Which of the following is false about views
e) do not contain real data f) any view can be updated independent of its definition g) when changes are made to data through a view the data is changed in the underlying
table h) can be used interchangeably with table when retrieving data
70. 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
71. 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
72. Given the following table definition
Sales Sales_date date Sales_person 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
BB/SL/CSE/REC-17
73. 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
74. 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 75. 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
76. When using a relational database which of the following is false?
a) retrieve data using sql’s data manipulation language(dml) b) define the datbase structure using sql’s ddl c) store the data in class instance and fields d) use normalisation to avoid redundant data in your tables.
77. Which of the following is false about the information model?
a) provides the details to implement objects in db’s. 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.
78. 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
BB/SL/CSE/REC-18
79. 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
80. 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
81. What are the advantages of using stored procedures?
a) Reduce network traffic b) Centralize the location where code is stored and changed c) Enforcement of business rules d) All the above
82. create table color(cid integer not null primary key,c.desc char(20)) create view object(oid
char(2),odesc char(20), cid integer references color(cid)on select cascade) Which options correctly describes the change in 2 tables after the statement below is executed. Delete from color where cid=2 a) Only rows in table color will be affected b) Rows in both color and object with cid=2 will be deleted c) Only rows in table object will be affected d) No rows will be deleted
83. Which of the following stores db2 `configuration information?
a) Dbmcfg b) Dbcfg c) Db2 profile registey d) All the above
84. 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
BB/SL/CSE/REC-19
85. Which of the following privileges permits a user to create objects with in a schema? a) Control b) Alter c) References d) Createin
86. 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
87. Which of the following privileges permits a user to update the comments associated with
a table? a) Control b) Alter c) Createin d) References
88. 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 89. 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
BB/SL/CSE/REC-20
90. 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
91. 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
92. Which is not DML statement?
a) alter b) insert c) select d) update
93. 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 94. DB2 authentication server is defined within
a) database configuration b) database managed configuration c) DB2 registery d) systems catalog
95. Which of the followoing is not XQuery function
a) db2_fn:Xml column b) db2_fn:sal query c) db2_xml record d) none of the above
BB/SL/CSE/REC-21
96. 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
97. Which of the following table space is not created by default
a) user temporary space b) syscatspace c) system temporary space d) user space1
98. After the following SQL statement is executed
GRANT All PRIVILeGES ON TABLE STUDENT TO USER USER1 ASSUMING USER USER1 HAS NO OTHERR AUTHORITIES OR PRIVILAGES WHICH OF THE FOLLOWING ACTIONS IS USER1 ALLOWED TO PERFORM? a) grant all privilages on table student to other users b) drop a view associated to the table student c) drop the table student d) none of the above
99. Which of the following is free version of db2?
a) DB2 Express-c b) DB2 Express c) DB2 Enterprise d) DB2 workgroup
100. create or replace proc1(p1 integer,out p2 varchar(20))
Begin…….. End@ Using db2clp, which of the following commands would successfully executed procedure proc1? a) call proc1(1,default) b) call proc1(1,?) c) call proc1(1) d) none of the above
101. Which of the following is a reason for using database to store data instead of many
alternatives? a) database store data in an instructed way for faster insert performance b) db’s are cheaper to use than other alternatives c) db’s are the interface function of most os’s, thus its widely available to applications d) databases allow multiple users to handle and change the data without losing data
and its consistency
BB/SL/CSE/REC-22
102. Which of the following options best describes a domain found in the table below? Create table employee(id integer not null,name varchar930) not null,extensions integer not null,manager varchar(30) not null, primary key(id)); Sample contenet of the table employee at a given point in time: Id NAME Extension Manager 1 john 53412 y 2 Susan p 54123 N 3 jennifer L 51234 N a) Manager domain(n) b) Name Domain=(set of all positive names) c) Extension Domain(53412) d) ID domain=(1,2,3)
103. Consider table tab1 defined as below:
Considerably the following statements are successfully executed in clp with auto commit disabled, how many rows are inserted in tab1?
Insert nto tab1 values(1,’john’) Insert nto tab1 values(1,’john’) Commit Insert nto tab1 values(1,’john’) Rollback
a) 0 b) 1 c) 2 d) 3
104. Current_employees past_employees
Empid Integer not null Empid integer not null Name char(20) Name char(20) Salary decimal(10,2) Salary decimal(10,2) Assuming both tables contain data, which of the following statements will not successfully add the data to table current_employees a) insert into current_employees (empid) values(10) b) insert into current_employees values(10,’jagger’,85000.00) c) insert into current_employees select empid,name,salary from past_employees where
empid=20 d) insert into current_employees(name,salary) values(select name,salary from
past_employees where empid=20)
BB/SL/CSE/REC-23
105. Current_employees past_employees Empid Integer not null Empid integer not null Name char(20) Name char(20) Salary decimal(10,2) Salary decimal(10,2) Enabled char(1) Assuming past_employees is empty and current_employees is populated, which of the following statement copy all employees(having the enabled column with a value of ‘N’) from current_employees to past_employees? a) insert into past_employees values(current_employees where enabled=’N’) b) insert into past_employees values(select empid,name,salary from current_employees) c) insert into past_employees values(select * from current_employees where
enabled=’N’) d) insert into past_employees values(select empid,name,salary from
current_employees where enabled in (‘N’)) 106. which of the following describes the C in Db2 Express-c edition
a) c stands for C language b) it is free to develop,destroy c) it is 2gb memoey installable d) all the above
107. 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 108. Given the following two tables:
Names(table) Student _name Student_number Wayne gretzky 99 Jaromirjagr 68 Bobby orr 4 Brett hull 23 Mario Lemieux 66
BB/SL/CSE/REC-24
Marks(table) Name Marks Wayne gretzky 80 Bobby orr 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
109. 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 ambiguous, as the table schema is not
specified. b) db2 inst1.table_1 c) default .table_1 d) sysibm.table_1
110) col_1 col_2
A 10 B 12 C 14
Col_A col_B A 21 C 23 D 25 Assuming the following results are desired Col_1 col_2 col_A col_B A 10 A 21 B 12 - - C 14 C 23 D 25 - - 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
BB/SL/CSE/REC-25
110. 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.
111. Consider a table tab1 having the following value
Col1 col2 A 10 B 20 c 30 A 10 C 20 D 40 Which of the following statements can be used to modify the values in tab1 so that the final context is as follows Col1 clo2 C 30 D 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)
112. col_1 col_2
A 10 B 12 C 14 Col_A col_B A 21 C 23 D 25 Assuming the following results are desired Col_1 col_2 col_A col_B A 10 A 21 B 12 - - C 14 C 23 - - D 25
BB/SL/CSE/REC-26
Which of the following joins will produce the desired results? a) Select * from tab1 full outer join tab2 on col_1=col_A b) Select * from tab1 inner join tab2 on col_1=col_A. c) Select * from tab1 left outer join tab2 on col_1=col_A d) Select * from tab1 right outer join tab2 on col_1=col_A
113. 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