黄老师 发表于 2015-10-28 08:50:35

吉大15秋《数据库应用技术》在线作业答案

吉大15秋《数据库应用技术》在线作业一
试卷总分:100   测试时间:--
一、单选题(共25道试题,共100分。)
1.DBMS是()
A. 操作系统的一部分
B. 在操作系统支持下的系统软件
C. 一种编译程序
D. 应用程序系统
满分:4分
2.The following commands are issued against a data source: CREATE TABLE userid.org ( i INT) CREATE ALIAS user1.org FOR userid.org CREATE TABLE org.sample ( c CHAR(1)) CREATE ALIAS sample.org FOR userid.org CREATE ALIAS userid.sample FOR sample.org When issued by USER1, which of the following statements will have a different result set than this SELECT statement SELECT * FROM org
A. SELECT * FROM org.sample
B. SELECT * FROM sample.org
C. SELECT * FROM userid.org
D. SELECT * FROM userid.sample
满分:4分
3.下面哪个工具提供了对文本、图象、音频、视频和XML文档等非传统数据类型的处理能力?
A. DB2 数据仓库中心
B. DB2数据链接管理器
C. DB2关系扩展器
D. DB2 OLAP Starter Kit
满分:4分
4.An ODBC/CLI application performs an array insert into a table containing a primary key. If one of the values inserted generates a duplicate row error, which of the following APIs can be called to determine the failing row
A. SQLError()
B. SQLNumRows()
C. SQLRowCount()
D. SQLGetDiagField()
满分:4分
5.Given the tables: COUNTRY id name 1 Argentina 3 Cuba 4 - NATION id name 2 Belgium 4 USA and the code: EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM country WHERE name IS NOT NULL UNION SELECT * FROM nation EXEC SQL OPEN C1 How many rows are in the result set
A. 1
B. 2
C. 3
D. 4
满分:4分
6.给定三个表:学生表S,课程表C和学生选课表SC,它们的结构分别如下: S(S#,SN,SEX,AGE,DEPT) C(C#,CN) SC(S#,C#,GRADE)其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程 号,CN为课程名,GRADE为成绩。 对表SC建立如下视图: CREATE VIEW S_GRADE(S#,C_NUM,AVG_GRADE) AS SELECT S#,COUNT(C#),AVG(GRADE) FROM SC GROUP BY S#; 判断下面查询是否允许执行,如允许,写出转换到基本表SC上的操作。 SELECT S#,C_NUM FROM S_GRADE WHERE AVG_GRADE>80
A. 不允许查询。因为视图中使用了分组和聚合函数。
B. 允许。对应的操作为: SELECT S#,COUNT(C#) FROM SC WHERE AVG(GRADE)>80
C. 允许。对应的操作为: SELECT S#,COUNT(C#) FROM SC GROUP BY S# HAVING AVG(GRADE)>80
D. 允许。对应的操作为: SELECT S#, COUNT(C#) FROM SC HAVING AVG(GRADE)>80
满分:4分
7.下列哪种工具可以向表中增添记录,并更改数据库的统计信息?
A. import
B. insert
C. load
D. update
满分:4分
8.在SELECT语句的下列子句中,通常和HAVING子句同时使用的是以下哪项?
A. ORDER BY子句
B. WHERE子句
C. GROUP BY子句
D. 均不需要
满分:4分
9.Given the tables, the relationships and the statements: EMPLOYEE DEPT emp_num emp_name dept dept_id dept_name 1 Adams 1 1 Planning 2 Jones 1 2 Support 3 Smith 2 4 Williams 1 Relationship: employee.dept is a foreign key on dept.dept_id. stmt="INSERT INTO employee VALUES (5,'jones',3)"; EXEC SQL EXECUTE IMMEDIATE :stmt; stmt="INSERT INTO employee VALUES (6,'jhonson',2)'; EXEC SQL EXECUTE IMMEDIATE :stmt; How many rows are successfully inserted
A. One row is inserted in EMPLOYEE
B. No rows are inserted in EMPLOYEE
C. Two rows are inserted in EMPLOYEE
D. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE
满分:4分
10.If a stored procedure returns multiple rows, which of the following must the calling application use to access the result set
A. A cursor
B. A select statement
C. A declared temporary table
D. A table user-defined function
满分:4分
11.关系数据库管理系统应能实现的专门关系运算包括()
A. 排序、索引、统计
B. 选择、投影、连接
C. 关联、更新、排序
D. 显示、打印、制表
满分:4分
12.对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A. 企业版
B. 工作组版
C. 企业扩展版
D. 个人版
E. 卫星版
F. 微型版
满分:4分
13.关系模型中的关系模式至少是()
A. 1NF
B. 2NF
C. 3NF
D. BCNF
满分:4分
14.Given the following table: TestTable C1 ----------- 12345 And if the following CLI calls are made: SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&henv); SQLSetEnvAttr( henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3,0); SQL AllocHandle(SQL_HANDLE_DBC,henv,&hdbc); SQLConnect( hdbc, (SQLCHAR *)"db", SQL_NTS, (SQLCHAR *)"userid", SQL_NTS, (SQLCHAR *)"password", SQL_NTS ); SQLSetConnectAttr( hdbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, 0); SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt); SQLPrepare(hstmt,(unsigned char*)"select *from Test order by C1',SQL_NTS); SQLBindCol(hstmt,1,SQL_C_SHORT,&data,0,NULL); SQLExecute(hstmt); SQLFetch(hstmt); printf(Data:%i\n",data); SQLFetch(hstmt); printf(Data:%i\n",data); SQLFetch(hstmt); printf(Data:%i\n",data); SQLEndTran(SQL_HANDLE_ENV,henv,SQL_COMMIT); SQLFetch(hstmt); printf(Data:%i\n",data); Which of the following will be returned by the program
A. Data: 1 Data: 2 Data: 3 Data: 3
B. Data: 1 Data: 2 Data: 3 Data: 4
C. Data: 1 Data: 2 Data: 3 Data: 1
D. Data: 1 Data: 2 Data: 3 Data: 5
满分:4分
15.当FROM子句中出现多个基本表或视图时,系统将执行什么操作?
A. 并
B. 等值联接
C. 自然联接
D. 笛卡儿积
满分:4分
16.Given the following table: CREATE TABLE employee (name CHAR(10), salary DEC NOT NULL WITH DEFAULT) INSERT INTO employee (name, salary) VALUES ('SMITH', 30000) INSERT INTO employee (name) VALUES ('JONES') INSERT INTO employee (name, salary) VALUES ('ALI', 35000) Which of the following statements will retrieve more than one row
A. SELECT salary FROM employee WHERE salary IN (SELECT (salary/(SELECT SUM(salary) FROM employee)) FROM employee)
B. SELECT COALESCE(AVG(salary)) FROM employee
C. SELECT SUM(salary)/COUNT(*) FROM employee
D. SELECT salary/(SELECT SUM(salary) FROM employee) FROM employee
满分:4分
17.实体是信息世界中的术语,与之对应的数据库术语为:()
A. 文件
B. 数据库
C. 字段
D. 记录
满分:4分
18.若用如下的SQL语句创建一个student表: CREATE 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)
满分:4分
19.Given the table T1, created using the following statement: CREATE TABLE t1 ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, c1 CHAR(3) ) The following SQL statements are issued: INSERT INTO t1 VALUES (2, 'def') INSERT INTO t1 VALUES (DEFAULT, 'abc') INSERT INTO t1 VALUES (DEFAULT, 'ghi') Which of the following represents the order in which the values are returned from the following SELECT statement SELECT id FROM t1 ORDER BY id
A. 1, 2, 2
B. 1, 2, 3
C. 2, 3, 4
D. 0, 1, 2
满分:4分
20.两个子查询的结果(),可以执行并、交、差操作
A. 结构完全一致
B. 结构完全不一致
C. 结构部分一致
D. 主键一致
满分:4分
21.Given the tables: EMPLOYEE DEPT emp_num emp_name dept dept_id dept_name 1 Adams 1 1 Planning 2 Jones 1 2 Support 3 Smith 2 4 Williams 1 and the statement: ALTER TABLE employee ADD FOREIGN KEY (dept) REFERENCES dept (dept_id) ON DELETE CASCADE How many rows will be deleted when the following statement is executed DELETE FROM employee WHERE dept=1
A. 0
B. 1
C. 3
D. 4
满分:4分
22.Given the table called NAME with the following column and data: lname ------ Smith SMITH SmiTh smith Which of the following SQL statements will return all four rows in upper case
A. SELECT CAPS(lname) FROM name
B. SELECT UCASE(lname) FROM name
C. SELECT STRUPR(lname) FROM name
D. SELECT TOUPPER(lname) FROM name
满分:4分
23.关系模式中各级模式之间的关系为()
A. 3NF包含 2NF包含 1NF
B. 3NF包含 1NF包含 2NF
C. 1NF 包含2NF包含 3NF
D. 2NF包含 1NF 包含3NF
满分:4分
24.To prepare an embedded SQL program for use with a host-language compiler, which of the following database components is required
A. Binder
B. Precompiler
C. Stored Procedure Builder
D. Application Development Center
满分:4分
25.下述关于数据库系统的正确叙述是()
A. 数据库中只存在数据项之间的联系
B. 数据库的数据项之间和记录之间都存在联系
C. 数据库的数据项之间无联系,记录之间存在联系
D. 数据库的数据项之间和记录之间都不存在联系
满分:4分吉大15秋学期《数据库应用技术》在线作业二
试卷总分:100   测试时间:--
一、单选题(共25道试题,共100分。)
1.Given the code: EXEC SQL WITH most_cities AS ( SELECT b.id, b.name, a.cities FROM country a, staff b WHERE a.person = b.id AND cities > :threshold ) SELECT id, name, cities FROM most_cities INTO :id, :name, :cities WHERE cities IN (SELECT MAX(cities) FROM most_cities) Which of the following can reference MOST_CITIES
A. The current statement
B. Statements from any application
C. All statements within this application
D. All statements within the current unit of work
满分:4分
2.如果一个用户USER1被授予了表TAB上的CONTROL特权,如果需要限制该用户对表的存取,应使用以下哪条命令?
A. REVOKE ALL ON TAB TO USER1
B. REVOKE ALL ON TAB FROM USER1
C. REVOKE CONTROL ON TAB TO USER1
D. REVOKE CONTROL ON TAB FROM USER1
满分:4分
3.事务的原子性是指()
A. 事务中包含的所有操作要么都做,要么都不做
B. 事务一旦提交,对数据库的改变是永久性的
C. 一个事务内部的操作及使用的数据对并发的其他事务是隔离的
D. 事务必须是使数据库从一个一致性状态变到另一个一致性状态
满分:4分
4.Given the tables, the relationships and the statements: EMPLOYEE DEPT emp_num emp_name dept dept_id dept_name 1 Adams 1 1 Planning 2 Jones 1 2 Support 3 Smith 2 4 Williams 1 Relationship: employee.dept is a foreign key on dept.dept_id. stmt="INSERT INTO employee VALUES (5,'jones',3)"; EXEC SQL EXECUTE IMMEDIATE :stmt; stmt="INSERT INTO employee VALUES (6,'jhonson',2)'; EXEC SQL EXECUTE IMMEDIATE :stmt; How many rows are successfully inserted
A. One row is inserted in EMPLOYEE
B. No rows are inserted in EMPLOYEE
C. Two rows are inserted in EMPLOYEE
D. One row is inserted in DEPT and 2 rows are inserted in EMPLOYEE
满分:4分
5.下述关于数据库系统的正确叙述是()
A. 数据库中只存在数据项之间的联系
B. 数据库的数据项之间和记录之间都存在联系
C. 数据库的数据项之间无联系,记录之间存在联系
D. 数据库的数据项之间和记录之间都不存在联系
满分:4分
6.Given the expression: WITH most_cities AS ( SELECT b.id,b.name,a.cities FROM country a, staff b WHERE a.person = b.id AND cities > :threshold ) SELECT * FROM most_cities In which of the following does MOST_CITIES exist
A. user tables
B. server memory
C. user table space
D. system catalog tables
满分:4分
7.Given an ODBC/CLI program with a single connection, two threads and the following actions which complete successfully: Thread 1: INSERT INTO mytab VALUES (1) Thread 2: INSERT INTO mytab VALUES (2) Thread 1: COMMIT Thread 2: INSERT INTO mytab VALUES (3) Thread 1: ROLLBACK Thread 2: COMMIT How many records will be inserted and retained in the table MYTAB
A. 0
B. 1
C. 2
D. 3
满分:4分
8.If a stored procedure returns multiple rows, which of the following must the calling application use to access the result set
A. A cursor
B. A select statement
C. A declared temporary table
D. A table user-defined function
满分:4分
9.关系模型中的关系模式至少是()
A. 1NF
B. 2NF
C. 3NF
D. BCNF
满分:4分
10.数据库系统的并发控制的主要方法是采用()制。
A. 拒绝
B. 改为串行
C. 锁
D. 不加任何控制
满分:4分
11.Which of the following is a benefit of user-defined functions
A. Improves application concurrency
B. Improves blocking of result sets
C. Simplifies application maintenance
D. Reduces memory requirements on the server
满分:4分
12.Which of the following is used to run an embedded dynamic SQL UPDATE statement
A. UPDATE
B. . PREPARE
C. . DECLARE
D. . EXECUTE
满分:4分
13.实体是信息世界中的术语,与之对应的数据库术语为:()
A. 文件
B. 数据库
C. 字段
D. 记录
满分:4分
14.下面哪个工具提供了对文本、图象、音频、视频和XML文档等非传统数据类型的处理能力?
A. DB2 数据仓库中心
B. DB2数据链接管理器
C. DB2关系扩展器
D. DB2 OLAP Starter Kit
满分:4分
15.Given the following table: CREATE TABLE employee (name CHAR(10), salary DEC NOT NULL WITH DEFAULT) INSERT INTO employee (name, salary) VALUES ('SMITH', 30000) INSERT INTO employee (name) VALUES ('JONES') INSERT INTO employee (name, salary) VALUES ('ALI', 35000) Which of the following statements will retrieve more than one row
A. SELECT salary FROM employee WHERE salary IN (SELECT (salary/(SELECT SUM(salary) FROM employee)) FROM employee)
B. SELECT COALESCE(AVG(salary)) FROM employee
C. SELECT SUM(salary)/COUNT(*) FROM employee
D. SELECT salary/(SELECT SUM(salary) FROM employee) FROM employee
满分:4分
16.对于那些需要偶尔连接到公司数据上进行数据交换的用户可选择哪种版本的DB2?对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A. 企业版
B. 工作组版
C. 企业扩展版
D. 个人版
E. 卫星版
满分:4分
17.Given the following statements: EXEC SQL INSERT INTO employee VALUES(:new_emp, :new_name) EXEC SQL UPDATE company SET num_employees=num_employees+1 WHERE company_id=1 EXEC SQL COMMIT Which of the following can be added to the database so that the company table will still be updated without the need for the explicit UPDATE SQL statement
A. An INSERT trigger on COMPANY
B. An UPDATE trigger on COMPANY
C. An INSERT trigger on EMPLOYEE
D. An UPDATE trigger on EMPLOYEE
满分:4分
18.对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A. 企业版
B. 工作组版
C. 企业扩展版
D. 个人版
E. 卫星版
F. 微型版
满分:4分
19.创建一个DMS类型的表空间,可以使用以下哪两种文件系统对象作为容器?
A. 目录
B. 文件
C. DEVICE
满分:4分
20.发人员开发访问后台AIX上的DB2的windows程序,需要在windows开发平台上安装:
A. DB2运行时间客户端
B. DB2管理客户端
C. DB2应用程序开发客户端
D. DB2瘦客户端
满分:4分
21.执行下面两条SQL语句后: CREATE TABLE t1 ( c1 char(10) NOT NULL PRIMARY KEY, c2 int, c3 char(10), c4 char(10) NOT NULL, CONSTRAINT c4 UNIQUE (c1,c4) ) //自动创建索引 CREATE INDEX Index1 ON t1 (c2 ASC) 表t1上有几个索引?
A. 0
B. 1
C. 2
D. 3
E. 4
满分:4分
22.向基本表增加一个新列后,原有元组在该列上的值为什么?
A. TRUE
B. FALSE
C. 空值
D. 不确定
满分:4分
23.数据库系统的独立性是指():
A. 不会因为数据的变化而影响应用程序
B. 不会因为系统数据存储结构与数据逻辑结构的变化而影响应用程序
C. 不会因为存储策略的变化而影响存储结构
D. 不会因为某些存储结构的变化而影响其它的存储结构
满分:4分
24.如果想在数据导入的过程中创建表,应该
A. 使用IXF文件格式进行LOAD
B. 使用WSF文件格式进行LOAD
C. 使用IXF文件格式进行IMPORT
D. 使用WSF文件格式进行IMPORT
满分:4分
25.An application uses static SQL to connect to a remote DB2 server and inserts data into the CUST.ORDERS table on that remote DB2 server. To enable access to the remote DB2 server, FOO needs to create a package with default options so that BAR is the only non-administrative user that can use this package on the remote DB2 server. Which statement describes the privileges that FOO requires to accomplish this
A. FOO requires EXECUTE privilege on the package.
B. FOO requires the privilege to create the package on the remote DB2 server.
C. FOO requires EXECUTE privilege on the package and INSERT privilege on CUST.ORDERS.
D. FOO requires the privilege to create the package on the remote DB2 server and INSERT privilege on CUST.ORDERS.
满分:4分

页: [1]
查看完整版本: 吉大15秋《数据库应用技术》在线作业答案