吉大14秋学期《数据库应用技术》在线作业一答案
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
数据库应用技术吉大14秋学期《数据库应用技术》在线作业一
一,单选题
1. 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 row
正确答案:C
2. 在语句CREATE VIEW EMP_VIEW2 (EMPNO, EMPNAME, DEPTNO, JOBTITLE, HIREDATE) AS SELECT ID, NAME, DEPT, JOB, HIREDATE FROM EMPLOYEE WHERE DEPT=10 WITH CHECK OPTION; 所定义的视图中,当使用INSERT语句时,若新增的行中DEPTNO数值不为10,则该行将被拒绝插入。
A. 正确
B. 错误
?
正确答案:A
3. 若用如下的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)
?
正确答案:B
4. 使用DROP语句撤消基本表时,使用以下哪个子句,可以将下属的视图和约束引用全部撤消?
A. NULL
B. RESTRICT
C. CASCADE
D. DISTINCT
?
正确答案:C
5. 对于那些需要偶尔连接到公司数据上进行数据交换的用户可选择哪种版本的DB2?对于支持小规模的部门级应用,这些应用不需要存取驻留在OS/400、OS/390等平台上的远程数据库,则需要哪种级别的DB2 产品?
A. 企业版
B. 工作组版
C. 企业扩展版
D. 个人版
E. 卫星版
?
正确答案:E
6. 实体是信息世界中的术语,与之对应的数据库术语为:()
A. 文件
B. 数据库
C. 字段
D. 记录
?
正确答案:D
7. 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
正确答案:C
8. An ODBC/CLI application has the following pseudocode: SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc ) SQLConnect( hDbc, "CERTDB", SQL_NTS, "user1", SQL_NTS, "passwd", SQL_NTS ) SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) SQLExecDirect( hStmt, "SET CURRE
正确答案:C
9. 关系规范化中的删除操作异常是指()
A. 不该删除的数据被删除
B. 不该插入的数据被插入
C. 应该删除的数据未被删除
D. 应该插入的数据未被插入
?
正确答案:A
10. 要更改数据库管理器配置文件,需以下哪个数据库权限?
A. DBADM
B. SYSMAINT
C. SYSCTRL
D. SYSADM
?
正确答案:D
11. 如果一个用户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
?
正确答案:B
12. 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()
正确答案:D
13. Which of the following is TRUE for all cursors defined as FOR FETCH ONLY?
A. The cursors are unambiguous.
B. Only the first row is returned.
C. Cursor stays open after a commit.
D. A temporary table is created on the server.
?
正确答案:A
14. A cursor is declared with the WITH HOLD option. Which of the following statements is always true?
A. The cursor will remain open after a COMMIT.
B. All rows retrieved are locked until a COMMIT.
C. A COMMIT will not be allowed until the cursor is closed
正确答案:A
15. Given the code: EXEC SQL WITH most_cities AS ( SELECT b.id, , 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
正确答案:A
16. 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
?
正确答案:B
17. Given the table T1 with the following data: COL1 IDX ---- ---- A single-threaded