Db2考试测试题

883
-1

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
883
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Db2考试测试题

  1. 1. DB2 考试自测题 1--------------------------------------------------------------------------------1) Which of the following products is required to be installed in order to build anapplication on AIX, which will access a DB2 UDB for OS/390 database?a) DB2 Connect Personal Editionb) DB2 Universal Database Workgroup Editionc) DB2 Personal Developers Editiond) DB2 Universal Developers Edition OK2) Which of the following tools can be used to catalog a database?a) Journalb) Alert Centerc) License Centerd) Configuration Assistant OK3) Which of the following utilities would you run to order data and reclaim space fromdeleted rows in a table:a) reorg OKb) db2lookc) db2moved) runstats# the detail in file “reorg vs runstats.txt”4) The purpose of the USE privilege is to:a) query data in a table.b) load data into a table.c) create tables within a table space. OKd) create table spaces within a database.5) Which two of the following authorities can create a database?a) DBADMb) SYSADMc) DBCTRL
  2. 2. d) SYSCTRLe) SYSMAINT6) Cataloging a remote database is:a) Performed on a PC or UNIX machine to identify the server the DB2 database manageris on.b) Performed on a PC or UNIX machine to identify the DB2 database to users andapplications. OKc) Never performed in DB2, as only one database per node is allowed, so cataloging anode automatically catalogs the database at that node.d) Performed on a PC or UNIX machine to open the catalogs in the DB2 database andpresent a user with a list of all accessible tables in that database.7) Given the create statements:CREATE DISTINCT TYPE kph AS INTEGER WITH COMPARISONSCREATE DISTINCT TYPE mph AS INTEGER WITH COMPARISONSCREATE TABLE speed_limits(route_num SMALLINT,canada_sl KPH NOT NULL,us_sl MPH NOT NULL)Which of the following is a valid query?a) SELECT route_num FROM speed_limits WHERE canada_sl > 80b) SELECT route_num FROM speed_limits WHERE canada_sl > kph?c) SELECT route_num FROM speed_limits WHERE canada_sl > us_sld) SELECT route_num FROM speed_limits WHERE canada_sl > kph(80)8) If, for a given table, the Control Center does not show the choice Generate DDL,which of the following describes the reason?a) The table is a system object.b) The table is a summary table.?c) The table is in LOAD PENDING.d) The table is a replicated table.e) The table was created by a different user .9) Given the tables:COUNTRYID NAME PERSON CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5STAFFID LASTNAME1 Jones2 Smith
  3. 3. Which of the following statements removes the rows from the COUNTRY tablethat have PERSONS in the STAFF table?a) DELETE FROM country WHERE id IN (SELECT id FROM staff)b) DELETE FROM country WHERE id IN (SELECT person FROM staff)c) DELETE FROM country WHERE person IN (SELECT id FROM staff)d) DELETE FROM country WHERE person IN (SELECT person FROM staff) OK10) The table STOCK has the following column definitions:type CHAR (1)status CHAR(1)quantity INTEGERprice DEC (7,2)Items are indicated to be out of stock by setting STATUS to NULL and QUANTITY andPRICE to zero. Which of the following statements updates the STOCK table to indicatethat all the items except for those with TYPE of "S" are temporarily out of stock?a) UPDATE stock SET status=NULL, quantity=0, price=0 WHERE type <> Sb) UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE type <> Sc) UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE type <> Sd) UPDATE stock SET status = NULL, SET quantity=0, SET price = 0 WHERE type <> S11) Which of the following products can be used to store image data in a DB2 database?a) Net.Datab) Net Searchc) DB2 AVI Extendersd) DB2 XML Extenderse) DB2 Text Extenders12) Which of the following CANNOT have an autocommit setting?a) Embedded SQLb) The Command Centerc) The Command Line Processord) The DB2 Call Level Interface13) Which of the following statements eliminates all but one of each set of duplicaterows in the final result table?a) SELECT UNIQUE * FROM t1b) SELECT DISTINCT * FROM t1c) SELECT * FROM DISTINCT T1d) SELECT UNIQUE (*) FROM t1e) SELECT DISTINCT (*) FROM t114) Given the table:STAFFID LASTNAME1 Jones
  4. 4. 2 Smith3 <null>Which of the following statements removes all rows from the table where thereis a NULL value for LASTNAME?a) DELETE FROM staff WHERE lastname IS NULLb) DELETE ALL FROM staff WHERE lastname IS NULLc) DELETE FROM staff WHERE lastname = NULLd) DELETE ALL FROM staff WHERE lastname = NULL15) Given the following table definitions:DEPARTMENTdeptno CHAR(3)deptname CHAR(30)mgrno INTEGERadmrdept CHAR(3)EMPLOYEEempno INTEGERfirstname CHAR(30)midinit CHARlastname CHAR(30)workdept CHAR(3)Which of the following statements will list every employees number and lastname withthe employee number and last name of their manager, including employees without amanager?a) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e LEFT INNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept =deptnob) SELECT e.empno, e.lastname, m.empno, m.lastname, FROM employee e LEFTOUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept= deptnoc) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHTOUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept= deptnod) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHTINNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept= deptno16) Given the following tables:NAMESName NumberWayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Brett Hull 16Mario Lemieux 66Steve Yzerman 19
  5. 5. Claude Lemieux 19Mark Messier 11Mats Sundin 13POINTSName PointsWayne Gretzky 244Jaromir Jagr 168Bobby Orr 129Bobby Hull 93Brett Hull 121Mario Lemieux 189PIMName PIMMats Sundin 14Bobby Orr 12Mark Messier 32Brett Hull 66Mario Lemieux 23Joe Sakic 94Which of the following statements will display the players Names, numbers, points andPIM for all players with an entry in all three tables?a) SELECT names.name, names.number, points.points, pim.pim FROM names INNER JOIN points ON names.name=points.name INNER JOIN pim ON pim.name=names.nameb) SELECT names.name, names.number, points.points, pim.pim FROM names OUTER JOIN points ON names.name=points.name OUTER JOIN pim ON pim.name=names.namec) SELECT names.name, names.number, points.points, pim.pim FROM names LEFT OUTER JOIN points ON names.name=points.name LEFT OUTER JOIN pim ON pim.name=names.named) SELECT names.name, names.number, points.points, pim.pim FROM names RIGHT OUTER JOIN points ON names.name=points.name RIGHT OUTER JOIN pim ON pim.name=names.name17) Given the tables:EMPLOYEEemp_num emp_name dept1 Adams 12 Jones 13 Smith 24 Williams 1DEPTdept_id dept_name
  6. 6. 1 Planning1 Supportand the statement:ALTER TABLE employeeADD FOREIGN KEY (dept) REFERENCES (dept_id)ON DELETE CASCADEHow many units of work will be needed to process this statement:DELETE FROM dept WHERE dept_id=1a) 0b) 1c) 2d) 3e) 4f) 61 Given the requirements to store names, employee numbers, and when the employees were hired, which of the following DB2 data types CANNOT be used to contain the day the employee was hired?a) CLOBb) TIMEc) VARCHARd) TIMESTAMP19) Given the transaction:"CREATE TABLE t1 (id INTEGER,CONSTRAINT chkid CHECK (id<100))""INSERT INTO t1 VALUES (100)""COMMIT"Which of the following results from the transaction?a) The row is inserted with a NULL valueb) The row is inserted with a value of 100c) The row insertion with a value of 100 is rejectedd) The trigger called chkid is fired to validate the data20) If a table is defined with a check constraint for one or more columns, which of the following will perform the data validation after the table is loaded with the load utility.a) Reorgb) Checkc) Runstatsd) Image Copye) Set Integrity21) Given the statement:CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1=aWITH CHECK OPTIONWhich of the following SQL statements will insert data into the table?a) INSERT INTO v1 VALUES (a)b) INSERT INTO v1 VALUES (b)
  7. 7. c) INSERT INTO v1 VALUES (b)d) INSERT INTO v1 VALUES (a)e) INSERT INTO v1 VALUES (ab)22) An update lock gets released by an application using the repeatable readisolation level during which of the following?a) If the cursor accessing the row is closed.b) If the transaction issues a ROLLBACK statement.c) If the cursor accessing the row is moved to the next row.d) If the transaction changes are made via an UPDATE statement.23) Which of the following isolation levels is most likely to acquire a tablelevel lock during an index scan?a) Read Stabilityb) Repeatable Readc) Cursor Stabilityd) Uncommitted Read24) Which of the following releases a lock by an application using the cursorstability isolation level?a) If the cursor accessing the row is moved to the next rowb) If the cursor accessing the row is used to update the rowc) If the applications current row is deleted by the applicationd) If the applications current row needs to be updated by another application25) Which of the following processes is NOT performed by DB2 Warehouse Manager?a) Queryb) Loadingc) Extractiond) Transformation26) Which of the following DB2 components allows reference to Oracle and DB2databases in a single query?a) DB2 Query Patrollerb) DB2 Warehouse Managerc) DB2 Relational Connectd) DB2 Connect Enterprise Edition27) Given the table:STAFFID LASTNAME1 Jones2 SmithWhen issuing the query SELECT * FROM staff, the row return order will be based on which of the following?a) An ambiguous orderb) The primary key order
  8. 8. c) The order that the rows were inserted into the tabled) The values for the ID column, then the LASTNAME column2 How many indexes will be created by the following statement?Create table mytab(Col1 int not null primary key,Col2 char(64),Col3 char(32),Col4 int not null,constraint c4 unique (Col4,Col1))a) 0b) 1c) 2d) 3e) 429) Given the tables:COUNTRYID NAME PERSON CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5STAFFID LASTNAME1 Jones2 SmithThe statement:INSERT INTO staff SELECT person, Greyson FROM country WHERE person > 1will insert how many rows into the STAFF table?a) 0b) 1c) 2d) 330) Given the following table definition and SQL statements:CREATE TABLE table1 (col1 INT, col2 CHAR(40), col3 INT)GRANT INSERT, UPDATE, SELECT, REFERENCES ON TABLE table1 TO USER useraWhich of the following SQL statements will revoke privileges for user USERA on COL1 and COL2?a) REVOKE UPDATE ON TABLE table1 FROM USER userab) REVOKE ALL PRIVILEGES ON TABLE table1 FROM USER userac) REVOKE ALL PRIVILEGES ON TABLE table1 COLUMNS (col1, col2) FROM USERA
  9. 9. d) REVOKE REFERENCES ON TABLE table1 COLUMNS (col1, col2) FROM USER usera31) Given, CREATE TABLE t1 (c1 CHAR(4) NOT NULL). Which of the following canbe inserted into this table?a) 4b) NULLc) ‘abc’d) ‘abcde’32) A declared temporary table is used for which of the following purposes:a) backup purposesb) storing intermediate resultsc) staging area for the load utilityd) sharing result sets between applications33) Which of the following delete rules will not allow a row to be deleted from the parent table if a row with the corresponding key value still exists inthe child table?a) DELETEb) CASCADEc) RESTRICTd) SET NULL34) Which of the following processing can occur for a unit of work using an isolation level of Uncommitted Read and scanning through the table more than once within the unit of work?a) Access uncommitted changes made by other processesb) Update uncommitted changes made by other processesc) Update rows of a return set and have those updates changed by other processes from one scan to the nextd) Update rows of a return set and have those updates committed by other processes from one scan to the next35) Which of the following database authorities is required to add a new package?a) BINDADDb) CREATETABc) CREATEPKGd) PACKAGEADD36) Given the successfully executed embedded SQL:INSERT INTO staff VALUES (1, Colbert,Dorchester, 1)COMMITINSERT INTO staff VALUES (6, Anders, Cary, 6)INSERT INTO staff VALUES (3, Gaylord, Geneva,ROLLBACK WORKWhich of the following indicates the number of new rows that would be in theSTAFF table?a) 0
  10. 10. b) 1c) 2d) 337) Given the two table definitions:ORGdeptnumb INTEGERdeptname CHAR(30)manager INTEGERdivision CHAR(30)location CHAR(30)STAFFid INTEGERname CHAR(30)dept INTEGERjob CHAR(30)years CHAR(30)salary DECIMAL(10,2)comm DECIMAL(10,2)Which of the following statements will display each department, alphabetically by name,and the name of the manager of the department?a) SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.idb) SELECT a.deptname, b.name FROM org a, staff b WHERE b.manager=a.idc) SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id GROUP BY a.deptname, b.named) SELECT a.deptname, b.name FROM org a, staff b, WHERE b.manager=a.id GROUP BY a.deptname, b.name3 Which of the following DDL statements creates a table where employee idsare unique?a) CREATE TABLE t1 (employid INTEGER)b) CREATE TABLE t1 (employid UNIQUE INTEGER)c) CREATE TABLE t1 (employid INTEGER NOT NULL)d) CREATE TABLE t1 (employid INTEGER NOT NULL, primary key (employid))39) A client application on OS/390 must access a DB2 server on Unix, Windowsor OS/2. At a minimum, which of the following is required to be the DB2 server machine?a) DB2 Connect Enterprise Editionb) DB2 Universal Database Enterprise Editionc) DB2 Connect and DB2 Universal Database Workgroup Editiond) DB2 Connect and DB2 Universal Database Enterprise Edition40) Given the statements and operations:"CREATE TABLE t1 (c1 CHAR(1))"
  11. 11. Six rows are inserted with values of: a, b, c, d, e and f"SET CONSTRAINTS FOR t1 OFF""ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 =a)""SET CONSTRAINTS FOR t1 IMMEDIATE CHECKED FOR EXCEPTION IN t1 USE t1exp"Which of the following describes what happens to the rows with values of b, c, d, e and f?a) deleted from T1 onlyb) deleted from T1 and written into the t1exp filec) deleted from T1 and inserted into the table t1expd) deleted from T1 and written into the db2diag.log filee) deleted from T1 and inserted into the table syscat.checks41) Given the requirement of providing a read-only database, applications accessing the database should be run with which of the following isolation levels to allow for the most read concurrency?a) Read stabilityb) Repeatable readc) Cursor stabilityd) Uncommitted read
  12. 12. ******************************************************自测题 2--------------------------------------------------------------------------------(1/55) Which of the following products must be installed to provide a singlepoint of control forlocal and remote DB2 databases?(Select the correct response)A. DB2 Runtime ClientB. DB2 Administration ClientC. DB2 Connect Enterprise EditionD. DB2 Enterprise-Extended Edition(2/55) Which of the following tools maintains a history of all executed statements/commands for the current session within the tool?(Select the correct response)A. JournalB. SQL AssistC. DB2 Alert CenterD. DB2 Command Center(3/55) Which of the following DB2 CLP options specify the file that containsthe statements to be executed?(Select the correct response)A. -fB. -bC. -oD. -w(4/55) Which of the following will rebuild a package in the database from theexisting cataloginformation?(Select the correct response)
  13. 13. A. bindB. rebindC. updateD. rebuild(5/55) Which two of the following types of storage management method is supported by DB2OLAP Server ?(Select all that apply)A. ObjectB. NetworkC. RelationalD. HierarchicalE. Multi-dimensional(6/55) Which of the following DB2 components can limit the resource consumption of queries?(Select the correct response)A. DB2 ConnectB. DB2 Query PatrollerC. DB2 Performance MonitorD. DB2 Net Search Extender(7/55)How many DB2 Administration Server (DAS) Instances can be set up per physical machine? (Select the correct response)A. 0B. 1C. One for each instance on the physical machineD. One for each database on the physical machine(8/55) Which of the following must be set up to allow the Control Center to view database objects? (Select the correct response)A. ODBCB. JAVAC. DB2 Administration ServerD. Client Configuration Assistant(9/55) Which of the following privileges is necessary to populate the table with large amounts ofdata?(Select the correct response)A. LOADB. ALTERC. UPDATED. IMPORT(10/55) A table called EMPLOYEE has columns: name, department, and phone_number. Whichof the following can limit access to the phone_number column?
  14. 14. (Select the correct response)A. Using a view to access the tableB. Using an index on the columnC. Using a referential constraint on the tableD. Using a table check constraint on the tableE. Revoking access from the phone_number column(11/55) Which of the following is the best way to restrict user access to a subset of columns in atable?(Select the correct response)A. Only grant access to the columns within a table that a user is allowed to see.B. Create a view that only includes the columns a user is allowed to see. Grant the user accessto the view, not the base table.C. Create two tables: one with the columns that a user is allowed to see, and one that has theconfidential columns, and use a join when all data must be presented.D. Create two tables: one with the columns that a user is allowed to see, and one that has theconfidential columns, and use a union when all data must be presented.(12/55) Which of the following is the most appropriate reason to consider revoking the SELECTprivilege on the catalog tables from PUBLIC after creating a database?(Select the correct response)A. To prevent users from creating tables without proper authority.B. Some system catalogs record user data in some columns, and this datamay be confidential.C. To prevent users from viewing passwords for other DB2 userids that DB2 stores in thecatalog tables.D. Some catalog tables are large, so preventing users from viewing themis a good way to keep users from submitting long-running queries against thecatalogs.(13/55) When manually establishing communications from a Windows NT client through a DB2Connect gateway to DB2 UDB for OS/390, which of the following is NOT requiredto catalog?(Select the correct response)A. The client.B. The database on the DRDA server.C. The Database Connection Service database.D. The node where the DB2 Connect Gateway is.(14/55) Which of the following can be used to determine the views that are affected by a DROP
  15. 15. TABLE statement?(Select the correct response)A. DB2 Script CenterB. DB2 Performance MonitorC. DB2 Control Center, Show RelatedD. DB2 Control Center, Sample Contents(15/55) Using the Control Center Create Table dialog box, which of the following dialogs allowsthe table creation DDL to be viewed?(Select the correct response)A. CopyB. Show SQLC. Show RelatedD. Sample Contents(16/55) Given the table definition:CREATE TABLE student (name CHAR(30), age INTEGER)To list the names of the 10 youngest students, which of the following index definition statementson the student table may improve the query performance?(Select the correct response)A. CREATE INDEX youngest ON student (age, name)B. CREATE INDEX youngest ON student (name, age)C. CREATE INDEX youngest ON student (name, age DESC)D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age)(17/55) Which one of the following SQL statements sets the default qualifierto "user1"?(Select the correct response)A. SET CURRENT ID = user1B. SET CURRENT USER = user1C. SET CURRENT SQLID = user1D. SET CURRENT QUALIFIER = user1(18/55) Which of the following is the implicit qualifier for a declared temporary table?(Select the correct response)A. The schema name SYSCAT.B. The schema name SESSION.C. The schema name TEMPUSER.D. The userid specified with the BIND command.E. The userid who established the connection to the database and declared the temporary table.(19/55) Given the following transaction:CREATE TABLE dwaine.mytab (col1 INT, col2 INT)INSERT INTO dwaine.mytab VALUES (1,2)INSERT INTO dwaine.mytab VALUES (4,3)
  16. 16. ROLLBACKWhich of the following would be returned from the statement:SELECT * FROM dwaine.mytab?(Select the correct response)A. COL1 COL2----------- -----------0 record(s)selected.B. COL1 COL2----------- -----------1 21 record(s) selected.C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.D. COL1 COL2----------- -----------1 24 32 record(s) selected.(20/55) Which of the following does NOT end a unit of work?(Select the correct response)A. COMMITB. ROLLBACKC. TERMINATED. SAVEPOINTE. CONNECT RESET(21/55) Which of the following is the result of the following SQL statement:CREATE UNIQUE INDEX empno_ind ON employee (empno)(Select the correct response)A. Every value for EMPNO must be unique.B. UPDATE statements on EMPNO will be rolled back.C. Insert statements on EMPNO will always be faster.D. Insert statements on the EMPNO table will result in clustered data.(22/55) Given the following DDL statements,CREATE TABLE t1 (a INT, b INT, c INT)CREATE VIEW v1 AS SELECT a, b, c FROM t1WHERE a > 250WITH CHECK OPTIONWhich of the following INSERT statements will fail?(Select the correct response)A. INSERT INTO t1 VALUES (200, 2, 3)B. INSERT INTO v1 VALUES (200, 2, 3)C. INSERT INTO t1 VALUES (300, 2, 3)D. INSERT INTO v1 VALUES (300, 2, 3)(23/55) Which of the following statements will create an index and prevent table T1 fromcontaining two or more rows with the same values for column C1?
  17. 17. (Select the correct response)A. CREATE UNIQUE INDEX ix4 ON t1 (c1)B. CREATE DISTINCT INDEX ix1 ON t1 (c1)C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)(24/55) Given the table T1, created by:CREATE TABLE t1(id INTEGER GENERATED BY DEFAULT AS IDENTITY,c1 CHAR(3))The following SQL statements are issued:INSERT INTO t1 VALUES (1, ABC)INSERT INTO t1 VALUES (5, DEF)Which of the following values are inserted into the ID column by the following statement?INSERT INTO t1(c1) VALUES (XYZ)(Select the correct response)A. 0B. 1C. 2D. 5E. 6(25/55) Given the following:TAB1 TAB2C1 C2 CX CY--- --- --- ---A 11 A 21B 12 C 22C 13 D 23The following results are desired:C1 C2 CX CY-- -- -- --A 11 A 21C 13 C 22- - D 23Which of the following joins will yield the desired results?(Select the correct response)A. SELECT * FROM tab1, tab2 WHERE c1=cxB. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cxC. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cxD. SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx(26/55) Given the following UPDATE statement:UPDATE address2 SET housenumber_buildingname=(SELECT buildingname FROM address1WHERE address2.id = address1.id)WHERE HOUSENUMBER_BUILDINGNAME IS NULLWhich of the following describes the result of the statement?
  18. 18. (Select the correct response)A. The statement will succeed.B. The statement will fail because a subquery cannot exist in an UPDATEstatement.C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are defined asprimary keys.D. The statement will succeed if the data retrieved from the subquery does not have duplicatevalues for ADDRESS1.ID.(27/55) Which of the following is possible once a user has been given maintenance authority?(Select the correct response)A. DB2 userids can be created.B. Views can be created on the catalogs.C. Statistics can be collected for database objects.D. A table can be populated by using the LOAD command.(28/55) Given table T1 with 100 rows, which of the following queries will retrieve 10 rows fromtable T1?(Select the correct response)A. SELECT * FROM t1 MAXIMUM 10 ROWSB. SELECT * FROM t1 READ 10 ROWS ONLYC. SELECT * FROM t1 OPTIMIZE FOR 10 ROWSD. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY(29/55) Given the two following tables:PointsName PointsWayne Gretzky 244Jaromir Jagr 168Bobby Orr 129Bobby Hull 93Brett Hull 121Mario Lemieux 189PIMName PIMMats Sundin 14Jaromir Jagr 18Bobby Orr 12Mark Messier 32Brett Hull 66Mario Lemieux 23Joe Sakic 94
  19. 19. Which of the following statements will display the players Names, points andPIM for all players?(Select the correct response)A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOIN pimON points.name=pim.nameB. SELECT points.name, points.points, pim.name, pim.pim FROM points FULLOUTERJOIN pim ON points.name=pim.nameC. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFTOUTERJOIN pim ON points.name=pim.nameD. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUTERJOIN pim ON points.name=pim.name(30/55) Given the following table definitions:DEPARTMENTdeptno CHAR(3)deptname CHAR(30)mgrno INTEGERadmrdept CHAR(3)EMPLOYEEempno INTEGERfirstname CHAR(30)midinit CHARlastname CHAR(30)workdept CHAR(3)Which of the following statements will list the employees employee number, last name, anddepartment name ONLY for those employees who have a department?(Select the correct response)A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department dWHEREe.workdept = d.deptnoB. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOINdepartment d ON e.workdept = d.deptnoC. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOINdepartment d ON e.workdept = d.deptnoD. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOINdepartment d WHERE e.workdept = d.deptno(31/55) Given the table:COUNTRY
  20. 20. ID NAME PERSON CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5Which of the following clauses when added to the statementSELECT cities, name FROM countryreturns rows sorted by NAME and then sorted by the number of cities (CITIES)?(Select the correct response)A. ORDER BY 2,1B. GROUP BY 2, 1C. ORDER BY cities, nameD. GROUP BY cities, name(32/55) Given the following table definition:STAFFid INTEGERname CHAR(20)dept INTEGERjob CHAR(20)years INTEGERsalary DECIMAL(10,2)comm DECIMAL(10,2)Which of the following statements will return all of the records ordered by jobwith the salaries in descending order?(Select the correct response)A. SELECT * FROM staff ORDER BY salary DESC, jobB. SELECT * FROM staff GROUP BY salary DESC, jobC. SELECT * FROM staff ORDER BY job, salary DESCD. SELECT * FROM staff GROUP BY job, salary DESC(33/55) Given table EMPLOYEE with columns EMPNO and SALARY and table JOB withcolumns ID and TITLE, what is the effect of the statement:UPDATE employee SET salary = salary * 1.15WHERE salary < 15000 OREXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = Mgr)(Select the correct response)A. Only managers that make less than 15,000 are given salary increases.B. Only non-managers that make less than 15,000 are given salaray increases.C. Employees that make less than 15,000 but no managers are given salaryincreases.
  21. 21. D. Employees that make less than 15,000 and all managers are given salary increases.(34/55) Given the table definition:DEFIN1:id SMALLINT NOT NULLname VARCHAR(30)hired DATEDEFIN2:deptid SMALLINT NOT NULLname VARCHAR(30)started DATEWhich of the following statements will insert successfully into table DEFIN1?(Select the correct response)A. INSERT INTO defin1 (id) VALUES (1)B. INSERT INTO defin1 (name) VALUES (Florence)C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATEFROM defin2D. INSERT INTO defin1 (name, hired) SELECT DISTINCT Florence, CURRENTDATE FROM defin2(35/55) With tables defined as:Table1col1 INTcol2 CHAR(30)Table2col1 INTcol2 CHAR(30)Which of the following statements will insert all the rows in TABLE2 into TABLE1?(Select the correct response)A. INSERT INTO table1 SELECT col1, col2 FROM table2B. INSERT INTO table1 AS SELECT col1, col2 FROM table2C. INSERT INTO table1 VALUES (table2.col1, table2.col2)D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)(36/55) Which of the following is the result of a successful ROLLBACK statement?(Select the correct response)A. Held locks are releasedB. Release-pending conditions are undoneC. Tables in LOAD PENDING are releasedD. Constraint checking conditions are undoneE. Existing database connections are released
  22. 22. (37/55) Given the following embedded SQL programs:Program 1:CREATE TABLE mytab (col1 INT, col2 CHAR(24))COMMITProgram 2:INSERT INTO mytab VALUES ( 20989,Joe Smith)INSERT INTO mytab VALUES ( 21334,Amy Johnson)COMMITDELETE FROM mytabROLLBACKINSERT INTO mytab VALUES ( 23430,Jason French)ROLLBACKINSERT INTO mytab VALUES ( 20993,Samantha Jones)COMMITDELETE FROM mytab WHERE col1=20993ROLLBACKWhich of the following indicates the number of records that will be returnedby the statement:SELECT * FROM mytab?(Select the correct response)A. 0B. 1C. 2D. 3E. 4(38/55) Given an embedded SQL program with a single connection, two threads and the following actions:Thread 1: INSERT INTO mytab VALUES (...)Thread 2: INSERT INTO mytab VALUES (...)Thread 1: COMMITThread 2: INSERT INTO mytab VALUES (...)Thread 1: ROLLBACKHow many records will be successfully inserted and retained in the table mytab?(Select the correct response)A. 0B. 1C. 2D. 3(39/55) Given two embedded SQL programs and the following actions:Pgm1 Pgm2INSERT INTO mytab VALUES (...) DELETE FROM mytabCOMMIT ROLLBACKDELETE FROM mytab INSERT INTO mytab VALUES (...)ROLLBACK COMMIT
  23. 23. If there exists one (1) row in table mytab before the programs are executed concurrently,how many records will be in the table once the programs complete?(Select the correct response)A. 0B. 1C. 2D. 3E. 4(40/55) A user has a numeric data column with a maximum value of 100,000. Which of thefollowing data types will use the minimum amount of storage for the column?(Select the correct response)A. IDENTITYB. BIGINTC. INTEGERD. SMALLINT(41/55) Which of the following DB2 data types is used to store 50 MB of binary data as a singlevalue?(Select the correct response)A. BLOBB. CLOBC. DBCLOBD. FOR BIT DATAE. VARCHAR FOR BIT DATA(42/55) Given the following column requirements:Col1 Numeric Identifier - From 1 to 1000000Col2 Job Code - Variable, 1 to 2 characters longCol3 Job Description - Variable, 1 to 100 characters longCol4 Job Length - Length of Job in secondsWhich of the following will minimize the disk space allocated to store the records if JobDescription has an average length of 45?(Select the correct response)A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT)B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT)C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT)D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4INT)(43/55) Which of the following DELETE RULES on CREATE TABLE will delete a dependenttable row if the parent table row is deleted?
  24. 24. (Select the correct response)A. ON DELETE REMOVEB. ON DELETE CASCADEC. ON DELETE RESTRICTD. ON DELETE SET NULLE. ON DELETE PROPAGATE(44/55) Given the following table structure:table1emp_num INT NOT NULL PRIMARY KEYemp_fname CHAR(30) NOT NULLemp_lname CHAR(30) NOT NULLemp_addr CHAR(60) NOT NULLemp_pin CHAR(10) NOT NULLWhich of the following columns can be referenced by a foreign key clause fromanother table?(Select the correct response)A. emp_numB. emp_pinC. emp_addrD. emp_fnameE. emp_lname(45/55) Why is a unique index not sufficient for creation of a primary key?(Select the correct response)A. It is sufficient - a primary key is the same thing as a unique index.B. Unique indexes can be defined in ascending or descending order. Primary keys must beascending.C. A unique index can be defined over a column or columns that allow nulls. Primary keys cannot contain nulls.D. A unique index can be defined over a column or columns that allow nulls. This is notallowed for primary keys because foreign keys cannot contain nulls.(46/55) Given the statement:CREATE TABLE t1 (c1 CHAR(1))Data has been inserted into the table with rows of a,b,c,d,e,f. Given the following commandis issued:ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 =a)Which of the following occurs?(Select the correct response)A. Rows with c1 values of b,c,d,e,f are deletedB. Rows with c1 values of b,c,d,e,f have c1 set to NULLC. The ALTER command will fail as rows violate the constraintD. The ALTER command will move the violating rows to the exception table
  25. 25. (47/55) With DBADM authority on the database and given the statements:CREATE TABLE t1 (c1 CHAR(1))INSERT INTO t1 VALUES (b)CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1=a WITH CHECK OPTIONINSERT INTO v1 VALUES (a)INSERT INTO v1 VALUES (b)How many rows would be returned from the statement, SELECT c1 FROM t1?(Select the correct response)A. 0B. 1C. 2D. 3(48/55) A view is used instead of a table for users to do which of the following?(Select the correct response)A. Avoid allocating more disk space per databaseB. Provide users with the ability to define indexesC. Restrict users access to a subset of the table dataD. Avoid allocating frequently used query result tables(49/55) Which of the following products can be used to perform a dictionary-based search?(Select the correct response)A. Net.DataB. XML ExtenderC. AVI ExtenderD. Text Extender(50/55) Which two of the following modes can be used on the lock table statement?(Select all that apply)A. SHARE MODEB. EXCLUSIVE MODEC. REPEATABLE READ MODED. UNCOMMITTED READ MODEE. INTENT EXCLUSIVE MODE(51/55) For which of the following can locks be obtained?(Select the correct response)A. A triggerB. A table viewC. A table columnD. A database bufferE. A row referenced by an index key(52/55) Given the following table with a primary key on empid:Emp:
  26. 26. Empid Name11 Joe Smith23 Melanie Jones30 Robert Bruce49 Janice Baker66 Mario Diaz68 Maria DiatonGive the following statement in an embedded SQL program bound with RepeatableRead:Select * from Emp where empid < 55How many rows in the table will be locked after the statement is run?(Select the correct response)A. 0B. 1C. 4D. 5E. 6(53/55) Which of the following isolation levels will lock only the rows returned in the result set?(Select the correct response)A. Read StabilityB. Repeatable ReadC. Cursor StabilityD. Uncommitted Read(54/55) Which of the following processing can occur for a unit of work usingan isolation level of Cursor Stability and allows scanning through the tablemore than once within the unit of work?(Select the correct response)A. Access uncommitted changes made by other processesB. Update uncommitted changes made by other processesC. Have updated result set rows changed by other processes from one scanto the nextD. Have accessed result set rows changed by other processes from one scan to the next(55/55) Given the following:A table containing a list of all seats on an airplane. A seat consists of a seat number and whetheror not it is assigned. An airline agent lists all the unassigned seats on theplane. When the agentrefreshes the list from the table, it should only change if another agent unassigns a currentlyassigned seat.Which of the following isolation levels should be used for this application?
  27. 27. (Select the correct response)A. Read stabilityB. Repeatable readC. Cursor stabilityD. Uncommitted read*************************************************自测题 3--------------------------------------------------------------------------------(1/55) Given two embedded SQL programs and the following actions:Pgm1 Pgm2INSERT INTO mytab VALUES DELETE FROM mytab(...)COMMIT ROLLBACKDELETE FROM mytab (...)ROLLBACK COMMITIf there exists one (1) row in table mytab before the programs are executed concurrently, how many records will be in the table once the programs complete?(Select the correct response)A. 0B. 1C. 2D. 3E. 4(2/55)Which of the following DB2 CLP options specify the file that containsthe statements to be executed?(Select the correct response)A. –FB. –BC. –OD. –W(3/55)A view is used instead of a table for users to do which of the following?(Select the correct response)A. Avoid allocating more disk space per databaseB. Provide users with the ability to define indexesC. Restrict users access to a subset of the table data
  28. 28. D. Avoid allocating frequently used query result tables(4/55) Given the table definition:CREATE TABLE student (name CHAR(30), age INTEGER)To list the names of the 10 youngest students, which of the following index definition statements on the student table may improve the query performance?(Select the correct response)A. CREATE INDEX youngest ON student (age, name)B. CREATE INDEX youngest ON student (name, age)C. CREATE INDEX youngest ON student (name, age DESC)D. CREATE INDEX youngest ON student (name DESC) INCLUDE (age)(5/55) Given the following UPDATE statement:UPDATE address2 SET housenumber_buildingname=(SELECT buildingname FROM address1WHERE address2.id = address1.id)WHERE HOUSENUMBER_BUILDINGNAME IS NULLWhich of the following describes the result of the statement?(Select the correct response)A. The statement will succeed.B. The statement will fail because a subquery cannot exist in an UPDATE statement.C. The statement will succeed only if ADDRESS1.ID and ADDRESS2.ID are definedas primary keys.D. The statement will succeed if the data retrieved from the subquery does not have duplicate values for ADDRESS1.ID.(6/55) Given the following column requirements:Col1 Numeric Identifier - From 1 to 1000000Col2 Job Code - Variable, 1 to 2 characters longCol3 Job Description - Variable, 1 to 100 characters longCol4 Job Length - Length of Job in secondsWhich of the following will minimize the disk space allocated to store the records if Job Description has an average length of 45?(Select the correct response)A. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 CHAR(100), col4 INT)B. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 CHAR(100), col4 INT)C. CREATE TABLE tab1 (col1 INT, col2 CHAR(2), col3 VARCHAR(100), col4 INT)D. CREATE TABLE tab1 (col1 INT, col2 VARCHAR(2), col3 VARCHAR(100), col4 INT)(7/55) Which of the following will rebuild a package in the database from the existing catalog information?(Select the correct response)A. bindB. rebindC. updateD. rebuild
  29. 29. (8/55)With tables defined as:Table1col1 INTcol2 CHAR(30)Table2col1 INTcol2 CHAR(30)Which of the following statements will insert all the rows in TABLE2 into TABLE1?(Select the correct response)A. INSERT INTO table1 SELECT col1, col2 FROM table2B. INSERT INTO table1 AS SELECT col1, col2 FROM table2C. INSERT INTO table1 VALUES (table2.col1, table2.col2)D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)(9/55) Given an embedded SQL program with a single connection, two threadsand the following actions:Thread 1: INSERT INTO mytab VALUES (...)Thread 2: INSERT INTO mytab VALUES (...)Thread 1: COMMITThread 2: INSERT INTO mytab VALUES (...)Thread 1: ROLLBACKHow many records will be successfully inserted and retained in the table mytab?(Select the correct response)A. 0B. 1C. 2D. 3(10/55)Which of the following can be used to determine the views that are affected by a DROP TABLE statement?(Select the correct response)A. DB2 Script CenterB. DB2 Performance MonitorC. DB2 Control Center, Show RelatedD. DB2 Control Center, Sample Contents(11/55) Which of the following is the implicit qualifier for a declared temporary table?(Select the correct response)A. The schema name SYSCAT.B. The schema name SESSION.C. The schema name TEMPUSER.D. The userid specified with the BIND command.E. The userid who established the connection to the database and declared thetemporary table.
  30. 30. (12/55) Given table EMPLOYEE with columns EMPNO and SALARY and table JOB with columns ID and TITLE, what is the effect of the statement:UPDATE employee SET salary = salary * 1.15WHERE salary < 15000 OREXISTS (SELECT 1 FROM job WHERE job.id = employee.empno AND job.title = Mgr)(Select the correct response)A. Only managers that make less than 15,000 are given salary increases.B. Only non-managers that make less than 15,000 are given salaray increases.C. Employees that make less than 15,000 but no managers are given salary increases.D. Employees that make less than 15,000 and all managers are given salary increases.(13/55) Given the following table structure:table1emp_num INT NOT NULL PRIMARY KEYemp_fname CHAR(30) NOT NULLemp_lname CHAR(30) NOT NULLemp_addr CHAR(60) NOT NULLemp_pin CHAR(10) NOT NULLWhich of the following columns can be referenced by a foreign key clause fromanother table?(Select the correct response)A. emp_numB. emp_pinC. emp_addrD. emp_fnameE. emp_lname(14/55)Which of the following DELETE RULES on CREATE TABLE will delete a dependent table row if the parent table row is deleted?(Select the correct response)A. ON DELETE REMOVEB. ON DELETE CASCADEC. ON DELETE RESTRICTD. ON DELETE SET NULLE. ON DELETE PROPAGATE(15/55) Why is a unique index not sufficient for creation of a primary key?(Select the correct response)A. It is sufficient - a primary key is the same thing as a unique index.B. Unique indexes can be defined in ascending or descending order. Primary keys must be ascending.C. A unique index can be defined over a column or columns that allow nulls. Primary keys cannot contain nulls.D. A unique index can be defined over a column or columns that allow nulls. T
  31. 31. his is not allowed for primary keys because foreign keys cannot contain nulls.(16/55) When manually establishing communications from a Windows NT clientthrough a DB2 Connect gateway to DB2 UDB for OS/390, which of the following is NOT required to catalog?(Select the correct response)A. The client.B. The database on the DRDA server.C. The Database Connection Service database.D. The node where the DB2 Connect Gateway is.(17/55)Which two of the following types of storage management method is supported by DB2 OLAP Server ?(Select all that apply)A. ObjectB. NetworkC. RelationalD. HierachicalE. Multi-dimensional(18/55) Which of the following is the result of a successful ROLLBACK statement?(Select the correct response)A. Held locks are releasedB. Release-pending conditions are undoneC. Tables in LOAD PENDING are releasedD. Constraint checking conditions are undoneE. Existing database connections are released(19/55) Which of the following isolation levels will lock only the rows returned in the result set?(Select the correct response)A. Read StabilityB. Repeatable ReadC. Cursor StabilityD. Uncommitted Read(20/55)A user has a numeric data column with a maximum value of 100,000. Which of the following data types will use the minimum amount of storage for the column?(Select the correct response)A. IDENTITYB. BIGINTC. INTEGERD. SMALLINT(21/55) Which of the following is the most appropriate reason to consider revoking the SELECT privilege on the catalog tables from PUBLIC after creating
  32. 32. a database?(Select the correct response)A. To prevent users from creating tables without proper authority.B. Some system catalogs record user data in some columns, and this data may be confidential.C. To prevent users from viewing passwords for other DB2 userids that DB2 stores in the catalog tables.D. Some catalog tables are large, so preventing users from viewing them is agood way to keep users from submitting long-running queries against the catalogs.(22/55) Given the table definition:DEFIN1Id SMALLINT NOT NULLName VARCHAR(30)Hired DATEDEFIN2:Deptid SMALLINT NOT NULLName VARCHAR(30)Started DATEWhich of the following statements will insert successfully into table DEFIN1?(Select the correct response)A. INSERT INTO defin1 (id) VALUES (1)B. INSERT INTO defin1 (name) VALUES (Florence)C. INSERT INTO defin1 (id, hired) AS SELECT DISTINCT 1, CURRENT DATE FROM defin2D. INSERT INTO defin1 (name, hired) SELECT DISTINCT Florence, CURRENT DATEFROM defin2(23/55) Which of the following statements will create an index and preventtable T1 from containing two or more rows with the same values for column C1?(Select the correct response)A. CREATE UNIQUE INDEX ix4 ON t1 (c1)B. CREATE DISTINCT INDEX ix1 ON t1 (c1)C. CREATE UNIQUE INDEX ix6 ON t1 (c1,c2)D. CREATE DISTINCT INDEX ix3 ON t1 (c1,c2)(24/55) A table called EMPLOYEE has columns: name, department, and phone_number. Which of the following can limit access to the phone_number column?(Select the correct response)A. Using a view to access the tableB. Using an index on the columnC. Using a referential constraint on the tableD. Using a table check constraint on the tableE. Revoking access from the phone_number column(25/55) Which of the following is the result of the following SQL statement
  33. 33. :CREATE UNIQUE INDEX empno_ind ON employee (empno)(Select the correct response)A. Every value for EMPNO must be unique.B. UPDATE statements on EMPNO will be rolled back.C. Insert statements on EMPNO will always be faster.D. Insert statements on the EMPNO table will result in clustered data.(26/55)Which of the following DB2 components can limit the resource consumption of queries?(Select the correct response)A. DB2 ConnectB. DB2 Query PatrollerC. DB2 Performance MonitorD. DB2 Net Search Extender(27/55) Given the following table with a primary key on empid:Emp:Empid Name11 Joe Smith23 Melanie Jones30 Robert Bruce49 Janice Baker66 Mario Diaz68 Maria DiatonGive the following statement in an embedded SQL program bound with RepeatableRead:Select * from Emp where empid < 55How many rows in the table will be locked after the statement is run?(Select the correct response)A. 0B. 1C. 4D. 5E. 6(28/55)Which of the following products can be used to perform a dictionary-based search?(Select the correct response)A. Net.DataB. XML ExtenderC. AVI ExtenderD. Text Extender(29/55)Which two of the following modes can be used on the lock table statement?(Select all that apply)A. SHARE MODEB. EXCLUSIVE MODE
  34. 34. C. REPEATABLE READ MODED. UNCOMMITTED READ MODEE. INTENT EXCLUSIVE MODE(30/55)Which of the following does NOT end a unit of work?(Select the correct response)A. COMMITB. ROLLBACKC. TERMINATED. SAVEPOINTE. CONNECT RESET(31/55) Which of the following must be set up to allow the Control Center to view database objects?(Select the correct response)A. ODBCB. JAVAC. DB2 Administration ServerD. Client Configuration Assistant(32/55)Which of the following is the best way to restrict user access to asubset of columns in a table?(Select the correct response)A. Only grant access to the columns within a table that a user is allowed tosee.B. Create a view that only includes the columns a user is allowed to see. Grant the user access to the view, not the base table.C. Create two tables: one with the columns that a user is allowed to see, andone that has the confidential columns, and use a join when all data must bepresented.D. Create two tables: one with the columns that a user is allowed to see, andone that has the confidential columns, and use a union when all data must bepresented.(33/55)How many DB2 Administration Server (DAS) Instances can be set up perphysical machine?(Select the correct response)A. 0B. 1C. One for each instance on the physical machineD. One for each database on the physical machine(34/55) Given the table T1, created by:CREATE TABLE t1(id INTEGER GENERATED BY DEFAULT AS IDENTITY,c1 CHAR(3))The following SQL statements are issued:
  35. 35. INSERT INTO t1 VALUES (1, ABC)INSERT INTO t1 VALUES (5, DEF)Which of the following values are inserted into the ID column by the following statement?INSERT INTO t1(c1) VALUES (XYZ)(Select the correct response)A. 0B. 1C. 2D. 5E. 6(35/55)Given the following transaction:CREATE TABLE dwaine.mytab (col1 INT, col2 INT)INSERT INTO dwaine.mytab VALUES (1,2)INSERT INTO dwaine.mytab VALUES (4,3)ROLLBACKWhich of the following would be returned from the statement:SELECT * FROM dwaine.mytab?(Select the correct response)A. COL1 COL2--------------- --------------0 record(s)selected.B. COL1 COL2--------- --------1 21 record(s) selected.C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.D. COL1 COL2-------- -------1 24 32 record(s) selected.(36/55)Given the following:TAB1 TAB2C1 C2 CX CY------ ------ ----- -----A 11 A 21B 12 B 22C 13 C 23The following results are desired:C1 C2 CX CY----- ----- ----- ------A 11 A 21C 13 C 22--- ---- D 23Which of the following joins will yield the desired results?
  36. 36. (Select the correct response)A. SELECT * FROM tab1, tab2 WHERE c1=cxB. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cxC. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cxD. SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx(37/55) Given the following embedded SQL programs:Program 1:CREATE TABLE mytab (col1 INT, col2 CHAR(24))COMMITProgram 2:INSERT INTO mytab VALUES ( 20989,Joe Smith)INSERT INTO mytab VALUES ( 21334,Amy Johnson)COMMITDELETE FROM mytabROLLBACKINSERT INTO mytab VALUES ( 23430,Jason French)ROLLBACKINSERT INTO mytab VALUES ( 20993,Samantha Jones)COMMITDELETE FROM mytab WHERE col1=20993ROLLBACKWhich of the following indicates the number of records that will be returnedby the statement:SELECT * FROM mytab?(Select the correct response)A. 0B. 1C. 2D. 3E. 4(38/55)Given the statement:CREATE TABLE t1 (c1 CHAR(1))Data has been inserted into the table with rows of a,b,c,d,e,f. Given the following command is issued:ALTER TABLE t1 ADD CONSTRAINT con1 CHECK (c1 =a)Which of the following occurs?(Select the correct response)A. Rows with c1 values of b,c,d,e,f are deletedB. Rows with c1 values of b,c,d,e,f have c1 set to NULLC. The ALTER command will fail as rows violate the constraintD. The ALTER command will move the violating rows to the exception table(39/55)Given the two following tables:PointsName PointsWayne Gretzky 244Jaromir Jagr 168
  37. 37. Bobby Orr 129Bobby Hull 93Brett Hull 121Mario Lemieux 189PIMName PIMMats Sundin 14Jaromir Jagr 18Bobby Orr 12Mark Messier 32Brett Hull 66Mario Lemieux 23Joe Sakic 94Which of the following statements will display the players Names, points andPIM for all players?(Select the correct response)A. SELECT points.name, points.points, pim.name, pim.pim FROM points INNER JOIN pim ON points.name=pim.nameB. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTER JOIN pim ON points.name=pim.nameC. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTER JOIN pim ON points.name=pim.nameD. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUTER JOIN pim ON points.name=pim.name(40/55) Which of the following products must be installed to provide a single point of control for local and remote DB2 databases?(Select the correct response)A. DB2 Runtime ClientB. DB2 Administration ClientC. DB2 Connect Enterprise EditionD. DB2 Enterprise-Extended Edition(41/55)Which of the following tools maintains a history of all executed statements/commands for the current session within the tool?(Select the correct response)A. JournalB. SQL AssistC. DB2 Alert CenterD. DB2 Command Center(42/55) Using the Control Center Create Table dialog box, which of the following dialogs allows the table creation DDL to be viewed?(Select the correct response)A. CopyB. Show SQLC. Show RelatedD. Sample Contents
  38. 38. (43/55)Which of the following processing can occur for a unit of work usingan isolation level of Cursor Stability and allows scanning through the tablemore than once within the unit of work?(Select the correct response)A. Access uncommitted changes made by other processesB. Update uncommitted changes made by other processesC. Have updated result set rows changed by other processes from one scan to the nextD. Have accessed result set rows changed by other processes from one scan tothe next(44/55)Given the table:COUNTRYID NAME PERSON CITY1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5Which of the following clauses when added to the statementSELECT cities, name FROM countryreturns rows sorted by NAME and then sorted by the number of cities (CITIES)?(Select the correct response)A. ORDER BY 2,1B. GROUP BY 2, 1C. ORDER BY cities, nameD. GROUP BY cities, name(45/55) Which of the following DB2 data types is used to store 50 MB of binary data as a single value?(Select the correct response)A. BLOBB. CLOBC. DBCLOBD. FOR BIT DATAE. VARCHAR FOR BIT DATA(46/55)Which one of the following SQL statements sets the default qualifierto "user1"?(Select the correct response)A. SET CURRENT ID = user1B. SET CURRENT USER = user1C. SET CURRENT SQLID = user1D. SET CURRENT QUALIFIER = user1(47/55)Which of the following privileges is necessary to populate the tablewith large amounts of data?
  39. 39. (Select the correct response)A. LOADB. ALTERC. UPDATED. IMPORT(48/55)For which of the following can locks be obtained?(Select the correct response)A. A triggerB. A table viewC. A table columnD. A database bufferE. A row referenced by an index key(49/55)Which of the following is possible once a user has been given maintenance authority?(Select the correct response)A. DB2 userids can be created.B. Views can be created on the catalogs.C. Statistics can be collected for database objects.D. A table can be populated by using the LOAD command.(50/55)With DBADM authority on the database and given the statements:CREATE TABLE t1 (c1 CHAR(1))INSERT INTO t1 VALUES (b)CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1=a WITH CHECK OPTIONINSERT INTO v1 VALUES (a)INSERT INTO v1 VALUES (b)How many rows would be returned from the statement, SELECT c1 FROM t1?(Select the correct response)A. 0B. 1C. 2D. 3(51/55) Given the following DDL statements,CREATE TABLE t1 (a INT, b INT, c INT)CREATE VIEW v1 AS SELECT a, b, c FROM t1WHERE a > 250WITH CHECK OPTIONWhich of the following INSERT statements will fail?(Select the correct response)A. INSERT INTO t1 VALUES (200, 2, 3)B. INSERT INTO v1 VALUES (200, 2, 3)C. INSERT INTO t1 VALUES (300, 2, 3)D. INSERT INTO v1 VALUES (300, 2, 3)(52/55)Given table T1 with 100 rows, which of the following queries will retrieve 10 rows from table T1?
  40. 40. (Select the correct response)A. SELECT * FROM t1 MAXIMUM 10 ROWSB. SELECT * FROM t1 READ 10 ROWS ONLYC. SELECT * FROM t1 OPTIMIZE FOR 10 ROWSD. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY(53/55)Given the following:A table containing a list of all seats on an airplane. A seat consists of a seat number and whether or not it is assigned. An airline agent lists all theunassigned seats on the plane. When the agent refreshes the list from the table, it should only change if another agent unassigns a currently assigned seat.Which of the following isolation levels should be used for this application?(Select the correct response)A. Read stabilityB. Repeatable readC. Cursor stabilityD. Uncommitted read(54/55)With tables defined as:Table1col1 INTcol2 CHAR(30)Table2col1 INTcol2 CHAR(30)Which of the following statements will insert all the rows in TABLE2 into TABLE1?(Select the correct response)A. INSERT INTO table1 SELECT col1, col2 FROM table2B. INSERT INTO table1 AS SELECT col1, col2 FROM table2C. INSERT INTO table1 VALUES (table2.col1, table2.col2)D. INSERT INTO table1 VALUES (SELECT col1, col2 FROM table2)E. INSERT INTO table1 (col1,col2) VALUES (SELECT col1,col2 FROM table2)(55/55)Given the following table definitions:DEPARTMENTDeptno CHAR(30)Deptname CHAR(30)Mgrno INTEGERAdmrdept CHAR(3)EMPLOYEEEmpno INTEGERFirstname CHAR(30)Midinit CHAR
  41. 41. Lastname CHAR(30)Workdept CHAR(3)Which of the following statements will list the employees employee number, last name, and department name ONLY for those employees who have a department?(Select the correct response)A. SELECT e.empno, e.lastname, d.deptname FROM employee e, department d WHEREe.workdept = d.deptnoB. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN department d ON e.workdept = d.deptnoC. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN department d ON e.workdept = d.deptnoD. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN department d WHERE e.workdept = d.deptno**********************************************************自测题 4--------------------------------------------------------------------------------(1/55). Which of the following tasks can be performed using the ALTER TABLESPACE statement?(Select the correct response)A. Assign a bufferpool.B. Change the table space name.C. Change the type of the table space.D. Change the page size of the table space.(2/55). Given the tables:COUNTRYID NAME PERSON CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5STAFFID LASTNAME1. Jones2. SmithsThe statement:SELECT * FROM staff,country
  42. 42. will return how many rows?(Select the correct response)A.2B.4C.5D.7E.10(3/55). Which of the following products can be used to generate Extensible Markup Language documents from DB2 tables?(Select the correct response)A. Net SearchB. XML ExtenderC. AVI ExtenderD. TXT Extender(4/55). Which of the following SQL statements can remove all rows from a table named COUNTRY?(Select the correct response)A.DELETE countryB.DELETE FROM countryC.DELETE * FROM countryD.DELETE ALL FROM country(5/55). Which of the following tools can be used to identify inefficient SQLstatements without executing the query?(Select the correct response)A. QMFB. Script CenterC. Visual ExplainD. Performance Monitor(6/55) Given the statement:CREATE TABLE t1(c1 INTEGER NOT NULL,c2 INTEGER,PRIMARY KEY(c1),FOREIGN KEY(c2) REFERENCES t2)How many non-unique indexes are defined for table t1?(Select the correct response)A. 0B. 1C. 2D. 3
  43. 43. (7/55) Given two embedded SQL program executions with the following actions:Pgm1INSERT INTO mytab VALUES (...)COMMITINSERT INTO mytab VALUES (...)ROLLBACKPgm2INSERT INTO mytab VALUES (...)ROLLBACKINSERT INTO mytab VALUES (...)COMMITHow many records will be successfully inserted and retained in the table mytab?(Select the correct response)A. 1B. 2C. 3D. 4(8/55) Given the following DDL statement:CREATE TABLE newtab1 LIKE tab1Which of the following would occur as a result of the statement execution?(Select the correct response)A NEWTAB1 has same triggers as TAB1B NEWTAB1 is populated with TAB1 dataC NEWTAB1 has the same primary key as TAB1D NEWTAB1 columns have same attributes as TAB1(9/55) Which of the following describes when indexes can be explicitly referenced by name within an SQL statement?(Select the correct response)A. When dropping the indexB. When updating the indexC. When selecting on the indexD. When inserting using the index(10/55) Which of the following can be accomplished with a single UPDATE statement?(Select the correct response)A. Updating multiple tablesB. Updating a view consisting of joined tablesC. Updating multiple tables based on a WHERE clauseD. Updating a table based on a sub-select using joined tables
  44. 44. (11/55) Which of the following is NOT a valid data type on CREATE TABLE?(Select the correct response)A. CLOBB. DOUBLEC. NUMERICD. DATETIME(12/55) Given the statement:CREATE TABLE t1(c1 CHAR(3)CONSTRAINT c1CHECK (c1 IN (A01,B01,C01)))DB2 verifies that the table check constraint is met during which of the following actions?(Select the correct response)A. Adding data using loadB. The reorg of the tableC. The insert of each row in t1D. The creation of the index for the table(13/55) If a DB2 Warehouse Manager toolkit is selected during the installation of DB2 UDB Version 7.1, which of the following databases must be defined?(Select the correct response)A. NoneB. Target DatabaseC. Source DatabaseD. Control Database(14/55) With DBADM authority on the database and given the statements:CREATE TABLE t1 (c1 CHAR(1))INSERT INTO t1 VALUES (b)CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 =aINSERT INTO v1 VALUES (a)INSERT INTO v1 VALUES (b)How many rows would be returned from the statement, SELECT c1 FROM t1?(Select the correct response)A. 0B. 1C. 2D. 3
  45. 45. (15/55) Which of the following occurs if an application ends abnormally during an active unit of work?(Select the correct response)A. Current unit of work is committedB. Current unit of work is rolled backC. Current unit of work remains activeD. Current unit of work moves to pending state(16/55) Which of the following Control Center features can be used to updateinformation for the optimizer to choose the best path to data?(Select the correct response)A. Show RelatedB. Generate DDLC. Run StatisticsD. Reorganize Table(17/55) Given the following:TAB1 TAB2C1 C2 CX CY-- -- -- --A 11 A 21B 12 B 22C 13 C 23The following results are desired:C1 C2 CX CY-- -- -- --A 11 A 21B 12 -- --C 13 C 22Which of the following joins will yield the desired results?(Select the correct response)A. SELECT * FROM tab1, tab2 WHERE c1=cxB. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cxC. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cxD. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx(18/55) Given the following table definition:STAFFId INTEGERName CHAR(20)Dept INTEGERJob CHAR(20)Years INTEGERSalary DECIMAL(10,2)Comm DECIMAL(10,2)The job column contains these job types: manager, clerk, and salesperson. Whi
  46. 46. ch of the following statements will return the data with all managers together, all clerks together and all salespeople together in the output?(Select the correct response)A. SELECT * FROM staff ORDER BY jobB. SELECT job, name FROM staff GROUP BY name, jobC. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, comm.D. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm.](19/55) Which of the following types of DB2 locks allows for the most concurrency within a table?(Select the correct response)A. A row lockB. A page lockC. A field lockD. A column lock(20/55) Which of the following CANNOT be used to restrict specific values from being inserted into a column in a particular table?(Select the correct response)A. viewB. indexC. check constraintD. referential constraint(21/55) Which of the following describes why savepoints are NOT allowed inside an atomic unit of work?(Select the correct response)A. Atomic units of work span multiple databases, but savepoints are limited to units of work which operate on a single database.B. A savepoint implies that a subset of the work may be allowed to succeed, while atomic operations must succeed or fail as a unit.C. A savepoint requires an explicit commit to be released, and commit statements are not allowed in atomic operations such as compound SQL.D. A savepoint cannot be created without an active connection to a database,but atomic operations can contain a CONNECT as a sub-statement.(22/55) Given the tables:TABLEA TABLEBEmpid name empid weeknumber paycheck1 JOE 1 1 1000.002 BOB 1 2 1000.002 1 2000.00TABLEB was defined as follows:CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2),
  47. 47. CONSTRAINT const1 FOREIGN KEY (empid)REFERENCES tablea (empid) ON DELETE SET NULL)How many rows would be deleted from tableb if the following command is issued:DELETE FROM tablea WHERE empid = 2?(Select the correct response)A. 0B. 1C. 2D. 3(23/55) Which two of the following DB2 authorization groups are authorized to create a table within database sample?(Select all that apply)A. DBADMB. DBCTRLC. SYSADMD. DBMAINTE. ALTERINF. SYSMAINT(24/55) Given the table T1 created by:CREATE TABLE t1(id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,c1 CHAR(10) NOT NULL,c2 CHAR(10))Which of the following INSERT statements will succeed?(Select the correct response)A. INSERT INTO t1 VALUES (1, abc, NULL)B. INSERT INTO t1 VALUES (1, NULL, def)C. INSERT INTO t1 (c1, c2) VALUES (abc, NULL)D. INSERT INTO t1 (c1, c2) VALUES (NULL, def)(25/55) Given the two following tables:NamesName NumberWayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Brett Hull 16Mario Lemieux 66Steve Yzerman 19Claude Lemieux 19
  48. 48. Mark Messier 11Mats Sundin 13PointsName PointsWayne Gretzky 244Jaromir Jagr 168Bobby Orr 129Bobby Hull 93Brett Hull 121Mario Lemieux 189Joe Sakic 94Which of the following statements will display the players Names, numbers and points for all players with an entry in both tables?(Select the correct response)A. SELECT names.names, names.number, points.points FROM names INNER JOIN points ON names.name=points.nameB. SELECT names.name, names.number, points.points FROM names FULL OUTER JOINpoints ON names.name=points.nameC. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOINpoints ON names.name=points.nameD. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOINpoints ON names.name=points.name(26/55) For which of the following database objects can locks be obtained?(Select the correct response)A. ViewB. TableC. TriggerD. Buffer Pool(27/55) When granted to user1, which of the following will allow user1 to ONLY access table data?(Select the correct response)A. DBADM authorityB. SYSADM authorityC. SELECT privilege on the tableD. SELECT privilege WITH GRANT OPTION on the table(28/55) Given the following SQL statements:CREATE TABLE tab1 (col1 INT)CREATE TABLE tab2 (col1 INT)INSERT INTO tab1 VALUES (NULL),(1)INSERT INTO tab2 VALUES (NULL),(1)SELECT COUNT(*) FROM tab1WHERE col1 IN(SELECT col1 FROM tab2)Which of the following is the result of the SELECT COUNT(*) statement?
  49. 49. (Select the correct response)A. 1B. 2C. 3D. 4E. 0(29/55) User2 has DBADM authority on database DB1. This allows the user to do which of the following?(Select the correct response)A. Drop database DB1B. Backup database DB1C. Create tables in any databaseD. Create tables in database DB1(30/55) When establishing client-server communication, passwords CANNOT be verified by:(Select the correct response)A. The DRDA DB2 server.B. The client operating system.C. The gateway operating system.D. Looking in the catalog tables for the password.(31/55) Given an application bound with cursor stability which will be updating rows in a table and obtaining row locks, which of the following table locks will DB2 acquire for the application first?(Select the correct response)A. U – updateB. X – exclusiveC. IU - intent updateD. IX - intent exclusive(32/55) The user USER1 is executing the statementCREATE TABLE app1.table1 (col1 INT, col2 INT)Which of the following privileges is required by USER1 for the statement to be successful?(Select the correct response)A. CREATEIN for the databaseB. CREATEIN for the schema app1C. CREATEIN for the schema user1D. CREATEIN for the table table1(33/55) Which of the following can occur once connected to a database or DRDA server with an explicit authorization name?(Select the correct response)A. Omit a users password.B. Change a users password if the server supports this function.C. Omit the name of the database or DRDA server if it is local.D. Use the commit option on the connect statement to commit in-doubt units of
  50. 50. work from a previous connection that was terminated.(34/55) Given the two following table definitions:ORGDeptnumb INTEGERDeptname CHAR(30)Manager INTEGERDivision CHAR(30)Location CHAR(30)STAFFId INTEGERName CHAR(30)Dept INTEGERJob CHAR(20)Years INTEGERSalary DECIMAL(10,2)Comm. DECIMAL(10,2)Which of the following statements will display each department, by name, andthe total salary of all employees in the department?(Select the correct response)A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.dept ORDER BY a.deptnameB. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.dept ORDER BY a.deptnameC. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.dept GROUP BY a.deptnameD. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.dept GROUP BY a.deptname(35/55) Given the following:A table containing a list of all seats on an airplane. A seat consists of a seat number and whether or not it is assigned. An airline agent lists all theunassigned seats on the plane. When the agent refreshes the list from the table, the list should not change.Which of the following isolation levels should be used for this application?(Select the correct response)A. Read stabilityB. Repeatable readC. Cursor stabilityD. Uncommitted read(36/55) The DB2 Administration Server (DAS) is required for which of the following?(Select the correct response)A. For the administrator user id to install or remove DB2B. For the remote clients to use the Control Center against the instance
  51. 51. C. For checking authorities in the database manager configuration for SYSADMD. For maintaining authorities added and removed by the SQL GRANT and REVOKEcommands respectively(37/55) Given the following scenario: An application uses a 15 digit value to uniquely identify customer transactions. This number is also used for arithmetic operations. Which of the following is the most efficient DB2 data typefor the column definition for this purpose?(Select the correct response)A. CHARB. CLOBC. INTEGERD. NUMERIC(15,2)E. DECIMAL(15,0)(38/55) Given a table T1, with a column C1 char(3), that contains strings inupper and lower case letters, which of the following queries will find all rows where C1 is the string ABC in any case?(Select the correct response)A. SELECT * FROM t1 WHERE c1 = ABCB. SELECT * FROM t1 WHERE UCASE(c1) = ABCC. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = ABC)D. SELECT * FROM t1 WHERE c1 = ABC WITH OPTION CASE INSENSITIVE(39/55) Which two of the following SQL data types should be used to store binary data?(Select all that apply)A. CLOBB. BLOBC. VARCHARD. GRAPHICE. VARCHAR FOR BIT DATA(40/55) In which of the following locations are the referential constraintsstored?(Select the correct response)A. The user tables.B. The explain tables.C. SYSIBM.SYSTRIGGERS.D. The system catalog tables.(41/55) Which of the following is the result of the following SQL statement:ALTER TABLE table1 ADD col2 INT WITH DEFAULT(Select the correct response)A. The statement fails with a negative SQL code.B. The statement fails because no default value is specified.C. A new column called COL2 is added to TABLE1 and populated with zeros.
  52. 52. D. A new column called COL2 is added to TABLE1 and populated with nulls.(42/55) A user creates the table TABLE1. Which of the following statements would explicitly give USER1 the ability to read rows from the table?(Select the correct response)A. GRANT VIEW TO user1 ON TABLE table1B. GRANT READ TO user1 ON TABLE table1C. GRANT SELECT ON TABLE table1 TO user1D. GRANT ACCESS ON TABLE table1 TO user1(43/55) Which of the following tools allows the DBA to set limits, and be alerted if these limits are exceeded?(Select the correct response)A. DB2 Index WizardB. DB2 Script CenterC. DB2 Command CenterD. DB2 Performance Monitor(44/55) Given the following embedded SQL programs:Program 1:Create table mytab (col1 int, col2 char(24))CommitProgram 2:Insert into mytab values ( 20989,Joe Smith)CommitInsert into mytab values ( 21334,Amy Johnson)Delete from mytabCommitInsert into mytab values ( 23430,Jason French)RollbackInsert into mytab values ( 20993,Samantha Jones)CommitDelete from mytab where col1=20993RollbackWhich of the following records will be returned by the statementSELECT * FROM mytab?(Select the correct response)A. 20989, Joe SmithB. 21334, Amy JohnsonC. 23430, Jason FrenchD. 20993, Samantha JonesE. No records are returned(45/55) Which of the following DB2 components allows the analysis of multidimensional databases?(Select the correct response)A. DB2 Runtime ClientB. DB2 Control CenterC. DB2 OLAP Starter Kit
  53. 53. D. DB2 Spatial ExtenderE. DB2 Performance Monitor(46/55) Which of the following DB2 UDB isolation levels will NOT lock any rows during read processing?(Select the correct response)A. Read StabilityB. Repeatable ReadC. Uncommited ReadD. Cursor Stability(47/55) Given the following table definition:STAFFId INTEGERName CHAR(20)Dept INTEGERJob CHAR(20)Years INTEGERSalary DECIMAL(10,2)Comm DECIMAL(10,2)Which of the following SQL statements will return the total number of employees in each department and the corresponding department id under the followingconditions:Only return departments with at least one employee receiving a commission greater than 5000. The result should be sorted by the department count from mostto least.(Select the correct response)A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER BY2 DESCB. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER BY2 DESCC. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORDER BY 2 DESCD. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORDER BY 3 DESC(48/55) Which of the following utilities can examine a table and its indexesand update the system catalogs with the tables statistical information?(Select the correct response)A. runstatsB. getstatsC. check indexD. chkstats(49/55) Which of the following Control Center options shows the dependenciesbetween a specific view and its tables?(Select the correct response)A. Show SQLB. Show Related
  54. 54. C. Sample ContentsD. Customize Columns(50/55) Given the table COUNTRY and the statements belowCOUNTRYID NAME PERSON_ID CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 10]4 Germany 1 05 France 7 5DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nameOPEN c1FETCH c1FETCH c1COMMITFETCH c1Which of the following is the last name obtained from the table?(Select the correct response)A. CubaB. FranceC. CanadaD. GermanyE. Argentina(51/55) To set up a client that can access DB2 UDB through DB2 Connect Enterprise Edition, which of the following is the minimum software client that must be installed?(Select the correct response)A. DB2 Runtime ClientB. DB2 Personal EditionC. DB2 Administration ClientD. DB2 Application Developers Client(52/55) Which of the following authorities should be given to the DB2 Administration Server (DAS) Instance owner at the administered instance?(Select the correct response)A. DBADMB. SYSADMC. SYSCTRLD. SYSMAINT(53/55) For a clustering index to be effective in keeping the data in order,which of the following parameters must be set correctly for the index?(Select the correct response)A. FREE ROWSB. PERCENT FREEC. CLUSTERRATIO
  55. 55. D. CLUSTER FACTOR(54/55) Which of the following processing can occur for a unit of work usingan isolation level of Read Stability and scanning through the table more than once within the unit of work?(Select the correct response)A. Access uncommitted changes made by other processesB. Update uncommitted changes made by other processesC. Rows added to a result set by other processes from one scan to the nextD. Rows changed in a result set by other processes from one scan to the next(55/55) Given a table T1, with a column C1 char(3), that contains strings inupper and lower case letters, which of the following queries will find all rows where C1 is the string ABC in any case?(Select the correct response)A. SELECT * FROM t1 WHERE c1 = ABCB. SELECT * FROM t1 WHERE UCASE(c1) = ABCC. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = ABC)D. SELECT * FROM t1 WHERE c1 = ABC WITH OPTION CASE INSENSITIVE*********************************************************自测题 5--------------------------------------------------------------------------------(1/55) When granted to user1, which of the following will allow user1 to ONLYaccess table data?(Select the correct response)A. DBADM authorityB. SYSADM authorityC. SELECT privilege on the tableD. SELECT privilege WITH GRANT OPTION on the table(2/55) Given the statement:CREATE TABLE t1(c1 INTEGER NOT NULL,c2 INTEGER,PRIMARY KEY(c1),FOREIGN KEY(c2) REFERENCES t2)How many non-unique indexes are defined for table t1?(Select the correct response)
  56. 56. A. 0B. 1C. 2D. 3(3/55) Which two of the following DB2 authorization groups are authorized tocreate a table within database sample?(Select all that apply)A. DBADMB. DBCTRLC. SYSADMD. DBMAINTE. ALTERINF. SYSMAINT(4/55) Given the following table definition:STAFFid INTEGERname CHAR(20)dept INTEGERjob CHAR(20)years INTEGERsalary DECIMAL(10,2)comm DECIMAL(10,2)The job column contains these job types: manager, clerk, and salesperson. Which of the following statements will return the data with all managers together, all clerks together and all salespeople together in the output?(Select the correct response)A. SELECT * FROM staff ORDER BY jobB. SELECT job, name FROM staff GROUP BY name, jobC. SELECT * FROM staff GROUP BY name, job, id, dept, years, salary, commD. SELECT * FROM staff ORDER BY name, job, id, dept, years, salary, comm(5/55) Which of the following describes why savepoints are NOT allowed inside an atomic unit of work?(Select the correct response)A. Atomic units of work span multiple databases, but savepoints are limited to units of work which operate on a single database.B. A savepoint implies that a subset of the work may be allowed to succeed, while atomic operations must succeed or fail as a unit.C. A savepoint requires an explicit commit to be released, and commit statements are not allowed in atomic operations such as compound SQL.D. A savepoint cannot be created without an active connection to a database, but atomic operations can contain a CONNECT as a sub-statement.
  57. 57. (6/55) Given the two following tables:NamesName NumberWayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Brett Hull 16Mario Lemieux 66Steve Yzerman 19Claude Lemieux 19Mark Messier 11Mats Sundin 13PointsName PointsWayne Gretzky 244Jaromir Jagr 168Bobby Orr 129Bobby Hull 93Brett Hull 121Mario Lemieux 189Joe Sakic 94Which of the following statements will display the players Names, numbers and points for all players with an entry in both tables?(Select the correct response)A. SELECT names.names, names.number, points.points FROM names INNER JOINpoints ON names.name=points.nameB. SELECT names.name, names.number, points.points FROM names FULL OUTERJOIN points ON names.name=points.nameC. SELECT names.name, names.number, points.points FROM names LEFT OUTERJOIN points ON names.name=points.nameD. SELECT names.name, names.number, points.points FROM names RIGHT OUTERJOIN points ON names.name=points.name(7/55) Given the following scenario: An application uses a 15 digit value touniquely identify customer transactions. This number is also used for arithmetic operations. Which of the following is the most efficient DB2 data type for the column definition for this purpose?(Select the correct response)A. CHARB. CLOBC. INTEGERD. NUMERIC(15,2)E. DECIMAL(15,0)(8/55) Which of the following can be accomplished with a single UPDATE statement?
  58. 58. (Select the correct response)A. Updating multiple tablesB. Updating a view consisting of joined tablesC. Updating multiple tables based on a WHERE clauseD. Updating a table based on a sub-select using joined tables(9/55) Given the tables:COUNTRYID NAME PERSON CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5STAFFID LASTNAME1 Jones2 SmithThe statement:SELECT * FROM staff, countrywill return how many rows?(Select the correct response)A. 2B. 4C. 5D. 7E. 10(10/55) A user creates the table TABLE1. Which of the following statements would explicitly give USER1 the ability to read rows from the table?(Select the correct response)A. GRANT VIEW TO user1 ON TABLE table1B. GRANT READ TO user1 ON TABLE table1C. GRANT SELECT ON TABLE table1 TO user1D. GRANT ACCESS ON TABLE table1 TO user1(11/55) Given the following:A table containing a list of all seats on an airplane. A seat consists of a seat number and whether or not it is assigned. An airline agent lists all theunassigned seats on the plane. When the agent refreshes the list from the table, the list should not change.Which of the following isolation levels should be used for this application?(Select the correct response)A. Read stabilityB. Repeatable readC. Cursor stability
  59. 59. D. Uncommitted read(12/55) Which of the following Control Center options shows the dependenciesbetween a specific view and its tables?(Select the correct response)A. Show SQLB. Show RelatedC. Sample ContentsD. Customize Columns(13/55) Given the following:TAB1 TAB2C1 C2 CX CY-- -- -- --A 11 A 21B 12 C 22C 13 D 23The following results are desired:C1 C2 CX CY-- -- -- --A 11 A 21B 12 - -C 13 C 22Which of the following joins will yield the desired results?(Select the correct response)A. SELECT * FROM tab1, tab2 WHERE c1=cxB. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cxC. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cxD. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx(14/55) To set up a client that can access DB2 UDB through DB2 Connect Enterprise Edition, which of the following is the minimum software client that must be installed?(Select the correct response)A. DB2 Runtime ClientB. DB2 Personal EditionC. DB2 Administration ClientD. DB2 Application Developers Client(15/55) The user USER1 is executing the statementCREATE TABLE app1.table1 (col1 INT, col2 INT)Which of the following privileges is required by USER1 for the statement to be successful?(Select the correct response)A. CREATEIN for the databaseB. CREATEIN for the schema app1C. CREATEIN for the schema user1D. CREATEIN for the table table1(16/55) Which of the following DB2 components allows the analysis of multidi
  60. 60. mensional databases?(Select the correct response)A. DB2 Runtime ClientB. DB2 Control CenterC. DB2 OLAP Starter KitD. DB2 Spatial ExtenderE. DB2 Performance Monitor(17/55) Which of the following tools can be used to identify inefficient SQLstatements without executing the query?(Select the correct response)A. QMFB. Script CenterC. Visual ExplainD. Performance Monitor(18/55) When establishing client-server communication, passwords CANNOT be verified by:(Select the correct response)A. The DRDA DB2 server.B. The client operating system.C. The gateway operating system.D. Looking in the catalog tables for the password.(19/55) Which two of the following SQL data types should be used to store binary data?(Select all that apply)A. CLOBB. BLOBC. VARCHARD. GRAPHICE. VARCHAR FOR BIT DATA(20/55) Which of the following occurs if an application ends abnormally during an active unit of work?(Select the correct response)A. Current unit of work is committedB. Current unit of work is rolled backC. Current unit of work remains activeD. Current unit of work moves to pending state(21/55) Which of the following products can be used to generate Extensible Markup Language documents from DB2 tables?(Select the correct response)A. Net SearchB. XML ExtenderC. AVI ExtenderD. Text Extender
  61. 61. (22/55) Which of the following SQL statements can remove all rows from a table named COUNTRY?(Select the correct response)A. DELETE countryB. DELETE FROM countryC. DELETE * FROM countryD. DELETE ALL FROM country(23/55) Given the statement:CREATE TABLE t1(c1 CHAR(3)CONSTRAINT c1CHECK (c1 IN (A01,B01,C01)))DB2 verifies that the table check constraint is met during which of the following actions?(Select the correct response)A. Adding data using loadB. The reorg of the tableC. The insert of each row in t1D. The creation of the index for the table(24/55) Given the following DDL statement:CREATE TABLE newtab1 LIKE tab1Which of the following would occur as a result of the statement execution?(Select the correct response)A. NEWTAB1 has same triggers as TAB1B. NEWTAB1 is populated with TAB1 dataC. NEWTAB1 has the same primary key as TAB1D. NEWTAB1 columns have same attributes as TAB1(25/55) Which of the following authorities should be given to the DB2 Administration Server (DAS) Instance owner at the administered instance?(Select the correct response)A. DBADMB. SYSADMC. SYSCTRLD. SYSMAINT(26/55) Which of the following is the result of the following SQL statement:ALTER TABLE table1 ADD col2 INT WITH DEFAULT(Select the correct response)A. The statement fails with a negative SQL code.B. The statement fails because no default value is specified.C. A new column called COL2 is added to TABLE1 and populated with zeros.D. A new column called COL2 is added to TABLE1 and populated with nulls.
  62. 62. E. A new column called COL2, which cannot contain nulls, is added to TABLE1.(27/55) Given the following table definition:STAFFid INTEGERname CHAR(20)dept INTEGERjob CHAR(20)years INTEGERsalary DECIMAL(10,2)comm DECIMAL(10,2)Which of the following SQL statements will return the total number of employees in each department and the corresponding department id under the followingconditions:Only return departments with at least one employee receiving a commission greater than 5000. The result should be sorted by the department count from mostto least.(Select the correct response)A. SELECT dept, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept ORDER BY 2 DESCB. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm > 5000 ORDER BY 2 DESCC. SELECT dept, COUNT(*) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORDER BY 2 DESCD. SELECT dept, comm, COUNT(id) FROM staff WHERE comm > 5000 GROUP BY dept, comm ORDER BY 3 DESC(28/55) Which of the following Control Center features can be used to updateinformation for the optimizer to choose the best path to data?(Select the correct response)A. Show RelatedB. Generate DDLC. Run StatisticsD. Reorganize Table(29/55) Which of the following can occur once connected to a database or DRDA server with an explicit authorization name?(Select the correct response)A. Omit a users password.B. Change a users password if the server supports this function.C. Omit the name of the database or DRDA server if it is local.D. Use the commit option on the connect statement to commit in-doubt units of work from a previous connection that was terminated.(30/55) If a DB2 Warehouse Manager toolkit is selected during the installation of DB2 UDB Version 7.1, which of the following databases must be defined?
  63. 63. (Select the correct response)A. NoneB. Target DatabaseC. Source DatabaseD. Control Database(31/55) Which of the following CANNOT be used to restrict specific values from being inserted into a column in a particular table?(Select the correct response)A. viewB. indexC. check constraintD. referential constraint(32/55) For which of the following database objects can locks be obtained?(Select the correct response)A. ViewB. TableC. TriggerD. Buffer Pool(33/55) Which of the following types of DB2 locks allows for the most concurrency within a table?(Select the correct response)A. A row lockB. A page lockC. A field lockD. A column lock(34/55) Given the following embedded SQL programs:Program 1:Create table mytab (col1 int, col2 char(24))CommitProgram 2:Insert into mytab values ( 20989,Joe Smith)CommitInsert into mytab values ( 21334,Amy Johnson)Delete from mytabCommitInsert into mytab values ( 23430,Jason French)RollbackInsert into mytab values ( 20993,Samantha Jones)CommitDelete from mytab where col1=20993RollbackWhich of the following records will be returned by the statementSELECT * FROM mytab?(Select the correct response)A. 20989, Joe Smith
  64. 64. B. 21334, Amy JohnsonC. 23430, Jason FrenchD. 20993, Samantha JonesE. No records are returned(35/55) Given a table T1, with a column C1 char(3), that contains strings inupper and lower case letters, which of the following queries will find all rows where C1 is the string ABC in any case?(Select the correct response)A. SELECT * FROM t1 WHERE c1 = ABCB. SELECT * FROM t1 WHERE UCASE(c1) = ABCC. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = ABC)D. SELECT * FROM t1 WHERE c1 = ABC WITH OPTION CASE INSENSITIVE(36/55) In which of the following locations are the referential constraintsstored?(Select the correct response)A. The user tables.B. The explain tables.C. SYSIBM.SYSTRIGGERS.D. The system catalog tables.(37/55) Given the table T1 created by:CREATE TABLE t1(id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY,c1 CHAR(10) NOT NULL,c2 CHAR(10))Which of the following INSERT statements will succeed?(Select the correct response)A. INSERT INTO t1 VALUES (1, abc, NULL)B. INSERT INTO t1 VALUES (1, NULL, def)C. INSERT INTO t1 (c1, c2) VALUES (abc, NULL)D. INSERT INTO t1 (c1, c2) VALUES (NULL, def)(38/55) For a clustering index to be effective in keeping the data in order,which of the following parameters must be set correctly for the index?(Select the correct response)A. FREE ROWSB. PERCENT FREEC. CLUSTERRATIOD. CLUSTER FACTOR(39/55) Which of the following is NOT a valid data type on CREATE TABLE?(Select the correct response)A. CLOBB. DOUBLEC. NUMERIC
  65. 65. D. DATETIME(40/55) User2 has DBADM authority on database DB1. This allows the user to do which of the following?(Select the correct response)A. Drop database DB1B. Backup database DB1C. Create tables in any databaseD. Create tables in database DB1(41/55) Which of the following describes when indexes can be explicitly referenced by name within an SQL statement?(Select the correct response)A. When dropping the indexB. When updating the indexC. When selecting on the indexD. When inserting using the index(42/55) The DB2 Administration Server (DAS) is required for which of the following?(Select the correct response)A. For the administrator user id to install or remove DB2B. For the remote clients to use the Control Center against the instanceC. For checking authorities in the database manager configuration for SYSADMD. For maintaining authorities added and removed by the SQL GRANT and REVOKE commands respectively(43/55) Which of the following tasks can be performed using the ALTER TABLESPACE statement?(Select the correct response)A. Assign a bufferpool.B. Change the table space name.C. Change the type of the table space.D. Change the page size of the table space.(44/55) Given the tables:TABLEA TABLEBempid name empid weeknumber paycheck1 JOE 1 1 1000.002 BOB 1 2 1000.002 1 2000.00TABLEB was defined as follows:CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2),CONSTRAINT const1 FOREIGN KEY (empid)
  66. 66. REFERENCES tablea (empid) ON DELETE SET NULL)How many rows would be deleted from tableb if the following command is issued:DELETE FROM tablea WHERE empid = 2?(Select the correct response)A. 0B. 1C. 2D. 3(45/55) Given an embedded SQL program with a single connection, two threadsand the following actions:Thread 1: INSERT INTO mytab VALUES (...)Thread 2: INSERT INTO mytab VALUES (...)Thread 1: ROLLBACKThread 2: INSERT INTO mytab VALUES (...)Thread 1: COMMITHow many records will be successfully inserted into the table mytab?(Select the correct response)A. 0B. 1C. 2D. 3(46/55) Given the two following table definitions:ORGdeptnumb INTEGERdeptname CHAR(30)manager INTEGERdivision CHAR(30)location CHAR(30)STAFFid INTEGERname CHAR(30)dept INTEGERjob CHAR(20)years INTEGERsalary DECIMAL(10,2)comm DECIMAL(10,2)Which of the following statements will display each department, by name, andthe total salary of all employees in the department?(Select the correct response)A. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.dept ORDER BY a.deptnameB. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.dept ORDER BY a.deptnameC. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb
  67. 67. =b.dept GROUP BY a.deptnameD. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.dept GROUP BY a.deptname(47/55) Which of the following processing can occur for a unit of work usingan isolation level of Read Stability and scanning through the table more than once within the unit of work?(Select the correct response)A. Access uncommitted changes made by other processesB. Update uncommitted changes made by other processesC. Rows added to a result set by other processes from one scan to the nextD. Rows changed in a result set by other processes from one scan to thenext(48/55) Which of the following DB2 UDB isolation levels will NOT lock any rows during read processing?(Select the correct response)A. Read StabilityB. Repeatable ReadC. Uncommited ReadD. Cursor Stability(49/55) With DBADM authority on the database and given the statements:CREATE TABLE t1 (c1 CHAR(1))INSERT INTO t1 VALUES (b)CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1 =aINSERT INTO v1 VALUES (a)INSERT INTO v1 VALUES (b)How many rows would be returned from the statement, SELECT c1 FROM t1?(Select the correct response)A. 0B. 1C. 2D. 3(50/55) Which of the following tools allows the DBA to set limits, and be alerted if these limits are exceeded?(Select the correct response)A. DB2 Index WizardB. DB2 Script CenterC. DB2 Command CenterD. DB2 Performance Monitor(51/55) Which of the following utilities can examine a table and its indexesand update the system catalogs with the tables statistical information?(Select the correct response)A. runstatsB. getstats

×