db2常见考试命令应用考试题
数据库DB2认证考题真题及参考答案

1.Which of the following options best describes a domain found in the table below?从下表中,哪一选项正确的描述了域?CREATE TABLE EMPLOYEE (ID INTEGER NOT NULL,NAME VARCHAR(30) NOT NULL,EXTENSION INTEGER NOT NULL,MANAGER VARCHAR(30) NOT NULLPRIMARY KEY (ID));TERMINATE;ID NAME EXTENSION MANAGER1 John S 53412 Y2 Susan P 54123 N3 Jennifer L 51234 NA. Manager Domain = (N)B. Name Domain = (Set of all Possible Names)C. Extension Doman = (53412)D. ID Domain = (1, 2, 3)答案:B2.Which of the following statements best describes the XML Regions Index in DB2?下列哪个陈述最好的描述了DB2中的XML区域索引?A. The Regions Index is a descriptor for referencing large objects in the LOB storage area.B. The Regions Index is a new type of XML index available in DB2 9.7.C. The Regions Index facilitates access to document regions in the XML data area.区域索引,有助于文档区域中的XML数据区的访问D. The Regions Index can be compressed by issuing an offline reorg operation on the table.答案:C3. What is the purpose of a DB2 Access Plan?什么是一个DB2存取计划的目的?A. SQL developers can define Access Plans to tell DB2 the best way to retrieve the data from a SQL queryB. Describes the order of operations to access data necessary to execute a SQL or XQuery statement 描述运算次序,访问必要的数据去执行SQL或者XQuery的语句C. To replicate data between a DB2 database and relational databases from other vendorsD. To visually construct complex DML statements and examine the results of their execution答案:B4. Given the following UPDATE statement:UPDATE employees SET workdept =(SELECT deptno FROM department WHERE deptno = 'A01')WHERE workdept IS NULLWhich of the following describes the result if this statement is executed?如果上面的语句被执行,下面哪一个选项是正确的?A. The statement will fail because an UPDATE statement cannot contain a subqueryB. The statement will only succeed if the data retrieved by the subquery does not contain multiple records 语句可能成功如果子查询不包含多条记录的情况下。
AIX、WAS、DB2测试题

西南区培训测试题(2013年11月15日)-aix、was、db2 本次考试全部为填空题,每题1.5分,共100分本次考试,为本次培训所包含的所有内容。
、考试时间:16:00-17:30注:请由红色字体作答--------------------------------------------------------------------------------------------1、如何查看AIX系统中用户的配置文件____________________2、如何查看AIX系统中用户组的配置文件____________________3、如何查看AIX系统资源使用情况____________________4、如何查看AIX系统中文件系统的使用情况____________________5、请简要概述LVM中VG代表什么____________________、PV代表什么____________________、PP代表什么____________________、LP代表什么____________________、LV代表什么____________________6、如何查看AIX系统中的物理磁盘____________________7、如何查看AIX系统中rootvg空间使用情况____________________8、如何查看AIX系统中系统的启动顺序____________________9、如何查看AIX系统中rootvg中包含哪些逻辑卷____________________10、如何查看AIX系统中rootvg包含哪些物理卷以及物理卷使用情况____________________11、如何查看AIX系统中当前激活的卷组____________________12、如何查看AIX系统中所有的卷组____________________13、如何查看AIX系统的内核位数____________________14、如何修复AIX系统中受损的文件系统____________________15、如何在AIX系统中挂载光盘文件____________________16、如何通过命令查看AIX服务器上ent0网口是否插网线____________________)17、如何查看AIX系统中的网络接口信息____________________18、AIX系统中启动和关闭卷组的命令____________________19、AIX系统中导出、导入卷组的命令____________________20、AIX系统中查看可用磁盘信息____________________21、AIX系统中查看换页空间大小及当前使用情况____________________22、请列举重启AIX服务器的常用命令____________________23、AIX系统中创建磁盘镜像的命令____________________24、如何在操作系统下编译存储过程____________________25、如何在操作系统下调用存储过程____________________26、如何在操作系统下执行sql脚本____________________27,AIX系统中创建目录、文件的命令____________________28、查看AIX系统中实际的物理内存大小____________________29、查看AIX系统中所有物理设备的详细信息____________________30、如何查看后台运行的任务以及将该任务调入前台运行的命令____________________31、查看AIX系统版本及db2数据库版本的命令____________________32、AIX系统中查看所有网络接口吞吐信息____________________33、AIX系统中查看路由信息____________________34、AIX系统中查看所有服务的状态____________________35、AIX系统中启动、停止子系统服务的命令____________________DB2试题:(每题4分,共100分)36、查看db2数据库版本的命令是_________37、DB2有哪些版本(列举几个)_____________________38、DB2中每一个实例只能创建一个数据库,是否正确_________39、启动DB2实例的命令是______________,停止DB2实例的命令是_________________40、查看DB2实例的配置信息,命令是_______________________________查看某个数据库的配置信息,命令是_______________________________ 41、当发现DB2表空间满时,采取的处理方法________________________42、在启动was和db2时的顺序是__________________________停止was和db2时的顺序是___________________________43、查看表空间信息的命令是___________________________44、查看表空间容器信息的命令是_______________________45、两个表空间状态一个处于0x0080状态,另一个处于0x0000状态,哪个状态是正常的_______________46、命令行下,连接数据库的方法_________________________________命令行下断开数据库的方法_________________________________47、列出节点编目,命令是_________________________________列出数据库编目,命令是_______________________________48、列出数据库中的表,命令是_____________________________49、删除表tb1,命令是__________________________________删除表tb1的数据,命令是______________________________50、查看表tb1索引,命令是______________________________51、把表HTTP_REQUEST_LOG导出到HTTP_REQUEST_LOG、ixf文件的方法是_________________________________________52、数据完全备份有2种方式,离线备份和在线备份,两者的区别是___________________________________________53、在做db2在线备份时,db2 v8、1版本是否支持include logs选项_______________,include logs选项是做什么用的________________________54、查看db2备份情况的命令是_____________________________________55、归档日志清理的清理思路和方法是____________________________________56、db2 v8版本为什么要经常做runstat__________________________________57、如何查看db2数据库的连接状态_____________________________58、db2出现问题故障时,经常查看的日志是哪个____________________59、错误代码信息可以帮助我们对当前问题做出大体判断,现有一个报错为SQL1036C,如何查看出这个代码的相关信息,命令是_______________________ 60、db2活动日志,能否删除____________________,若误删除后,后果是_______________________61、使用____________________命令可以查看WAS版本。
db2数据库面试题

db2数据库面试题一、概述DB2数据库是IBM公司开发的一种关系型数据库管理系统。
在DB2数据库的面试过程中,常常会遇到各种各样的问题。
本文将为您总结一些常见的DB2数据库面试题,帮助您更好地准备面试,并提供详细的解答。
本文将从DB2数据库的基本知识、SQL查询、性能调优等方面展开讨论。
二、基本知识1. 什么是DB2数据库?DB2数据库是IBM开发的一种关系型数据库管理系统,它提供了完整的数据库管理和数据操作功能,并支持SQL查询语言。
2. DB2数据库的特点是什么?DB2数据库具有以下特点:- 跨平台性:DB2可以在不同的操作系统和平台上运行,如Windows、Unix、Linux等。
- 具备高可用性:DB2支持数据备份、恢复和高可用性机制,确保数据的安全性和可靠性。
- 扩展能力强:DB2可以支持大规模的数据和用户,并提供有效的扩展机制。
- 性能优越:DB2采用了先进的查询优化技术,能够提供高效的数据检索和处理能力。
- 安全性强:DB2提供了完善的权限管理和安全机制,保证数据的机密性和完整性。
3. DB2数据库的体系结构是什么样的?DB2数据库的体系结构包括以下几个层次:- 应用层:应用程序通过数据库连接器与DB2数据库进行通信。
- SQL层:处理SQL查询,包括查询优化、执行计划生成等。
- 缓冲池管理器(Buffer Pool Manager):管理数据缓存和页面置换。
- 存储管理器(Storage Manager):管理数据的存储和检索。
- 锁管理器(Lock Manager):管理并发访问和资源锁定。
- 日志管理器(Log Manager):管理事务日志的生成和恢复。
4. DB2数据库的对象包括哪些?DB2数据库的主要对象包括表(Table)、视图(View)、索引(Index)、触发器(Trigger)、存储过程(Stored Procedure)等。
三、SQL查询1. 如何创建一个表?在DB2数据库中,可以使用CREATE TABLE语句来创建一个表,语法如下:CREATE TABLE table_name (column1 datatype1 constraint,column2 datatype2 constraint,...);其中,table_name为表名,column1、column2为列名,datatype1、datatype2为列的数据类型,constraint为列的约束条件(如主键、外键等)。
DB2 试题

What are the entities used to model data in the Relational Model?^^^^A. A collection of instances of entities.^^^^B. Relations, attributes and tuples^^^^C. A collection of instances of record types.^^^^D. Table, rows and columns}Which of the following is true about Relational Databases?^^^^A. A column can store values of different data types.^^^^B. A table consists of columns and rows.^^^^C. Rows in the same table can have a different set of columns.^^^^D. Rows are also known as fields of the table.}A company has a large amount of data to store and wants to be able to do the following with the data:Have a standard interface for accessing the data.Have multiple users with the ability to insert, update and delete data.Make changes to the data without risk of losing data and its consistency.Have the capability to handle huge volumes of data and users.Have tools for data backup, restore and recovery.What data storage method is the most optimal solution for the company?^^^^A. Text files^^^^B. Comma delimited data files^^^^C. Spreadsheets^^^^D. Database}When using a Relational Database, which of the following does not apply?^^^^A. Accesses data using Data Manipulation Language (DML) such as SQL.^^^^B. Define your database schema using a Data Definition Language (DDL).^^^^C. Data is stored in a hierarchical model.^^^^D. You can use normalization to avoid redundant data in your tables.}Which of the following is not true about the Information Model?^^^^A. Abstract management of objects at a conceptual level.^^^^B. Defines relationships between managed objects.^^^^C. It is a group of descriptions explaining objects of a data model.^^^^D. Data models can be used to map an Information Model to a software implementation.}Which Data Model was created with the focus of providing better data independence ? ^^^^A. Relational^^^^B. Hierarchical^^^^C. Semantic^^^^D. Network}Which of the following is NOT true about columns?^^^^A. Each column consists of one or more fields^^^^B. Each column contains a specific type of information^^^^C. Columns must be designated a specific data type^^^^D. Columns are also known as fields}Which of the following is true about columns?^^^^A. Each column consists of one or more records^^^^B. Columns are where the individual pieces of information are stored for each record^^^^C. Columns must be designated a specific data type^^^^D. Columns are also known as records}You are tasked with designing a model that can be used by the software developer to implement a given application. Which of the following is NOT true about your model?^^^^A. The model is a low level of abstraction with concrete and detailed design.^^^^B. The model includes specific implementation and protocol details.^^^^C. The model should define relationships between the managed objects.^^^^D. The model being designed is an Information Model.}Using DB2’s CLP , to access a remote database for the first time, it is necessary to:^^^^A. First catalog the remote system or node, and then catalog the database within the remote node^^^^B. First register the remote system user in the system catalog, and then setup a SSH communication to the remote node^^^^C. DB2 cannot use databases in remote systems unless SYSADM authority is granted to the local user^^^^D. First list all the remote databases with the db2 list database directory command, and then select the remote database from the list}Which of the following statements is not true regarding Table Spaces on DB2?^^^^A. A Table Space is a logical object in between logical table and physical containers^^^^B. All tables, indexes, and other data are stored in a table space^^^^C. A Table Space is a logical object required to store data, indexes and tables in temporary memory^^^^D. A Table Space is always associated to a Buffer Pool}Assuming that you are currently connected to TESTDB, which of the following will allow the view of the database settings with details?^^^^A. db2 get db cfg with detail^^^^B. db2 get db cfg show detail^^^^C. db2 get dbm cfg with detail^^^^D. db2 get dbm cfg show detail}(实例级)Which of the following commands would delete the SAMPLE database?^^^^A. db2 drop sample^^^^B. db2 delete database sample^^^^C. db2 drop sample db^^^^D.db2 drop database sample}What is the purpose of a DB2 Access Plan?^^^^A. SQL developers can define Access Plans to tell DB2 the best way to retrieve the data from a SQL query^^^^B. Describes the order of operations to access data necessary to execute a SQL or XQuery statement^^^^C. To replicate data between a DB2 database and relational databases from other vendors^^^^D. To visually construct complex DML statements and examine the results of their execution}How does automatic storage work in DB2?^^^^A. Automatic storage simplifies storage management by allowing you to specify storage paths where the database manager can place table space data, and where the database manager allocates space for various uses.^^^^B. Automatic storage is an option which is set when you create a DB2 database. It allows transactions that are written to the database to be automatically committed.^^^^C. Automatic storage is a function of DB2 that allows tables to be backed up automatically on a set schedule.^^^^D. Automatic Storage can be used to automatically reorganize the data on the physical media in order to improve performance.}Which of the following is the lowest cost DB2 product that can be legally installed on a Linux server that has 2 CPUs?^^^^A. DB2 Express Edition^^^^B. DB2 Enterprise Server Edition^^^^C. DB2 Everyplace^^^^D. DB2 Workgroup Server Edition}You were assigned the task of importing a large amount of data into a DB2 database. Considering you must have logged information about the rows imported and that you want to perform the load as fast as possible, which of the tools would you be the best choice for the job?^^^^A. DB2 INSERT^^^^B. DB2 IMPORT^^^^C. DB2 LOAD^^^^D. DB2 CLP}Which of the following is the lowest cost DB2 product that can be legally installed on a windows server that has 4 CPUs capable of performing row compression?^^^^A. DB2 Express Edition^^^^B. DB2 Workgroup Edition^^^^C. DB2 Express-C Edition^^^^D. DB2 Enterprise Edition }Which of the following is true about a well-formed XML document?^^^^A. Has one or more root nodes^^^^B. Tags can have at most one attribute^^^^C. Always has a single document node^^^^D. End tags are optional}Which of the following is a well-formed XML document?^^^^A. <Name xmlns="htpp://" Gender="MALE"> <FirstName>Amitabh</FirstName><LastName>Patel</LastName></Name>^^^^B. <Name xmlns="" MALE="Gender"> <FirstName>Amitabh</FirstName><LastName>Patel</LastName></name>^^^^C. <Name Gender="MALE"><FirstName>Amitabh <LastName>Patel</FirstName> </LastName></Name>^^^^D. <Name Gender=FEMALE><FirstName>Jaya</FirstName><LastName>Patel</LastName></Name>}What is SQL/XML?^^^^A. SQL/XML is a communication protocol for DB2 databases^^^^B. A.SQL/XML is part of the XQuery standard and provides various publishing functions to transform XML data into relational form and vice versa^^^^C. SQL/XML is a language that provides various publishing functions to transform XML data into relational form and vice versa^^^^D. SQL/XML is an extension to SQL standard and provides various publishing functions to transform XML data into relational form and vice versa}Which of the following is not part of the XQuery FLWOR expression:^^^^A. FOR clause^^^^B. LET clause^^^^C. ORDER BY clause^^^^D. WITH clause}Consider the following XML document:<customerinfo><name>John Smith</name><addr country="Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type="work">963-289-4136</phone></customerinfo>Consider the following UPDATE expression:update xmlcustomerset info = xmlquery( 'transformcopy $new := $imodify (do insert <phone type="cell">777-555-3333</phone> after $new/customerinfo/addr,for $j in $new/customerinfo/addr/phonereturn do rename $j as "telephone")return $new' passing info as "i")where cid = 1000;Which of the following represents the XML document after the TRANSFORM expression has been executed:^^^^A. <customerinfo><name>John Smith</name><addr country=“Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type=“cell">777-555-3333</phone><phone type="work">963-289-4136</phone> </customerinfo>^^^^B . <customerinfo><name>John Smith</name><addr country=“Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type=“cell">777-555-3333</phone><telephone type="work">963-289-4136</telephone> </customerinfo>^^^^C. <customerinfo><name>John Smith</name><addr country=“Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip></addr><phone type=“cell">777-555-3333</phone><telephone type="work">963-289-4136</telephone> </customerinfo>^^^^D. <customerinfo><name>John Smith</name><addr country=“Canada"><street>Fourth</street><city>Calgary</city><prov-state>Alberta</prov-state><pcode-zip>M1T 2A9</pcode-zip><phone type=“cell">777-555-3333</phone></addr><telephone type="work">963-289-4136</telephone></customerinfo>Which of the following is an XML-based language for transforming XML documents?^^^^A. XHTML^^^^B. XSLT^^^^C. HTML^^^^D. Java}Which of the following properties is related to the fact that a committed transaction guarantees that all of the operations are completed and in a roll backed transaction the effect of all operations are reverted?^^^^A. Consistency^^^^B. Atomicity^^^^C. Isolation^^^^D. Durability}Which of the following best define what a transaction is?^^^^A. A sequence of one or more SQL operations grouped together, also known as a single unit of work^^^^B. A set of independent operations that can be executed in parallel^^^^C. A data isolation level that can help prevent deadlocks by allowing reads on previously committed data.^^^^D. An object of a DB2 database}Which of the following statements is FALSE about transactions?^^^^A. Operations inside a transaction are executed in parallel.^^^^B. Only 1 COMMIT statement can be executed inside the same transaction. --- ?^^^^C. Transactions guarantee atomicity of a group of operations.^^^^D. A ROLLBACK or COMMIT statement finalizes a transaction. }Application B wants to read a subset of rows from table EMPLOYEE multiple times inside the same transaction. Which isolation level should be used in order to guarantee that every time the same set of rows is returned?^^^^A. Currently Committed^^^^B. Read Stability^^^^C. Repeatable Read^^^^D. Uncommitted Read}A Dirty Read occurs when?^^^^A. A transaction read the same row of data twice and returns different data values with each read^^^^B. A search based on some criterion returns additional rows after consecutive searches during a transaction^^^^C. Uncommitted data is returned, but the transaction that originated them was rolled back^^^^D. Two transactions read and then attempt to update the same data, the secondupdate will overwrite the first update before it is committed}How can an application modify the isolation level of operations running against a DB2 database?^^^^A. Isolation level can be changed for a particular SQL statement.^^^^B. Isolation level can only be changed for the whole user session and all operations in that session will be affected.^^^^C. Isolation level to be used can be specified when executing the COMMIT operation.^^^^D. Isolation level is determined at the moment an application connects to the database. To change the isolation level, an application is required to create a new connection specifying the desired level.}Consider the following scenario. You have 3 tables with the same name (TABLE_1) under 3 different schemas (SYSIBM, DEFAULT and DB2INST1). You are connected to a DB2 database in your Linux server as db2inst1 and issue the following statement:SELECT * FROM table_1Which table will you be selecting data from:^^^^A. You get an error because your query is ambiguous, as the table schema is not specified^^^^B. SYSIBM.table_1^^^^C. DEFAULT.table_1^^^^D. DB2INST1.table_1}Which of the following is NOT a supported type of trigger?^^^^A. AFTER^^^^B. BEFORE^^^^C. DURING^^^^D. INSTEAD OF}When attempting to establish a connection to a database residing on your local machine, which command can help you determine why the following message was displayed:SQL1013N The database alias name or database name "SAMPLE" could not be found. SQLSTATE=42705^^^^A. list database directory^^^^B. list admin node directory^^^^C. list node directory^^^^D. list dcs directory}Which of the following is FALSE about views?^^^^A. Do not contain real data^^^^B. Any view can be updated, independent of its definition^^^^C. When changes are made to data through a view, the data is changed in the underlying table^^^^D. Can be used interchangeably with tables when retrieving data}Given the options below, which of the following statements can add records to a table?^^^^A. ADDREC^^^^B. ADDRECORD^^^^C. INSERT^^^^D. ADD}Consider the following command:CREATE TABLESPACE MYTBSP1 MANAGED BY AUTOMATICWhat will the command result in?^^^^A. Creation of a normal table space called mytbsp1 that is managed automatically ^^^^B. Creation of a user table space called mytbsp1 that is managed automatically.^^^^C. Creation of a temporary table space called mytbsp1 that is managed automatically.^^^^D. This command will return an error to the user.}What is authorization?^^^^A. Authorization is a process that checks whether you have sufficient privileges to perform the desired database operation^^^^B. Authorization is the process where the DBA gathers information to see who will have access to the database^^^^C. Authorization is the process where the DB2 database checks with Windows security to see if you have access to the DB2 database^^^^D. Authorization is a process that validates that you are who you claim to be by verifying your user ID and password}Which of the following statements grants user John the ability to insert data to table tab1?^^^^A. GRANT ADD ON TABLE tab1 TO John^^^^B. GRANT INSERT ON TABLE tab1 TO John^^^^C. GRANT ADD ON TABLE tab1 TO USER John^^^^D. GRANT INSERT ON TABLE tab1 TO USER John}Assume a table which contains the following columns:EMP_IDEMP_NAMEPHONEEMAILSALARYWhich of the following is the simplest way to restrict users from viewing SALARY information, while still allowing them to see the other values?^^^^A. Encrypt the table's data^^^^B. Create a view that does not contain the SALARY column. Grant access to the view and revoke access from the original table^^^^C. Revoke SELECT access for the SALARY column from users who should not see SALARY data^^^^D. Store SALARY data in a separate table and grant SELECT privilege for that table to the appropriate users}What is a Trusted Context?^^^^A. It is a special area in a buffer pool that can be written only by a selectedset of users.^^^^B. It is a DB2 capability that allows applications to change users without breaking the connection to the database.^^^^C. It is a DB2 capability that allows users to establish a connection to the database without providing user name or password.^^^^D. It is a type of container in a table space that allows faster I/O operations.}After the following SQL statement is executed:GRANT ALL PRIVILEGES ON TABLE student TO USER user1Assuming user USER1 has no other authorities or privileges, which of the following actions is USER1 allowed to perform?^^^^A. Grant all privileges on table STUDENT to other users^^^^B. Drop a view associated to the table STUDENT^^^^C. Drop the table STUDENT^^^^D. None of the above}When a user is connected to a database, which of the following privileges is required for the user to use a package?^^^^A. BIND^^^^B. BINDADD^^^^C. EXECUTE^^^^D. USE}Which of the following best describes what an incremental cumulative backup is? ^^^^A. Backup all of the data that has changed since the last successful full ordelta backup^^^^B. Backup of a single table space^^^^C. Backup of the entire database^^^^D. Backup all of the data that has changed since the last full backup}Which of the following is a tool to configure automatic database backup?^^^^A. Configure Automatic Maintenance wizard^^^^B. Design Advisor^^^^C. Explain tool^^^^D. EXPORT utility}Which of the following options will perform an offline table space recovery? ^^^^A. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) OFFLINE FROM /tbspbkp^^^^B. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) FROM /tbspbkp^^^^C. RESTORE DATABASE SAMPLE TABLESPACE (MYTBSP) ONLINE FROM /tbspbkp^^^^D. There is no option to restore a table space in DB2}In embedded SQL code, which of the following is true about delimiters ?^^^^A. Used by the OS to delimit system variable declaration^^^^B. Used by the database to indicate the end of a column^^^^C. Used by compiler to indicate the end of the program^^^^D. Used by PRECOMPILER to identify SQL statements to be translated}Which of the following programming languages can be used to develop UDFs ?^^^^A. Java, Javascript, SQL^^^^B. C/C++, Java, .Net languages^^^^C. SQL, C# .Net, Perl^^^^D. Perl, C/C++, SQL}Which of the following is true about Dynamic SQL?^^^^A. It is precompiled and binded in dynamic databases^^^^B. The structured of an SQL statement must be completely specified at precompile time.^^^^C. It is compiled and executed by an application at run-time.^^^^D. Dynamic SQL does not exist}Which of the following DB2 client/driver packages is NOT suitable for developing ODBC applications?^^^^A. IBM Data Server Client^^^^B. IBM Data Server Driver for ODBC and CLI^^^^C. IBM Data Server Runtime Client^^^^D. IBM Data Server Driver Package}Considering the SQL statement below, which option best describes what APP.TAX is: SELECT APP.TAX(SALARY) FROM EMPLOYEE^^^^A. User Defined Function^^^^B. Stored Procedure^^^^C. Trigger^^^^D. User Defined Type}Which of the following objects you would need to create in order to execute a block of code every time table TB1 is updated.^^^^A. An AFTER trigger^^^^B. A UDF^^^^C. A Stored Procedure^^^^D. An User Defined Type}Given the following two tables:NAMES---------------------------NAME NUMBER---------- -------Wayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Mario Lemieux 66POINTS----------------------------NAME POINTS---------- -------Wayne Gretzky 244Bobby Orr 129Brett Hull 121Mario Lemieux 189Joe Sakic 94How many rows would be returned using the following statement? SELECT * FROM names, points^^^^A. 0^^^^B. 5^^^^C. 10^^^^D. 25}Given the following two tables:TAB1------------------COL_1 COL_2----- -----A 10B 12C 14TAB2-------------------COL_A COL_B----- -----A 21C 23D 25Assuming the following results are desired:COL_1 COL_2 COL_A COL_BA 10 A 21B 12 - -C 14 C 23- - D 25Which of the following joins will produce the desired results?^^^^A. SELECT * FROM tab1 INNER JOIN tab2 ON col_1 = col_a^^^^B. SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON col_1 = col_a ^^^^C. SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON col_1 = col_a ^^^^D. SELECT * FROM tab1 FULL OUTER JOIN tab2 ON col_1 = col_a}Given the following table:TAB1-------------------COL1 COL2----- -----A 10B 20C 30A 10D 40C 30Assuming the following results are desired:TAB1-------------------COL1 COL2----- -----A 10B 20C 30D 40Which of the following statements will produce the desired results?^^^^A. SELECT UNIQUE * FROM tab1^^^^B. SELECT DISTINCT * FROM tab1^^^^C. SELECT UNIQUE(*) FROM tab1^^^^D. SELECT DISTINCT(*) FROM tab1}Given the following table:CURRENT_EMPLOYEES-----------------------------EMPID INTEGER NOT NULLNAME CHAR(20)SALARY DECIMAL(10,2)PAST_EMPLOYEES-----------------------------EMPID INTEGER NOT NULLNAME CHAR(20)SALARY DECIMAL(10,2)Assuming both tables contain data, which of the following statements will NOT successfully add data to table CURRENT_EMPLOYEES?^^^^A. INSERT INTO current_employees (empid) VALUES (10)^^^^B. INSERT INTO current_employees VALUES (10, 'JAGGER', 85000.00)^^^^C. INSERT INTO current_employees SELECT empid, name, salary FROM past_employees WHERE empid = 20^^^^D. INSERT INTO current_employees (name, salary) VALUES (SELECT name, salary FROM past_employees WHERE empid = 20)}Given the following UPDATE statement:UPDATE employees SET workdept =(SELECT deptno FROM department WHERE deptno = 'A01')WHERE workdept IS NULLWhich of the following describes the result if this statement is executed?^^^^A. The statement will fail because an UPDATE statement cannot contain a subquery^^^^B. The statement will only succeed if the data retrieved by the subquery does not contain multiple records --- why^^^^C. The statement will succeed; if the data retrieved by the subquery contains multiple records, only the first record will be used to perform the update^^^^D. The statement will only succeed if every record in the EMPLOYEES table has a null value in the WORKDEPT column}Given the following table definition:SALES--------------------------SALES_DATE DATESALES_PERSON CHAR(20)REGION CHAR(20)SALES INTEGERWhich of the following SQL statements will remove all rows that had a SALES_DATE in the year 1995?^^^^A. DELETE * FROM sales WHERE YEAR(sales_date) = 1995^^^^B. DELETE FROM sales WHERE YEAR(sales_date) = 1995^^^^C. DROP * FROM sales WHERE YEAR(sales_date) = 1995^^^^D. DROP FROM sales WHERE YEAR(sales_date) = 1995}Which of the following SQL statements can be used to remove data from table "users": ^^^^A. REMOVE TABLE users^^^^B. DROP TABLE users^^^^C. DELETE TABLE users^^^^D. ALTER TABLE users}If TAB1 is created using the following statementCREATE TABLE tab1 (col1 INTEGER NOT NULL,col2 CHAR(3),CONSTRAINT cst1 CHECK (col1 in (1, 2, 3, 4)))Which of the following statements will successfully insert a record into table TAB1? ^^^^A. INSERT INTO tab1 VALUES (0, 'a')^^^^B. INSERT INTO tab1 VALUES (NULL, 'abc')^^^^C. INSERT INTO tab1 VALUES (4, 'a')^^^^D INSERT INTO tab1 VALUES (4, 'abcdefhijklmnopq')}Given the following two tablesNAMES--------------------------------STUDENT_NAME STUDENT_NUMBER------------ ----------------Wayne Gretzky 99Jaromir Jagr 68Bobby Orr 4Bobby Hull 23Mario Lemieux 66MARKS--------------------------------NAME Marks-------- -------Wayne Gretzky 80Bobby Orr 94Brett Hull 77Mario Lemieux 83How many rows would be returned using the following statement? SELECT distinct name FROM student_names, marks^^^^A. 9^^^^B. 20^^^^C. 5^^^^D 6}这个题有点问题答案应该是 4==========================================Which of the following is not a definition of a relation?^^^^A. A relation may be thought of as a set of columns.^^^^B. Each row represents a fact that corresponds to a real-world entity or relationship^^^^C. Each row has a value of an item or set of items that uniquely identifies that row in the table^^^^D. Each column typically is called by its column name or column header or attribute name}The type of data structure that is used in a relational model is?^^^^A. Table^^^^B. Tree^^^^C. Node^^^^D. None of the above}In relational terminology, an attribute is?^^^^A. A record^^^^B. An entity^^^^C. A field^^^^D. A table}The link between a column or set of columns in one table that refers to the set of column in another table is?^^^^A. Pointer^^^^B. Cursor^^^^C. Primary key^^^^D. Foreign key}A foreign key must?^^^^A. Be defined in all tables in the database^^^^B. Match the field value of a primary key in a related table or be NULL.^^^^C. Be unique^^^^D. Be numeric}Which of the following is NOT true about data?^^^^A. Data is useful and has meaning associated to it.^^^^B. Data can be quantitative or qualitative.^^^^C. Data describes a variable or set of variables.^^^^D. Essentially data can be thought of as the result of observations based on things like measurements and statistics.}Which of the following is NOT true about Database Management Systems?^^^^A. Relational Database Management Systems use Structured Query Language to interact with databases.^^^^B. Database Management Systems act as an interface used to communicate with databases.^^^^C. Applications can choose to bypass the Database Management System when accessing databases for performance reasons.^^^^D. DB2 is a Database Management System.}A database can be used to do which of the following?^^^^A. Create a repository of data.^^^^B. Provide an organized mechanism for manipulating data.^^^^C. Provide support for data processing.^^^^D. All of the above.}Which of the following is true about the table below?CREATE TABLE EMPLOYEE (ID INTEGER NOT NULL,NAME VARCHAR(30) NOT NULL,EXTENSION INTEGER NOT NULL,MANAGER VARCHAR(30) NOT NULLPRIMARY KEY (ID));TERMINATE;ID NAME EXTENSION MANAGER1 John S 53412 Y2 Susan P 54123 N3 Jennifer L 51234 N^^^^A. ID is a value found in the EMPLOYEE table^^^^B. ID, 1, 2, 3 makes up a row in the EMPLOYEE table^^^^C. The MANAGER domain consists only of the value Y^^^^D. NAME, John S, Susan P, Jennifer L makes up a column in the EMPLOYEE table} Which of the following is NOT displayed by DB2 Access Plan?。
db2常见考试命令应用考试题

一选择题(每题1.5分,共45分)1) 下面的哪个数据库版本可以访问OS/390 上的DB2 UDB 数据库?a) DB2 Connect Personal Editionb) DB2 Universal Database Workgroup Editionc) DB2 Personal Developer's Editiond) DB2 Universal Developer's Edition2) 下面的哪个工具可以编目一个数据库信息?a) Journal 日志工具b) Alert Center 警告中心c) License Center 许可证中心d) Client Configuration Assistant 客户端配置助手3) 下面的哪个工具可以重组数据回收表中被删除的行所占有的资源?a)reorgb) db2lookc) db2moved) runstats4) USE这个特权的用途是?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) 如果创建数据库则需要下面的哪两个权限?a) DBADMb) SYSADMc) DBCTRLd) SYSCTRLe) SYSMAINT6) 编目一个远程数据库是指:a) 在PC或者Unix 机器上执行编目,目的是为了识别DB2数据库管理器所在的服务器b) 在PC或者Unix机器上编目,目的是为了让用户和应用程序可以识别DB2数据库c) 从不在DB2中编目,仅当每个节点上的数据库被允许编目时编目,所以自动编目那个节点就可以自动编目数据库Nd) 在PC或者UNIX机器上编目是为了打开在DB2数据库中的目录表,这样当前的用户可以访问这个数据库中的一组可以被访问的数据表。
DB2基础运维习题

DB2基础运维习题基本信息:[矩阵文本题] *1. 数据库服务器主进程是什么 [单选题] *db2venddb2sysc(正确答案)db2acddb2wdog2. 通过命令db2 list db directory查看数据库,当数据库为远程数据库时,“Catalog database partition number”的值一般情况下为 [单选题] *-2-1(正确答案)13. 一般情况下数据库告警日志的路径是 [单选题] *~/sqllib/log~/db2inst1/db2dump~/sqllib/db2tss~/sqllib/db2dump(正确答案)4. 可用通过下面哪个视图获取表空间相关数据,如:表空间使用率、使用大小等[单选题] *SYSCAT.TBSP_UTILIZATIONSYSIBMADM.LOG_UTILIZATIONSYSIBMADM.TBSP_UTILIZATION(正确答案)SYSCAT.LOG_UTILIZATION5. 创建一个1G大小缓冲池,页大小为4KB,SIZE的大小应为 [单选题] *1024*1024/4(正确答案)1024*1024*1024/41024/41000*1000/46. 查看当前数据库会话连接情况 [单选题] *db2 list node directorydb2 list sessionsdb2 list applications(正确答案)db2 list db direcctory7. 事务日志可用空间计算公式 [单选题] *(logprimary+logsecond)*logfilsiz*8K(logprimary+logsecond)*logfilsiz*4K(正确答案) logfilsiz*4Klogprimary*logfilsiz8. 在线重组表需要添加以下哪个关键词 [单选题] * tablespaceaccessonlineinplace(正确答案)9. 以下命令正确的是 [单选题] *db2 grant select on database to user usernamedb2 revoke dbadm on database to user usernamedb2 grant secadm on database to user username(正确答案)db2 reorg tabname use tempspace 10. 以下哪些视图与权限有关 * syscat.dbauth(正确答案) syscat.colauth(正确答案) syscat.schemaauth(正确答案) syscat.tbspaceauth(正确答案)。
db2 测试题

DB2 Family Fundamentals test1.定义基本表时,若要求某一列的值不能为空,则应在定义时使用什么保留字?但如果该列是主键,则可省写。
A.NULLB.N OT NULLC.D ISTINCTD.UNIQUEE.2.当FROM子句中出现多个基本表或视图时,系统将执行什么操作?A.并B.等值联接C.自然联接D.笛卡儿积3.在SELECT语句的下列子句中,通常和HA VING子句同时使用的是以下哪项?A.ORDER BY子句B.W HERE子句C.G ROUP BY子句D.均不需要4.若用如下的SQL语句创建一个student表:CREA TE TABLE student(NO CHAR(4)NOT NULL,NAME CHAR(8)NOT NULL,SEX CHAR(2),AGE NUMBERIC(2))可以插入到student表中的是哪一项?A.(‘1031’,‘曾华’,男,23)B.(‘1031’,‘曾华’,NULL,NULL)C.(NULL,‘曾华’,‘男’,‘23’)D.(‘1031’,NULL,‘男’,23)5.当数据库遭到破坏时,为了能迅速恢复,在进行事务处理过程中将对数据库更新的全部内容写入以下哪项?A.副本文件B.日志文件C.检查点文件D.死锁文件6.10.并发控制的主要方法是采用以下哪种机制?A.口令B.锁C.副本D.检查点7.11.下列SQL语句中,能够实现”收回U4对学生表(STUD)中学号(XH)的修改权”这一功能的是以下哪项?A.REVOKE UPDA TE(XH) ON TABLE FROM U4B.REVOKE UPDA TE(XH) ON TABLE FROM PUBLICC.REVOKE UPDA TE(XH) ON STUD FROM U4D.REVOKE UPDA TE(XH) ON STUD FROM PUBLIC8.12.关于“死锁”,下列说法中错误的有:A.死锁是操作系统中的问题,数据库操作中不存在B.在数据库操作中防止死锁的方法是禁止两个用户同时操作数据库C.当两个用户竞争相同资源时不会发生死锁D.只有出现并发操作时,才有可能出现死锁9.下面哪个工具可以帮助用户对语句性能进行分析?A.可视化解释工具B.性能监视器C.命令行处理器D.控制中心10.要更改数据库管理器配置文件,需以下哪个数据库权限?A.DBADMB.SYSMAINTC.SYSCTRLD.SYSADM11.如果一个用户USER1被授予了表TAB上的CONTROL特权,如果需要限制该用户对表的存取,应使用以下哪条命令?A.REVOKE ALL ON TAB TO USER1B.R EVOKE ALL ON TAB FROM USER1C.R EVOKE CONTROL ON TAB TO USER1D.REVOKE CONTROL ON TAB FROM USER112.给出下面信息:CREA TE TABLE tab1 (c1 char(3) WITH DEFAULT NULL, c2 INTEGER);INSERT INTO tab1(c2) V ALUES (‘345’);如果在命令行处理器(CLP)中执行以下语句,以下哪个结果是正确的?SELECT * FROM tab1;A. C1 C2--- -----------0 record(s) selected.B. C1 C2--- -----------123 3451 record(s) selected.C. C1 C2--- -----------3451 record(s) selected.D. C1 C2--- ------------ 3451 record(s) selected.13.在CREA TE TABLE语句中实现完整性约束的子句有哪些?A.NOT NULLB.PRIMARY KEYC.FOREIGN KEYD.CHECK14.使用SQL语句进行查询操作时,若希望查询结果不出现重复元组,应在SELECT 子句中使用什么保留字?A.UNIQUEB.A LLC.E XCEPTD.DISTINCT15.并发操作会带来哪些数据不一致性?A.丢失修改B.不可重复读C.读脏数据D.死锁16.设有两个事务T1,T2,其并发操作如下所示:T1:T2:1)读A=10,B=52)读A=103)A=A+104)读A=20,B=5求和25 验证错正确的评价是哪个?A.该操作不存在问题B.该操作丢失修改C.该操作不能重复读D.该操作读“脏”数据。
DB2试题及答案(DOC)

1.101下列哪一组实体可以在ERD 中使用?DA. 产品,颜色,高度B. 黄色,大,长C. 约翰,狗,飞机D. 人,动物,植物02下列关于关系数据库的说法,哪一项是正确的?B •A. 关系数据库不能存储视频或音频。
•B. 表是由列和行组成的。
•C. 同一个表中的行可以拥有不同的列集。
•D. 行也称为表字段。
03下列哪些实体应该使用ERD 中的一对多关系?B •A. 人,汽车•B. 公司,员工•C. 祖父,约翰•D. 母亲,孩子•B 04下列哪些是关系数据模型的组件?B•A. 指针,集合,约束•B. 关系,属性,元组•C. 实例,记录类型,实体•D. 表,行,等级•05下列哪一项表述是错误的?D•A. 主键唯一地标识表中的行。
•B. 外键是引用其他表主键的列集。
•C. 主键和外键用于强制数据完整性。
•D. 必须始终在表中定义主键。
•06下列哪一项表述是错误的?A•A. 关系模型中的属性映射到关系数据库中的行•B. 在ERD 中,用长方形表示实体•C. 一对一和多对多是可以在ERD 中表示的关系•D. 关系模型中的实体映射到关系数据库中的表1.21.对于没有软件投资预算的小型创业公司,下列哪一种DB2 版本是理想选择?AA. DB2 Express-CB. DB2 ExpressC. DB2 EnterpriseD. DB2 WorkgroupA2. 假设你已经连接到TESTDB 数据库,下列哪些命令可以列出数据库配置设置?AA. db2 get db cfgB. db2 list db cfgC. db2 get dbm cfgD. db2 list dbm cfgA3. 首次使用DB2 客户端中的CLP 访问远程数据库时,需要:AA. 编目远程节点,并编目引用此远程节点的数据库B. 在系统目录中注册远程系统用户,然后设置与远程节点的SSH 通信C. 使用文本编辑器编辑节点目录和数据库目录文件D. 使用list database directory 命令列出所有远程数据库,然后从列表中选择远程数据库4. 下列关于DB2 版本、客户端和驱动程序的说法,哪一项是错误的?BA. 所有的DB2 客户端和驱动程序都可以免费获取B. DB2 Express 版是唯一可免费获取的服务器版本C. DB2 服务器包含DB2 客户端组件D. 可以使用CLP 将运行DB2 Workgroup 的系统连接到运行DB2Express 的系统上的数据库5.下列关于DB2 环境的说法,哪一项是错误的?CA. TCPIP 端口唯一地标识DB2 实例B.在给定的时间内可以有多个实例运行C.如果试图在实例B 中创建一个数据库,而所用数据库名在实例 A 中已使用,将会发生冲突D.如果试图在数据库A 中创建一个表空间,而所用表空间名在相同的数据库中已使用,将会发生冲突6.下列哪一项不是有效的DB2 客户端?DA. IBM 数据服务器客户端B. IBM 数据服务器运行时客户端C. DB2 运行时客户端合并模块(Windows)D. IBM 数据服务器瘦客户端7. 下列关于DB2 实例的说法,哪一项是正确的?CA. 实例通过dbm cfg 相互关联B. 如果实例A 崩溃,则系统中运行的其他实例也无法运行C. 如果实例A 停止运行,则无法访问此实例中的数据库D. 在一个实例中,只能创建一个数据库8. 下列关于DB2 中表空间的表述,哪一项是错误的?CA. 表空间是介于逻辑表和物理容器之间的逻辑对象B. 所有的表、索引和其他数据都存储在表空间中C. 表空间是在内存中高速缓存表和索引数据的逻辑对象D. 表空间总是关联到缓冲池9. 你接到任务要将大量数据导入DB2 数据库。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一选择题(每题1.5分,共45分)1) 下面的哪个数据库版本可以访问OS/390 上的DB2 UDB 数据库?a) DB2 Connect Personal Editionb) DB2 Universal Database Workgroup Editionc) DB2 Personal Developer's Editiond) DB2 Universal Developer's Edition2) 下面的哪个工具可以编目一个数据库信息?a) Journal 日志工具b) Alert Center 警告中心c) License Center 许可证中心d) Client Configuration Assistant 客户端配置助手3) 下面的哪个工具可以重组数据回收表中被删除的行所占有的资源?a)reorgb) db2lookc) db2moved) runstats4) USE这个特权的用途是?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) 如果创建数据库则需要下面的哪两个权限?a) DBADMb) SYSADMc) DBCTRLd) SYSCTRLe) SYSMAINT6) 编目一个远程数据库是指:a) 在PC或者Unix 机器上执行编目,目的是为了识别DB2数据库管理器所在的服务器b) 在PC或者Unix机器上编目,目的是为了让用户和应用程序可以识别DB2数据库c) 从不在DB2中编目,仅当每个节点上的数据库被允许编目时编目,所以自动编目那个节点就可以自动编目数据库Nd) 在PC或者UNIX机器上编目是为了打开在DB2数据库中的目录表,这样当前的用户可以访问这个数据库中的一组可以被访问的数据表。
7) 给出下面的语句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)下面的哪个查询语句是正确的?a) SELECT route_num FROM speed_limits WHERE canada_sl > 80b) SELECT route_num FROM speed_limits WHERE canada_sl > kphc) SELECT route_num FROM speed_limits WHERE canada_sl > us_sld) SELECT route_num FROM speed_limits WHERE canada_sl > kph(80)8) 如果给出一个表,在控制中心中没有生成DDL 选项,可能是下面的哪个原因?a) 这个表示系统对象b) 这个表是统计表c) 这个表被暂停挂起d) 这个表示镜像表.e) 这个表是由其他用户创建的9) 给出下面的两个表COUNTRYID NAME STAFFID CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5STAFFID LASTNAME1 Jones2 Smith下面的哪个语句可以从COUNTRY表中删除与STAFF表ID相同的记录?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) 表STOCK定义如下type CHAR (1)status CHAR(1)quantity INTEGERprice DEC (7,2)哪个语句可以设置type字段不是’S’的记录: STATUS为NULL,QUANTITY为0,price为0? (选择最可能的语句)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) 下面哪些内容不能设置autocommit自动提交?a) 嵌入式SQLb) 命令中心c) 命令行处理器d) DB2 调用接口12)下面的哪个语句可以在最终的结果表中去除那些重复的记录?a) SELECT UNIQUE * FROM t1b) SELECT DISTINCT * FROM t1c) SELECT * FROM DISTINCT T1d) SELECT UNIQUE (*) FROM t1e) SELECT DISTINCT (*) FROM t113) 给出下面的表STAFFID LASTNAME1 Jones2 Smith3 null下面的哪个语句可以删除lastname字段为空的记录?a) DELETE FROM staff WHERE lastname IS NULLb) DELETE ALL FROM staff WHERE lastname IS NULLc) DELETE FROM staff WHERE lastname = 'NULL'd) DELETE ALL FROM staff WHERE lastname = 'NULL'14)给出下面表的定义DEPARTMENTdeptno CHAR(3)deptname CHAR(30)mgrno INTEGERadmrdept CHAR(3)EMPLOYEEempno INTEGERfirstname CHAR(30)midinit CHARlastname CHAR(30)workdept CHAR(3)下面的哪个语句可以列出每个雇员的编号以及lastname,以及他们经理的雇员编号和lastname,并且包含没有经理管理的那些员工?(提示使用哪种连接?)a) SELECT e.empno, stname, m.empno, stname FROM employee e LEFT INNERJOIN department INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptnob) SELECT e.empno, stname, m.empno, stname, FROM employee e LEFT OUTER JOINdepartment INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptnoc) SELECT e.empno, stname, m.empno, stname FROM employee e RIGHT OUTER JOINdepartment INNER JOIN employee m ON mgrno = m.empno ON e.workdept = deptnod) SELECT e.empno, stname, m.empno, stname FROM employee e RIGHT INNER JOINdepartment INNER JOIN employee m ON mgrno = m.empno ONe.workdept = deptno15) 给出下面的表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 189PIMName PIMMats Sundin 14Bobby Orr 12Mark Messier 32Brett Hull 66Mario Lemieux 23Joe Sakic 94下面的哪个语句可以显示玩家的名字,号码,得分,以及PIM信息,并且玩家的名称必须在三张表中都要出现?a) SELECT , names.number, points.points, pim.pim FROM names INNER JOIN pointsON = INNER JOIN pim ON =b) SELECT , names.number, points.points, pim.pim FROM names OUTER JOIN pointsON = OUTER JOIN pim ON =c) SELECT , names.number, points.points, pim.pim FROM names LEFT OUTER JOINpoints ON = LEFT OUTER JOIN pim ON =d) SELECT , names.number, points.points, pim.pim FROM names RIGHT OUTER JOINpoints ON = RIGHT OUTER JOIN pim ON =16) 给出以下的表EMPLOYEEemp_num emp_name dept1 Adams 12 Jones 13 Smith 24 Williams 1DEPTdept_id dept_name1 Planning1 Support给出下面的语句:ALTER TABLE employeeADD FOREIGN KEY (dept) REFERENCES (dept_id)ON DELETE CASCADE在下面的语句中共有多少个工作单元需要处理?DELETE FROM dept WHERE dept_id=1a) 0b) 1c) 2d) 3e) 4f) 617. 根据需要存储姓名和雇员编号,当雇员被解雇时,下面的哪个数据类型不能用于保存雇员解雇日期?a) CLOBb) TIMEc) VARCHARd) TIMESTAMP18) 给出下面的事务"CREATE TABLE t1 (id INTEGER,CONSTRAINT chkid CHECK (id<100))" "INSERT INTO t1 VALUES (100)""COMMIT"事务处理的结果是什么?a) 插入了一个NULL值b) 擦如乐一个100c) 插入数据时,数据库拒绝插入100d) 一个名字叫做chkid的触发器被调用并验证数据19) 如果一张表中的一个或者多个字段使用了Check约束,下面的那个工具必须在Load装载数据之后执行?a) Reorgb) Checkc) Runstatsd) Image Copye) Set Integrity20) 给出下面的语句?CREATE VIEW v1 AS SELECT c1 FROM t1 WHERE c1='a' WITH CHECK OPTION下满的哪个语句可以将数据插入到数据库中?a) INSERT INTO v1 VALUES (a)b) INSERT INTO v1 VALUES (b)c) INSERT INTO v1 VALUES ('b')d) INSERT INTO v1 VALUES ('a')e) INSERT INTO v1 VALUES ('ab')21) 如果一个应用程序使用了可重复读取的事务隔离级别,在下面哪种情况下可以释放更新锁?a) 关闭访问行的游标.b) 在事务中执行ROLLBACK指令c) 访问当前行的游标移动到下一行d) 通过使用UPDATE语句改变事务I22) Which of the following isolation levels is most likely to acquire a table level lock during an index scan?下面的哪种事务隔离级别要求在索引扫描期间使用表级锁?a) RSb) RRc) CSd) UR24) 下面哪种应用程序释放锁的方式适用于游标稳定性事务隔离级别?a) 访问当前行的游标移动到下一行b) 访问当前行的游标用于更新当前行c) 应用程序删除当前行d) 一个应用程序访问的当前行需要另外的应用程执行更新语句25 ) 给出下面的表STAFFID LASTNAME1 Jones2 Smith当执行SELECT * FROM staff 返回的行是按照哪种顺序输出的?a) 无序b) 主键顺序c) 插入到表中的记录顺序The order that the rows were inserted into the tabled) 先按ID列上的值,然后按LASTNAME列上的值26) 下面的语句将要创建多少个索引?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) 426) 给出下面的表COUNTRYID NAME PERSON CITIES1 Argentina 1 102 Canada 2 203 Cuba 2 104 Germany 1 05 France 7 5STAFFID LASTNAME1 Jones2 Smith下面的语句:INSERT INTO staff SELECT person, 'Greyson' FROM country WHERE person > 1有多少条记录插入到数据库?a) 0b) 1c) 2d) 327) 给出下面表的定义和授予特权的语句?CREATE TABLE table1 (col1 INT, col2 CHAR(40), col3 INT)GRANT INSERT, UPDATE, SELECT, REFERENCES ON TABLE table1 TO USER usera下面的哪个语句可以撤销USERA在COL1和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 USERAd) REVOKE REFERENCES ON TABLE table1 COLUMNS (col1, col2) FROM USER usera28) 给出CREATE TABLE t1 (c1 CHAR(4) NOT NULL). 哪个值可以插入到表中?a) 4b) NULLc) ‘abc’d) ‘abcde’29) 下面的哪个设置,不允许被引用的主键字段在子表中还存在,就删除主表中的数据?a) DELETEb) CASCADEc) RESTRICTd) SET NULL30) 给出两个表的定义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)下面的哪个语句可以显示每个部门的名称,并且按照字母顺序升序排列,以及部门经理的名称?a) SELECT a.deptname, FROM org a, staff b WHERE a.manager=b.idb) SELECT a.deptname, FROM org a, staff b WHERE b.manager=a.idc) SELECT a.deptname, FROM org a, staff b WHERE a.manager=b.id order BY a.deptname, d) SELECT a.deptname, FROM org a, staff b, WHERE b.manager=a.id GROUP BY a.deptname, 二简答题( 每题3分,共30分)1 简述SQL语言的分类及其作用?DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE)DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT)DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK)2 什么是谓词?举出10个常见的谓词? (提示经常在where中需要用到的符号) in between like exists is contains3 char类型和varchar类型的区别? graphic和vargraphic的区别用于存储固定长度的字符串可变长度的字符串GRAPHIC 用于存储固定长度的双字节字符串4 什么是数据库的实例?怎样查看系统的中的实例?怎样切换实例?怎样查看实例中的数据库?怎样启动实例?怎样连接数据库? 怎样改变语句结束符?实例是数据库管理器的逻辑环境,可以在实例中5 简述DB2中常见的数据库对象?重点阐述表、索引、视图和模式的概念表空间缓冲池表索引序列视图模式别名存储过程触发器表是一组相关数据逻辑安排的行和列索引是有序键值的集合视图是将一个或者多个表生成的虚拟表,是存储在数据库的sql模式,是数据库对象的命名空间,讲对象逻辑分组6 简述COUNT、SUM、AVG、STDDEV、MAX、MIN函数的作用计算区域中满足个定条件的单元格个数给定条件的数据求和求给定条件的数据的平均值计算标准差7 简述DB2种的约束的类别?并分别写出SQL,怎样使用该约束? (提示:表的字段可以简洁)Not null约束主键约束唯一性约束外间约束,检查约束Create table tablename (a int not null,B varchar(20))Pri mary k ey foreign key constaint b check(b between 1 an 100)8 什么是主表和从表?主键所在的表外面所在的表9 什么是CS,RS,US,RR?US如果是读取操作,不产生任何的行级别锁,非读取同CSCS锁住当前处理记录RS 锁定所有符合条件的记录RR 锁住所有相关记录10 什么是分组语句?where和having子句的区别?请举例说明作用对象不同,WHERE子句作用于基本表或视图,从中选择满足条件的记录;HAVING子句作用于组,从中选择满足条件的组。