|
DB2考试自测题
[b][color=blue]关于DB2认证相关信息(试题、考试等)可以到这儿查阅或交流![/color][/b]
[url=http://www-900.ibm.com/developerWorks/cn/dmdd/library/techarticles/dm-0401fosdick/index.shtml][color=blue]db2认证的IBM官方站点[/color][/url]
[b]DB2考试自测题1 [/b]
1) Which of the following products is required to be installed in order to bu ild an application on AIX, which will access a DB2 UDB for OS/390 database?
a) DB2 Connect Personal Edition
b) DB2 Universal Database Workgroup Edition
c) DB2 Personal Developer's Edition
d) DB2 Universal Developer's Edition
2) Which of the following tools can be used to catalog a database?
a) Journal
b) Alert Center
c) License Center
d) Client Configuration Assistant
3) Which of the following utilities would you run to order data and reclaim s
pace from deleted rows in a table:
a) reorg
b) db2look
c) db2move
d) runstats
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.
d) create table spaces within a database.
5) Which two of the following authorities can create a database?
a) DBADM
b) SYSADM
c) DBCTRL
d) SYSCTRL
e) SYSMAINT
6) Cataloging a remote database is:
a) Performed on a PC or UNIX machine to identify the server the DB2 data base manager is on.
b) Performed on a PC or UNIX machine to identify the DB2 database to use rs and applications.
c) Never performed in DB2, as only one database per node is allowed, so cataloging a node automatically catalogs the database at that node.
d) Performed on a PC or UNIX machine to open the catalogs in the DB2 dat abase and present a user with a list of all accessible tables in that database.
7) Given the create statements:
CREATE DISTINCT TYPE kph AS INTEGER WITH COMPARISONS
CREATE DISTINCT TYPE mph AS INTEGER WITH COMPARISONS
CREATE 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 >; 80
b) SELECT route_num FROM speed_limits WHERE canada_sl >; kph
c) SELECT route_num FROM speed_limits WHERE canada_sl >; us_sl
d) 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:
COUNTRY
ID NAME PERSON CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
STAFF
ID LASTNAME
1 Jones
2 Smith
Which of the following statements removes the rows from the COUNTRY table that 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)
10) The table STOCK has the following column definitions:
type CHAR (1)
status CHAR(1)
quantity INTEGER
price DEC (7,2)
Items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero. Which of the following statements updates the STOCK table to indicate that 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 ; 'S'
b) UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE type ; 'S'
c) UPDATE stock SET (status, quantity, price) = ('NULL', 0, 0) WHERE type; 'S'
d) UPDATE stock SET status = NULL, SET quantity=0, SET price = 0 WHERE type ; 'S'
11) Which of the following products can be used to store image data in a DB2 database?
a) Net.Data
b) Net Search
c) DB2 AVI Extenders
d) DB2 XML Extenders
e) DB2 Text Extenders
12) Which of the following CANNOT have an autocommit setting?
a) Embedded SQL
b) The Command Center
c) The Command Line Processor
d) The DB2 Call Level Interface
13) Which of the following statements eliminates all but one of each set of d
uplicate rows in the final result table?
a) SELECT UNIQUE * FROM t1
b) SELECT DISTINCT * FROM t1
c) SELECT * FROM DISTINCT T1
d) SELECT UNIQUE (*) FROM t1
e) SELECT DISTINCT (*) FROM t1
14) Given the table:
STAFF
ID LASTNAME
1 Jones
2 Smith
3 ;
Which of the following statements removes all rows from the table where there is a NULL value for LASTNAME?
a) DELETE FROM staff WHERE lastname IS NULL
b) DELETE ALL FROM staff WHERE lastname IS NULL
c) DELETE FROM staff WHERE lastname = 'NULL'
d) DELETE ALL FROM staff WHERE lastname = 'NULL'
15) Given the following table definitions:
DEPARTMENT
deptno CHAR(3)
deptname CHAR(30)
mgrno INTEGER
admrdept CHAR(3)
EMPLOYEE
empno INTEGER
firstname CHAR(30)
midinit CHAR
lastname CHAR(30)
workdept CHAR(3)
Which of the following statements will list every employee's number and last name with the employee number and last name of their manager, including employees without a manager?
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 = deptno
b) SELECT e.empno, e.lastname, m.empno, m.lastname, FROM employee e LEFT OUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno
c) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT OUTER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno
d) SELECT e.empno, e.lastname, m.empno, m.lastname FROM employee e RIGHT INNER JOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptno
16) Given the following tables:
NAMES
Name Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13
POINTS
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
PIM
Name PIM
Mats Sundin 14
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, numbers, points and PIM 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.name
b) 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.name
c) 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.name
d) 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.name
17) Given the tables:
EMPLOYEE
emp_num emp_name dept
1 Adams 1
2 Jones 1
3 Smith 2
4 Williams 1
DEPT
dept_id dept_name
1 Planning
1 Support
and the statement:
ALTER TABLE employee
ADD FOREIGN KEY (dept) REFERENCES (dept_id)
ON DELETE CASCADE
How many units of work will be needed to process this statement:
DELETE FROM dept WHERE dept_id=1
a) 0
b) 1
c) 2
d) 3
e) 4
f) 6
18) 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) CLOB
b) TIME
c) VARCHAR
d) TIMESTAMP
19) Given the transaction:
"CREATE TABLE t1 (id INTEGER,CONSTRAINT chkid CHECK (id; 1will insert how many rows into the STAFF table?
a) 0
b) 1
c) 2
d) 3
30) 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 usera
Which of the following SQL statements will revoke privileges for user USERA on COL1 and COL2?
a) REVOKE UPDATE ON TABLE table1 FROM USER usera
b) REVOKE ALL PRIVILEGES ON TABLE table1 FROM USER usera
c) REVOKE ALL PRIVILEGES ON TABLE table1 COLUMNS (col1, col2) FROM USERA
d) REVOKE REFERENCES ON TABLE table1 COLUMNS (col1, col2) FROM USER usera
31) Given, CREATE TABLE t1 (c1 CHAR(4) NOT NULL). Which of the following can be inserted into this table?
a) 4
b) NULL
c) ‘abc’
d) ‘abcde’
32) A declared temporary table is used for which of the following purposes:
a) backup purposes
b) storing intermediate results
c) staging area for the load utility
d) sharing result sets between applications
33) 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) DELETE
b) CASCADE
c) RESTRICT
d) SET NULL
34) 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 processes
b) Update uncommitted changes made by other processes
c) Update rows of a return set and have those updates changed by other processes from one scan to the next
d) Update rows of a return set and have those updates committed by other processes from one scan to the next
35) Which of the following database authorities is required to add a new package?
a) BINDADD
b) CREATETAB
c) CREATEPKG
d) PACKAGEADD
36) Given the successfully executed embedded SQL:
INSERT INTO staff VALUES (1, 'Colbert','Dorchester', 1)
COMMIT
INSERT INTO staff VALUES (6, 'Anders', 'Cary', 6)
INSERT INTO staff VALUES (3, 'Gaylord', 'Geneva',
ROLLBACK WORK
Which of the following indicates the number of new rows that would be in the STAFF table?
a) 0
b) 1
c) 2
d) 3
37) Given the two table definitions:
ORG
deptnumb INTEGER
deptname CHAR(30)
manager INTEGER
division CHAR(30)
location CHAR(30)
STAFF
id INTEGER
name CHAR(30)
dept INTEGER
job 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.id
b) SELECT a.deptname, b.name FROM org a, staff b WHERE b.manager=a.id
c) SELECT a.deptname, b.name FROM org a, staff b WHERE a.manager=b.id GROUP BY a.deptname, b.name
d) SELECT a.deptname, b.name FROM org a, staff b, WHERE b.manager=a.id GROUP BY a.deptname, b.name
38) 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, Windows or OS/2. At a minimum, which of the following is required to be the DB2 server machine?
a) DB2 Connect Enterprise Edition
b) DB2 Universal Database Enterprise Edition
c) DB2 Connect and DB2 Universal Database Workgroup Edition
d) DB2 Connect and DB2 Universal Database Enterprise Edition
40) Given the statements and operations:
"CREATE TABLE t1 (c1 CHAR(1))"
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 only
b) deleted from T1 and written into the t1exp file
c) deleted from T1 and inserted into the table t1exp
d) deleted from T1 and written into the db2diag.log file
e) deleted from T1 and inserted into the table syscat.checks
41) 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 stability
b) Repeatable read
c) Cursor stability
d) Uncommitted read |
|
(1/55) Which of the following products must be installed to provide a single point of control forlocal and remote DB2 databases? (Select the correct response)
A. DB2 Runtime Client
B. DB2 Administration Client
C. DB2 Connect Enterprise Edition
D. 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. Journal
B. SQL Assist
C. DB2 Alert Center
D. DB2 Command Center
(3/55) Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response)
A. -f
B. -b
C. -o
D. -w
(4/55) Which of the following will rebuild a package in the database from the existing catalog information? (Select the correct response)
A. bind
B. rebind
C. update
D. rebuild
(5/55) Which two of the following types of storage management method is supported by DB2 OLAP Server ? (Select all that apply)
A. Object
B. Network
C. Relational
D. Hierarchical
E. Multi-dimensional
(6/55) Which of the following DB2 components can limit the resource consumption of queries? (Select the correct response)
A. DB2 Connect
B. DB2 Query Patroller
C. DB2 Performance Monitor
D. 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. 0
B. 1
C. One for each instance on the physical machine
D. 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. ODBC
B. JAVA
C. DB2 Administration Server
D. Client Configuration Assistant
(9/55) Which of the following privileges is necessary to populate the table with large amounts of
data? (Select the correct response)
A. LOAD
B. ALTER
C. UPDATE
D. IMPORT
(10/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 table
B. Using an index on the column
C. Using a referential constraint on the table
D. Using a table check constraint on the table
E. 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 a table? (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 access to 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 the confidential 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 the confidential 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 SELECT privilege 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 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 a good way to keep users from submitting long-running queries against the catalogs.
(13/55) When manually establishing communications from a Windows NT client through 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.
(14/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 Center
B. DB2 Performance Monitor
C. DB2 Control Center, Show Related
D. DB2 Control Center, Sample Contents
(15/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. Copy
B. Show SQL
C. Show Related
D. 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 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)
(17/55) Which one of the following SQL statements sets the default qualifier to "user1"? (Select the correct response)
A. SET CURRENT ID = 'user1'
B. SET CURRENT USER = 'user1'
C. SET CURRENT SQLID = 'user1'
D. 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)
ROLLBACK
Which 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 2
1 record(s) selected.
C. SQLCODE -204 indicating that "DWAINE.MYTAB" is an undefined name.
D. COL1 COL2
----------- -----------
1 2
4 3
2 record(s) selected.
(20/55) Which of the following does NOT end a unit of work? (Select the correct response)
A. COMMIT
B. ROLLBACK
C. TERMINATE
D. SAVEPOINT
E. 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 t1
WHERE a >; 250
WITH CHECK OPTION
Which 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 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) 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. 0
B. 1
C. 2
D. 5
E. 6
(25/55) Given the following:TAB1 TAB2
C1 C2 CX CY
--- --- --- ---
A 11 A 21
B 12 C 22
C 13 D 23
The following results are desired:C1 C2 CX CY
-- -- -- --
A 11 A 21
C 13 C 22
- - D 23
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. 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 address1
WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which 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 defined as primary keys.
D. The statement will succeed if the data retrieved from the subquery does not have duplicate values 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 from table T1? (Select the correct response)
A. SELECT * FROM t1 MAXIMUM 10 ROWS
B. SELECT * FROM t1 READ 10 ROWS ONLY
C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS
D. SELECT * FROM t1 FETCH FIRST 10 ROWS ONLY
(29/55) Given the two following tables:
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
PIM
Name PIM
Mats Sundin 14
Jaromir Jagr 18
Bobby Orr 12
Mark Messier 32
Brett Hull 66
Mario Lemieux 23
Joe Sakic 94
Which of the following statements will display the player's Names, points and PIM 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.name
B. SELECT points.name, points.points, pim.name, pim.pim FROM points FULL OUTER JOIN pim ON points.name=pim.name
C. SELECT points.name, points.points, pim.name, pim.pim FROM points LEFT OUTER JOIN pim ON points.name=pim.name
D. SELECT points.name, points.points, pim.name, pim.pim FROM points RIGHT OUTER JOIN pim ON points.name=pim.name
(30/55) Given the following table definitions:
DEPARTMENT
deptno CHAR(3)
deptname CHAR(30)
mgrno INTEGER
admrdept CHAR(3)
EMPLOYEE
empno INTEGER
firstname CHAR(30)
midinit CHAR
lastname CHAR(30)
workdept CHAR(3)
Which of the following statements will list the employee's 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 WHERE e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN department d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN department d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN department d WHERE e.workdept = d.deptno
(31/55) Given the table:
COUNTRY
ID NAME PERSON CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
Which of the following clauses when added to the statement
SELECT cities, name FROM country
returns rows sorted by NAME and then sorted by the number of cities (CITIES)?
(Select the correct response)
A. ORDER BY 2,1
B. GROUP BY 2, 1
C. ORDER BY cities, name
D. GROUP BY cities, name
(32/55) Given the following table definition:
STAFF
id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary DECIMAL(10,2)
comm DECIMAL(10,2)
Which of the following statements will return all of the records ordered by j
ob
with the salaries in descending order?
(Select the correct response)
A. SELECT * FROM staff ORDER BY salary DESC, job
B. SELECT * FROM staff GROUP BY salary DESC, job
C. SELECT * FROM staff ORDER BY job, salary DESC
D. SELECT * FROM staff GROUP BY job, salary DESC
(33/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.15
WHERE salary |
|
DB2考试自测题3
(1/55) Given two embedded SQL programs and the following actions:
Pgm1 Pgm2
INSERT INTO mytab VALUES DELETE FROM mytab
(...)
COMMIT ROLLBACK
DELETE FROM mytab (...)
ROLLBACK COMMIT
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. 0
B. 1
C. 2
D. 3
E. 4
(2/55)Which of the following DB2 CLP options specify the file that contains the statements to be executed? (Select the correct response)
A. –F
B. –B
C. –O
D. –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 database
B. Provide users with the ability to define indexes
C. Restrict user's access to a subset of the table data
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 address1 WHERE address2.id = address1.id)
WHERE HOUSENUMBER_BUILDINGNAME IS NULL
Which 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 1000000
Col2 Job Code - Variable, 1 to 2 characters long
Col3 Job Description - Variable, 1 to 100 characters long
Col4 Job Length - Length of Job in seconds
Which 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. bind
B. rebind
C. update
D. rebuild
(8/55)With tables defined as:
Table1
col1 INT
col2 CHAR(30)
Table2
col1 INT
col2 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 table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. 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 threads and the following actions:
Thread 1: INSERT INTO mytab VALUES (...)
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 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 Center
B. DB2 Performance Monitor
C. DB2 Control Center, Show Related
D. 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 the temporary table.
(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.15
WHERE salary ; 250
WITH CHECK OPTION
Which 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? (Select the correct response)
A. SELECT * FROM t1 MAXIMUM 10 ROWS
B. SELECT * FROM t1 READ 10 ROWS ONLY
C. SELECT * FROM t1 OPTIMIZE FOR 10 ROWS
D. 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 the unassigned 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 stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read
(54/55)With tables defined as:
Table1
col1 INT
col2 CHAR(30)
Table2
col1 INT
col2 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 table2
B. INSERT INTO table1 AS SELECT col1, col2 FROM table2
C. 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:
DEPARTMENT
Deptno CHAR(30)
Deptname CHAR(30)
Mgrno INTEGER
Admrdept CHAR(3)
EMPLOYEE
Empno INTEGER
Firstname CHAR(30)
Midinit CHAR
Lastname CHAR(30)
Workdept CHAR(3)
Which of the following statements will list the employee's 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 WHERE e.workdept = d.deptno
B. SELECT e.empno, e.lastname, d.deptname FROM employee e LEFT OUTER JOIN department d ON e.workdept = d.deptno
C. SELECT e.empno, e.lastname, d.deptname FROM employee e FULL OUTER JOIN department d ON e.workdept = d.deptno
D. SELECT e.empno, e.lastname, d.deptname FROM employee e RIGHT OUTER JOIN department d WHERE e.workdept = d.deptno |
|
DB2考试自测题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:
COUNTRY
ID NAME PERSON CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
STAFF
ID LASTNAME
1. Jones
2. Smiths
The statement:
SELECT * FROM staff,country
will return how many rows?
(Select the correct response)
A.2
B.4
C.5
D.7
E.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 Search
B. XML Extender
C. AVI Extender
D. 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 country
B.DELETE FROM country
C.DELETE * FROM country
D.DELETE ALL FROM country
(5/55). Which of the following tools can be used to identify inefficient SQL statements without executing the query? (Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. 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. 0
B. 1
C. 2
D. 3
(7/55) Given two embedded SQL program executions with the following actions:
Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK
Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table mytab?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
(8/55) Given the following DDL statement:
CREATE TABLE newtab1 LIKE tab1
Which of the following would occur as a result of the statement execution?
(Select the correct response)
A NEWTAB1 has same triggers as TAB1
B NEWTAB1 is populated with TAB1 data
C NEWTAB1 has the same primary key as TAB1
D 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 index
B. When updating the index
C. When selecting on the index
D. 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 tables
B. Updating a view consisting of joined tables
C. Updating multiple tables based on a WHERE clause
D. Updating a table based on a sub-select using joined tables
(11/55) Which of the following is NOT a valid data type on CREATE TABLE? (Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
D. DATETIME
(12/55) Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (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 load
B. The reorg of the table
C. The insert of each row in t1
D. 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. None
B. Target Database
C. Source Database
D. 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 ='a'
INSERT 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. 0
B. 1
C. 2
D. 3
(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 committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. 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 Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table
(17/55) Given the following:
TAB1 TAB2
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 B 22
C 13 C 23
The following results are desired:
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 -- --
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx
(18/55) Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary 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 job
B. SELECT job, name FROM staff GROUP BY name, job
C. 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 lock
B. A page lock
C. A field lock
D. 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. view
B. index
C. check constraint
D. 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 TABLEB
Empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 2000.00
TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
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. 0
B. 1
C. 2
D. 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. DBADM
B. DBCTRL
C. SYSADM
D. DBMAINT
E. ALTERIN
F. 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:
Names
Name Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
Joe Sakic 94
Which of the following statements will display the player's 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.name
B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN points ON names.name=points.name
C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name
D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name
(26/55) For which of the following database objects can locks be obtained? (Select the correct response)
A. View
B. Table
C. Trigger
D. 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 authority
B. SYSADM authority
C. SELECT privilege on the table
D. 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 tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
E. 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 DB1
B. Backup database DB1
C. Create tables in any database
D. 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 – update
B. X – exclusive
C. IU - intent update
D. IX - intent exclusive
(32/55) The user USER1 is executing the statement
CREATE 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 database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. 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 user's password.
B. Change a user's 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.
(34/55) Given the two following table definitions:
ORG
Deptnumb INTEGER
Deptname CHAR(30)
Manager INTEGER
Division CHAR(30)
Location CHAR(30)
STAFF
Id INTEGER
Name CHAR(30)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary DECIMAL(10,2)
Comm. DECIMAL(10,2)
Which of the following statements will display each department, by name, and the 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.deptname
B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.dept ORDER BY a.deptname
C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.dept GROUP BY a.deptname
D. 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 the unassigned 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 stability
B. Repeatable read
C. Cursor stability
D. 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 DB2
B. For the remote clients to use the Control Center against the instance
C. For checking authorities in the database manager configuration for SYSADM
D. For maintaining authorities added and removed by the SQL GRANT and REVOKE commands 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 type for the column definition for this purpose? (Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. 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 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. 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. CLOB
B. BLOB
C. VARCHAR
D. GRAPHIC
E. VARCHAR FOR BIT DATA
(40/55) In which of the following locations are the referential constraints stored? (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.
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 table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. 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 Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor
(44/55) Given the following embedded SQL programs:
Program 1:
Create table mytab (col1 int, col2 char(24))
Commit
Program 2:
Insert into mytab values ( 20989,'Joe Smith')
Commit
Insert into mytab values ( 21334,'Amy Johnson')
Delete from mytab
Commit
Insert into mytab values ( 23430,'Jason French')
Rollback
Insert into mytab values ( 20993,'Samantha Jones')
Commit
Delete from mytab where col1=20993
Rollback
Which of the following records will be returned by the statement
SELECT * FROM mytab?
(Select the correct response)
A. 20989, Joe Smith
B. 21334, Amy Johnson
C. 23430, Jason French
D. 20993, Samantha Jones
E. No records are returned
(45/55) Which of the following DB2 components allows the analysis of multidi mensional databases? (Select the correct response)
A. DB2 Runtime Client
B. DB2 Control Center
C. DB2 OLAP Starter Kit
D. DB2 Spatial Extender
E. 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 Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability
(47/55) Given the following table definition:
STAFF
Id INTEGER
Name CHAR(20)
Dept INTEGER
Job CHAR(20)
Years INTEGER
Salary 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 following conditions:
Only return departments with at least one employee receiving a commission greater than 5000. The result should be sorted by the department count from most to least.
(Select the correct response)
A. SELECT dept, COUNT(id) FROM staff WHERE comm >; 5000 GROUP BY dept ORDER BY2 DESC
B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm >; 5000 ORDER BY2 DESC
C. SELECT dept, COUNT(*) FROM staff WHERE comm >; 5000 GROUP BY dept, comm ORDER BY 2 DESC
D. 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 indexes and update the system catalogs with the table's statistical information? (Select the correct response)
A. runstats
B. getstats
C. check index
D. chkstats
(49/55) Which of the following Control Center options shows the dependencies between a specific view and its tables? (Select the correct response)
A. Show SQL
B. Show Related
C. Sample Contents
D. Customize Columns
(50/55) Given the table COUNTRY and the statements below
COUNTRY
ID NAME PERSON_ID CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10]
4 Germany 1 0
5 France 7 5
DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, name
OPEN c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
Which of the following is the last name obtained from the table?
(Select the correct response)
A. Cuba
B. France
C. Canada
D. Germany
E. 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 Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's 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. DBADM
B. SYSADM
C. SYSCTRL
D. 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 ROWS
B. PERCENT FREE
C. CLUSTERRATIO
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 processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. 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 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. SELECT * FROM t1 WHERE IGNORE_CASE(c1 = 'ABC')
D. SELECT * FROM t1 WHERE c1 = 'ABC' WITH OPTION CASE INSENSITIVE |
|
DB2考试自测题5
(1/55) When granted to user1, which of the following will allow user1 to ONLY access table data? (Select the correct response)
A. DBADM authority
B. SYSADM authority
C. SELECT privilege on the table
D. 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)
A. 0
B. 1
C. 2
D. 3
(3/55) Which two of the following DB2 authorization groups are authorized to create a table within database sample? (Select all that apply)
A. DBADM
B. DBCTRL
C. SYSADM
D. DBMAINT
E. ALTERIN
F. SYSMAINT
(4/55) Given the following table definition:
STAFF
id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary 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 job
B. SELECT job, name FROM staff GROUP BY name, job
C. 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
(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.
(6/55) Given the two following tables:
Names
Name Number
Wayne Gretzky 99
Jaromir Jagr 68
Bobby Orr 4
Bobby Hull 23
Brett Hull 16
Mario Lemieux 66
Steve Yzerman 19
Claude Lemieux 19
Mark Messier 11
Mats Sundin 13
Points
Name Points
Wayne Gretzky 244
Jaromir Jagr 168
Bobby Orr 129
Bobby Hull 93
Brett Hull 121
Mario Lemieux 189
Joe Sakic 94
Which of the following statements will display the player's 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.name
B. SELECT names.name, names.number, points.points FROM names FULL OUTER JOIN points ON names.name=points.name
C. SELECT names.name, names.number, points.points FROM names LEFT OUTER JOIN points ON names.name=points.name
D. SELECT names.name, names.number, points.points FROM names RIGHT OUTER JOIN points ON names.name=points.name
(7/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 type for the column definition for this purpose? (Select the correct response)
A. CHAR
B. CLOB
C. INTEGER
D. NUMERIC(15,2)
E. DECIMAL(15,0)
(8/55) Which of the following can be accomplished with a single UPDATE statement? (Select the correct response)
A. Updating multiple tables
B. Updating a view consisting of joined tables
C. Updating multiple tables based on a WHERE clause
D. Updating a table based on a sub-select using joined tables
(9/55) Given the tables:COUNTRY
ID NAME PERSON CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
STAFF
ID LASTNAME
1 Jones
2 Smith
The statement:
SELECT * FROM staff, country
will return how many rows?
(Select the correct response)
A. 2
B. 4
C. 5
D. 7
E. 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 table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. 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 the unassigned 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 stability
B. Repeatable read
C. Cursor stability
D. Uncommitted read
(12/55) Which of the following Control Center options shows the dependencies between a specific view and its tables? (Select the correct response)
A. Show SQL
B. Show Related
C. Sample Contents
D. Customize Columns
(13/55) Given the following:TAB1 TAB2
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 C 22
C 13 D 23
The following results are desired:C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 - -
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
C. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
D. 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 Client
B. DB2 Personal Edition
C. DB2 Administration Client
D. DB2 Application Developer's Client
(15/55) The user USER1 is executing the statement
CREATE 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 database
B. CREATEIN for the schema app1
C. CREATEIN for the schema user1
D. CREATEIN for the table table1
(16/55) Which of the following DB2 components allows the analysis of multidi mensional databases? (Select the correct response)
A. DB2 Runtime Client
B. DB2 Control Center
C. DB2 OLAP Starter Kit
D. DB2 Spatial Extender
E. DB2 Performance Monitor
(17/55) Which of the following tools can be used to identify inefficient SQL statements without executing the query? (Select the correct response)
A. QMF
B. Script Center
C. Visual Explain
D. 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. CLOB
B. BLOB
C. VARCHAR
D. GRAPHIC
E. 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 committed
B. Current unit of work is rolled back
C. Current unit of work remains active
D. 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 Search
B. XML Extender
C. AVI Extender
D. Text Extender
(22/55) Which of the following SQL statements can remove all rows from a table named COUNTRY? (Select the correct response)
A. DELETE country
B. DELETE FROM country
C. DELETE * FROM country
D. DELETE ALL FROM country
(23/55) Given the statement:
CREATE TABLE t1
(
c1 CHAR(3)
CONSTRAINT c1
CHECK (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 load
B. The reorg of the table
C. The insert of each row in t1
D. The creation of the index for the table
(24/55) Given the following DDL statement:
CREATE TABLE newtab1 LIKE tab1
Which of the following would occur as a result of the statement execution?
(Select the correct response)
A. NEWTAB1 has same triggers as TAB1
B. NEWTAB1 is populated with TAB1 data
C. NEWTAB1 has the same primary key as TAB1
D. 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. DBADM
B. SYSADM
C. SYSCTRL
D. 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.
E. A new column called COL2, which cannot contain nulls, is added to TABLE1.
(27/55) Given the following table definition:
STAFF
id INTEGER
name CHAR(20)
dept INTEGER
job CHAR(20)
years INTEGER
salary 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 following conditions:
Only return departments with at least one employee receiving a commission greater than 5000. The result should be sorted by the department count from most to least.
(Select the correct response)
A. SELECT dept, COUNT(id) FROM staff WHERE comm >; 5000 GROUP BY dept ORDER BY 2 DESC
B. SELECT dept, COUNT(*) FROM staff GROUP BY dept HAVING comm >; 5000 ORDER BY 2 DESC
C. SELECT dept, COUNT(*) FROM staff WHERE comm >; 5000 GROUP BY dept, comm ORDER BY 2 DESC
D. 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 update information for the optimizer to choose the best path to data? (Select the correct response)
A. Show Related
B. Generate DDL
C. Run Statistics
D. 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 user's password.
B. Change a user's 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? (Select the correct response)
A. None
B. Target Database
C. Source Database
D. 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. view
B. index
C. check constraint
D. referential constraint
(32/55) For which of the following database objects can locks be obtained? (Select the correct response)
A. View
B. Table
C. Trigger
D. Buffer Pool
(33/55) Which of the following types of DB2 locks allows for the most concur rency within a table? (Select the correct response)
A. A row lock
B. A page lock
C. A field lock
D. A column lock
(34/55) Given the following embedded SQL programs:
Program 1:
Create table mytab (col1 int, col2 char(24))
Commit
Program 2:
Insert into mytab values ( 20989,'Joe Smith')
Commit
Insert into mytab values ( 21334,'Amy Johnson')
Delete from mytab
Commit
Insert into mytab values ( 23430,'Jason French')
Rollback
Insert into mytab values ( 20993,'Samantha Jones')
Commit
Delete from mytab where col1=20993
Rollback
Which of the following records will be returned by the statement
SELECT * FROM mytab?
(Select the correct response)
A. 20989, Joe Smith
B. 21334, Amy Johnson
C. 23430, Jason French
D. 20993, Samantha Jones
E. 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 = 'ABC'
B. SELECT * FROM t1 WHERE UCASE(c1) = 'ABC'
C. 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 constraints stored? (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 ROWS
B. PERCENT FREE
C. CLUSTERRATIO
D. CLUSTER FACTOR
(39/55) Which of the following is NOT a valid data type on CREATE TABLE? (Select the correct response)
A. CLOB
B. DOUBLE
C. NUMERIC
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 DB1
B. Backup database DB1
C. Create tables in any database
D. 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 index
B. When updating the index
C. When selecting on the index
D. 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 DB2
B. For the remote clients to use the Control Center against the instance
C. For checking authorities in the database manager configuration for SYSADM
D. 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 TABLEB
empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 2000.00
TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
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. 0
B. 1
C. 2
D. 3
(45/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: ROLLBACK
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: COMMIT
How many records will be successfully inserted into the table mytab?
(Select the correct response)
A. 0
B. 1
C. 2
D. 3
(46/55) Given the two following table definitions:
ORG
deptnumb INTEGER
deptname CHAR(30)
manager INTEGER
division CHAR(30)
location CHAR(30)
STAFF
id INTEGER
name CHAR(30)
dept INTEGER
job CHAR(20)
years INTEGER
salary DECIMAL(10,2)
comm DECIMAL(10,2)
Which of the following statements will display each department, by name, and the 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.deptname
B. SELECT b.deptname, SUM(a.salary) FROM org a, staff b WHERE a.deptnumb=b.dept ORDER BY a.deptname
C. SELECT a.deptname, SUM(b.salary) FROM org a, staff b WHERE a.deptnumb=b.dept GROUP BY a.deptname
D. 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 processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. Rows changed in a result set by other processes from one scan to the next
(48/55) Which of the following DB2 UDB isolation levels will NOT lock any rows during read processing? (Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. 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 ='a'
INSERT 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. 0
B. 1
C. 2
D. 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 Wizard
B. DB2 Script Center
C. DB2 Command Center
D. DB2 Performance Monitor
(51/55) Which of the following utilities can examine a table and its indexes and update the system catalogs with the table's statistical information? (Select the correct response)
A. runstats
B. getstats
C. check index
D. chkstats
(52/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 tab1
WHERE col1 IN
(SELECT col1 FROM tab2)
Which of the following is the result of the SELECT COUNT(*) statement?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4
E. 0
(53/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 - update
B. X - exclusive
C. IU - intent update
D. IX - intent exclusive
(54/55) Given the table COUNTRY and the statements below:
COUNTRY
ID NAME PERSON_ID CITIES
1 Argentina 1 10
2 Canada 2 20
3 Cuba 2 10
4 Germany 1 0
5 France 7 5
DECLARE c1 CURSOR WITH HOLD FOR SELECT * FROM country ORDER BY person_id, nam
e
OPEN c1
FETCH c1
FETCH c1
COMMIT
FETCH c1
Which of the following is the last name obtained from the table?
(Select the correct response)
A. Cuba
B. France
C. Canada
D. Germany
E. Argentina
(55/55) Given two embedded SQL program executions with the following actions
:
Pgm1
INSERT INTO mytab VALUES (...)
COMMIT
INSERT INTO mytab VALUES (...)
ROLLBACK
Pgm2
INSERT INTO mytab VALUES (...)
ROLLBACK
INSERT INTO mytab VALUES (...)
COMMIT
How many records will be successfully inserted and retained in the table mytab?
(Select the correct response)
A. 1
B. 2
C. 3
D. 4 |
|
DB2考试自测题6
1. 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 OPTION
INSERT 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.0
B.1
C.2
D.3
2. Which of the following Control Center features can be used to update information for the optimizer to choose the best path to data? (Select the correct response)
A Show Related
B. Generate DDL
C. Run Statistics
D. Reorganize Table
3. Given the tables:
TABLEA TABLEB
Empid name empid weeknumber paycheck
1 JOE 1 1 1000.00
2 BOB 1 2 1000.00
2 1 1000.00
TABLEB was defined as follows:
CREATE TABLE tableb (empid CHAR(3), weeknumber CHAR(3), paycheck DECIMAL(6,2)
,
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.0
B.1
C.2
D.3
4. Which of the following DB2 UDB isolation levels will NOT lock any rows during read processing? (Select the correct response)
A. Read Stability
B. Repeatable Read
C. Uncommited Read
D. Cursor Stability
5. Which of the following processing can occur for a unit of work using an isolation level of Read Stability and scanning through the table more than oncewithin the unit of work? (Select the correct response)
A. Access uncommitted changes made by other processes
B. Update uncommitted changes made by other processes
C. Rows added to a result set by other processes from one scan to the next
D. Rows changed in a result set by other processes from one scan to the next
6. Which of the following describes when indexes can be explicitly referencedby name within an SQL statement? (Select the correct response)
A. When dropping the index
B. When updating the index
C. When selecting on the index
D. When inserting using the index
7. 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: COMMIT
Thread 2: INSERT INTO mytab VALUES (...)
Thread 1: ROLLBACK
How many records will be successfully inserted and retained in the table mytab?
(Select the correct response)
A.0
B.1
C.2
D.3
8. 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 table1
B. GRANT READ TO user1 ON TABLE table1
C. GRANT SELECT ON TABLE table1 TO user1
D. GRANT ACCESS ON TABLE table1 TO user1
9. Given the following:
TAB1 TAB2
C1 C2 CX CY
--- --- --- ---
A 11 A 21
B 12 C 22
C 13 D 23
The following results are desired:
C1 C2 CX CY
-- -- -- --
A 11 A 21
B 12 -- --
C 13 C 22
Which of the following joins will yield the desired results?
(Select the correct response)
A. SELECT * FROM tab1, tab2 WHERE c1=cx
B. SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx]
C. SELECT | |