|
需要购买此门答案请加qq2762169544(微信:2762169544)
吉大17秋学期《数据库应用技术》在线作业一
试卷总分:100 测试时间:--
单选题
一、单选题(共 25 道试题,共 100 分。)V
1. 下述关于数据库系统的正确叙述是()
A. 数据库中只存在数据项之间的联系
B. 数据库的数据项之间和记录之间都存在联系
C. 数据库的数据项之间无联系,记录之间存在联系
D. 数据库的数据项之间和记录之间都不存在联系
满分:4 分
2. Which of the following CLI/ODBC functions should be used to delete rows from a DB2 table?
A. SQLDelete()
B. SQLExecDirect()
C. SQLBulkDelete()
D. SQLExecuteUpdate()
满分:4 分
3. 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 分
4. 事务的原子性是指()
A. 事务中包含的所有操作要么都做,要么都不做
B. 事务一旦提交,对数据库的改变是永久性的
C. 一个事务内部的操作及使用的数据对并发的其他事务是隔离的
D. 事务必须是使数据库从一个一致性状态变到另一个一致性状态
满分:4 分
5. 在语句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. 错误
满分:4 分
6. Given the table T1 with the following data: COL1 IDX ---- ---- A single-threaded CLI application executes the following pseudocode in sequence: SQLAllocHandle( SQL_HANDLE_ENV, NULL, &hEnv ) SQLAllocHandle( SQL_HANDLE_DBC, hEnv, &hDbc ) SQLConnect( hDbc, "SAMPLE", SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS ) SQLSetConnectAttr( hDbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON ) SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=10 WHERE idx=1", SQL_NTS ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=20 WHERE idx=2", SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_COMMIT ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=30 WHERE idx=1", SQL_NTS ) SQLExecDirect( hStmt, "UPDATE table1 SET col1=40 WHERE idx=1", SQL_NTS ) SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_ROLLBACK ) SQLExecDirect( hStmt, "SELECT col1 FROM table1 WHERE idx=1", SQL_NTS ) Which of the following values for COL1 will be fetched when the sequence for the pseudocode listed above is successfully executed?
A. 10
B. 20
C. 30
D. 40
满分: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. Which of the following is used to run an embedded dynamic SQL UPDATE statement?
A. UPDATE
B. . PREPARE |
|