文档库 最新最全的文档下载
当前位置:文档库 › 最新Oracle题库4

最新Oracle题库4

最新Oracle题库4
最新Oracle题库4

Oracle 1Z0-033

Oracle 9I Database:Performance Tuning

Q&A Demo

English: https://www.wendangku.net/doc/ca15543739.html,

BIG5: https://www.wendangku.net/doc/ca15543739.html,

GB: https://www.wendangku.net/doc/ca15543739.html, TestInside,help you pass any IT exam!

1. You executed the following SQL statement to change the goal of the cost-based optimizer (CBO):

What will be the result of this statement?

A.The goal of the CBO for the current session is set to best throughput.

B.The optimizer uses a cost-based approach for all SQL statements in the session provided the statistics are available.

C.It will result in an error because the goal of the CBO cannot be changed at the session level.

D.The goal of the CBO for the current session is set to find the best plan for fast delivery of all the rows while using a mix of cost and heuristics.

Answer: A

2. Which two statements are true regarding the statistics used by the optimizer to generate an optimal plan? (Choose two.)

A.The statistics collected through a histogram are not useful for better selectivity estimates of unevenly distributed data.

B.Dynamic sampling is preferred when the cost of collecting the sample statistics outweighs the advantage of a better execution plan.

C.The maximum and minimum values collected by the column statistics leads to an optimal plan if there is an even distribution of data between those two values.

D.The statistics collected through a histogram are useful if the data distribution is skewed between minimum and maximum values.

Answer: CD

3. Notice the following factors about a table:

Which is the least time-consuming method that you would use to deallocate the unused space?

A.follow the EXPORT, DROP, and IMPORT method

https://www.wendangku.net/doc/ca15543739.html,e the DBMS_SPACE.FREE_BLOCKS procedure

C.follow the EXPORT, TRUNCATE, and IMPORT method

https://www.wendangku.net/doc/ca15543739.html,e MOVE with the ALTER TABLE command to move the table

https://www.wendangku.net/doc/ca15543739.html,e DEALLOCATE UNUSED with the ALTER TABLE command

Answer: D

4. In your database, you executed the following command to monitor the ind1 index:

After this, the table is updated by a large transaction. Now, you want to check the index statistics. What would you do to update the INDEX_STATS view with the latest statistics?

A.analyze the index with the ESTIMATE STATISTICS option

B.analyze the index with the COMPUTE STATISTICS option

C.analyze the index with the V ALIDATE STRUCTURE option

D.gather the table statistics first, and then analyze the index with any one of the options

Answer: C

5. Which statement correctly describes the purpose of the REFRESH COMPLETE option when used with materialized view?

A.truncates the materialized view and repopulates it with the data from the base table in the query

B.populates the materialized view with the data from the base tables that has changed since the last refresh

C.populates the materialized view with the data from the base tables after each commit to any of the base tables

D.truncates the materialized view and populates it with the data from the base tables that has changed since the last refresh

Answer: A

6. You are working on the performance tuning of your database. Which two types of performance tuning-related information would an alert log file provide? (Choose two.)

A.mean time to recover

https://www.wendangku.net/doc/ca15543739.html,tch contention information

C.instance recovery start and complete times

D.SQL statements that are consuming maximum resources

E.the top five sessions that are consuming maximum resources

Answer: AC

7. What is the effect of setting the FAST_START_MTTR_TARGET initialization parameter?

A.A higher value for the FAST_START_MTTR_TARGET initialization parameter results in less time spent on reading redo during instance startup.

B.A lower value for the FAST_START_MTTR_TARGET initialization parameter results in more time spent on reading redo during instance startup.

C.A lower value for the FAST_START_MTTR_TARGET initialization parameter results in an increase in the frequency of the DBWRn process writing dirty buffers.

D.A higher value for the FAST_START_MTTR_TARGET initialization parameter results in the LGWR process writing redo log buffers faster.

Answer: C

8. You have reserved memory within the Shared Pool by using the SHARED_POOL_RESERVED_SIZE parameter to accommodate large space allocations while compiling PL/SQL blocks and database triggers.

While observing the performance of the reserved area, you find that the value of the REQUEST_FAILURES column in the V$SHARED_POOL_RESERVED view is continuously increasing.

Which statement is true in this scenario?

A.The parsing of the statement fails due to invalidations.

B.The execution of the statement fails due to invalidations.

C.The space allocated for the reserved area is not enough.

D.The syntax in the PL/SQL blocks is causing the compilation failure.

Answer: C

9. You have objects that have a variable reference pattern. These are referenced vigorously for some time, and then not referenced at all for a long time. As a result, these objects are being aged out from Oracle memory buffers frequently.

Which two strategies would you recommend to avoid aging out of erratically accessed objects? (Choose two.)

A.increasing PGA size

B.increasing large pool size

C.increasing buffer cache size

D.creating RECYCLE cache using the DB_RECYCLE_CACHE_SIZE parameter

E.creating a KEEP cache using the DB_KEEP_CACHE_SIZE parameter and altering the objects to that cache Answer: CE

10. Which two statements are correct regarding users in a shared server environment? (Choose two.)

A.Connections can share dispatcher processes.

B.Multiplexing and pooling can be used for user connections.

C.It is advantageous for sessions performing batch operations.

D.The CPU overhead is reduced for each individual user request.

E.Multiple users cannot share the dispatcher processes to access the Oracle server.

Answer: AB

11. ABC Corp. plans to build an online transaction processing (OLTP) system. The company plans to tune all the components during the development life cycle.

From the list given below, identify the order in which the components should be tuned.

A.1, 2, 3, 5, 4

B.1, 3, 2, 4, 5

C.1, 2, 3, 4, 5

D.1, 2, 5, 3, 4

Answer: A

12. ABC Corp. has an online transaction processing (OLTP) system that has just gone into production. The system was rigorously tested during the development phases.

What is the first recommended activity that the DBA should perform before starting to monitor the performance of the system on a regular basis?

A.running SQL*Trace

B.collecting baseline statistics

C.analyzing indexes and user tables

D.arranging meetings with users once each two weeks to discuss performance

Answer: B

13. When tuning a database server, which three goals should you focus on? (Choose three.)

A.minimize response time for OLTP users

B.maximize throughput for batch processing

C.minimize response time for batch processing

D.increase load capability for the decision-support systems

E.minimize parallelism for online transaction processing (OLTP) systems

Answer: ABD

14. Smith is a DBA with ABC Corp. He is in the process of tuning the database. He has received various problem statements from the customers. Identify three appropriately defined problem statements that Smith can use to tune the database correctly. (Choose three.)

A.The system is too slow.

B.Online response is very slow.

C.Sometimes the batch process throws errors.

D.The weekly backup took 30 minutes, and earlier it used to take 5 minutes.

E.The batch process is taking 2 hours, whereas it should take only 30 minutes.

F.The system currently has 100 users. We wish to increase the number of users to 250. The users' response time should not be affected.

Answer: DEF

15. Smith is a DBA with XYZ Corp. There are 500 data entry users in an online transaction processing (OLTP) environment. The current response time is 15-20 seconds. The company wants the response time to be brought down to 10 seconds or less.

What is the first thing that Smith should do to diagnose the cause of the slow response time?

A.determine whether there is contention for locks

B.determine whether the file system is fast enough

C.determine whether more memory needs to be allocated to PGA

D.determine whether more memory needs to be allocated to SGA

E.determine whether the slow response is wait bound or CPU bound

Answer: E

16. Which two activities would adversely affect database performance? (Choose two.)

A.doing a soft parse

B.performing archiving

C.less frequent checkpointing

D.defining multiple buffer pools

E.taking online back up of data files

Answer: BE

17. The following are the tasks that you need to perform to create a resource plan:

In which order would you perform these tasks?

A.C, D, A, E, B, F

B.C, B, F, E, A, D

C.C, B, E, D, A, F

D.C, F, E, A, D, B

Answer: A

18. You want SMITH to create database resource plans using database resource manager. To enable this, you

decide to grant the ADMINISTER_RESOURCE_MANAGER privilege to SMITH. Which statement regarding this privilege is true?

A.This privilege cannot be granted to a role.

B.This privilege is granted through the SQL GRANT command.

C.This privilege is granted through the dbms_resource_manager package.

D.This privilege cannot be granted to SMITH; only SYS can have this privilege.

E.This privilege is granted through the dbms_resource_manager_privs package.

Answer: E

19. View the Exhibit and examine the steps to create a database resource plan.

Execution of the following procedure resulted in an error:

What could be the reason for this?

A.The ADMINISTER_RESOURCE_MANAGER privilege is not granted to the user.

B.The procedure should be executed before creating the resource plan directive.

C.The SYS_GROUP resource consumer group is not included in the resource plan directive.

D.The OTHER_GROUPS resource consumer group is not included in the resource plan directive.

Answer: D

20. Which three factors can be controlled by the use of the Database resource manager? (Choose three.)

A.undo quota for a group of sessions

B.the password history for a group of sessions

C.the number of transactions by a group of sessions

D.the number of active sessions within a specific group of sessions

E.the maximum estimated execution time for an operation in a specific group of sessions Answer: ADE

Oracle测试题

一、选择题(40分) 1.Oracle发出下列select语句: SQL> select , , 2 from emp e, dept d 3 where = 4 and substr, 1, 1) = ‘S’; 下列哪个语句是Oracle数据库中可用的ANSI兼容等价语句 A.select empno, ename, loc from emp join dept on = where substr, 1, 1) = ‘S’; B.select empno, ename, loc from emp, dept on = where substr, 1, 1) = ‘S’; C.select empno, ename, loc from emp join dept where = and substr, 1, 1) = ‘S’; D.select empno, ename, loc from emp left join dept on = and substr, 1, 1) = ‘S’; 2.下列哪个选项表示Oracle中select语句的功能 A.可以用select语句改变Oracle中的数据 B.可以用select语句删除Oracle 中的数据 C.可以用select语句和另一个表的内容生成一个表 D.可以用select语句对表截断 3.你要操纵Oracle数据,下列哪个不是SQL命令 A.select * from dual; B.set define C.update emp set ename = 6543 where ename = ‘SMITHERS’; D.create table employees(empid varchar2(10) primary key); 4.你要在Oracle中定义SQL查询。下列哪个数据库对象不能直接从select语句中引用

ORACLE试题

ORACLE 选择 B52X0001ORACLE7数据库中,命令lsnrctl start用到的参数文件是:() A、tnsnames.ora B、sqlnet.ora C、listener.ora D、以上都不对 正确答案:C B52X0002在将格式化的文本文件导入ORACLE时我们经常采用的是SQLLOAD命令,请选择正确的写法() A、sqlldr username/password control=data_file B、sqlldr username/password rows=128control=data_file C、sqlldr username/password control=data_file rows=64 D、sqlldr username/password control=data_file.ctl 正确答案:D B52X0003在Oracle维护过程中,第一步应查看数据库管理系统的运行日志,其日值文件名为:() A、error_'SID'.log B、Alert_'SID'.log C、trace_'SID'.log E、logtail_'SID'.log 正确答案:B B52X0004SGA(System Global Area)是ORACLE系统为实例分配的一组共享缓冲存储区,SGA分为几个部分。() A、4 B、5 C、6 D、7 正确答案:A库缓冲区、数据字典缓冲区、数据块高速缓冲区、重做日志缓冲区 B52X0005Oracle逻辑结构可分解为:表空间、数据库块、物理块、分类段、范围。它们之间的大小关系正确的是() A、表空间≥范围≥分类段≥数据库块≥物理块 B、表空间≥范围≥分类段≥物理块≥数据库块 C、表空间≥数据库块≥物理块≥分类段≥范围 D、表空间≥分类段≥范围≥数据库块≥物理块 正确答案:D B52X0006ORACLE中模式为模式对象的集合,为一个数据库用户所占有,模式名为与该用户名同名,下列属于模式对象的有() A、表 B、视图 C、快照 D、用户环境文件

中南大学oracle数据库期末考试试题及答案

A1、以下()内存区不属于SGA。 A.PGA B.日志缓冲区C.数据缓冲区D.共享池 D2、()模式存储数据库中数据字典的表和视图。 A.DBA B.SCOTT C.SYSTEM D.SYS C3、在Oracle中创建用户时,若未提及DEFAULT TABLESPACE 关键字,则Oracle就将()表空间分配给用户作为默认表空间。 A.HR B.SCOTT C.SYSTEM D.SYS A4、()服务监听并按受来自客户端应用程序的连接请求。 A.OracleHOME_NAMETNSListener B.OracleServiceSID C.OracleHOME_NAMEAgent D.OracleHOME_NAMEHTTPServer B5、()函数通常用来计算累计排名、移动平均数和报表聚合等。 A.汇总B.分析C.分组D.单行 B6、()SQL语句将为计算列SAL*12生成别名Annual Salary A.SELECT ename,sal*12 …Annual Salary? FROM emp; B.SELECT ename,sal*12 “Annual Salary” FROM emp; C.SELECT ename,sal*12 AS Annual Salary FROM emp; D.SELECT ename,sal*12 AS INITCAP(“Annual Salary”) FROM emp; B7、锁用于提供( )。 A.改进的性能

B.数据的完整性和一致性 C.可用性和易于维护 D.用户安全 C8、( )锁用于锁定表,允许其他用户查询表中的行和锁定表,但不允许插入、更新和删除行。 A.行共享B.行排他C.共享D.排他 B9、带有( )子句的SELECT语句可以在表的一行或多行上放置排他锁。 A.FOR INSERT B.FOR UPDATE C.FOR DELETE D.FOR REFRESH C10、使用( )命令可以在已分区表的第一个分区之前添加新分区。 A.添加分区B.截断分区 C.拆分分区D.不能在第一个分区前添加分区 C11、( )分区允许用户明确地控制无序行到分区的映射。 A.散列B.范围C.列表D.复合 C12、可以使用()伪列来访问序列。 A.CURRVAL和NEXTVAL B.NEXTVAL和PREVAL C.CACHE和NOCACHE D.MAXVALUE和MINVALUE A13、带有错误的视图可使用()选项来创建。 A.FORCE B.WITH CHECK OPTION C.CREATE VIEW WITH ERROR

oracle数据库试题

ORACLE数据库试题 74 姓名:戴希引 一、选择题(总分50分,每题1分,*为多选)42 1.下列不属于ORACLE的逻辑结构的是(C) A 区 B 段 C 数据文件 D表空间 2. 下面哪个用户不是ORACLE缺省安装后就存在的用户( A ) A . SYSDBA B. SYSTEM C. SCOTT D. SYS 3 下面哪个操作会导致用户连接到ORACLE数据库,但不能创建表(A ) A 授予了CONNECT的角色,但没有授予RESOURCE的角色 B没有授予用户系统管理员的角色 C数据库实例没有启动 D数据库监听没有启动 4. 在Oracle中,当FETCH语句从游标获得数据时,下面叙述正确的是( C ) A 游标打开 B游标关闭 C当前记录的数据加载到变量中 D创建变量保存当前记录的数据 5. 在Oracle中,下面关于函数描述正确的是( A D)* A SYSDATE函数返回Oracle服务器的日期和时间 B ROUND数字函数按四舍五入原则返回指定十进制数最靠近的整数 C ADD_MONTHS日期函数返回指定两个月份天数的和 D SUBSTR函数从字符串指定的位置返回指定长度的子串 6. 阅读下面的PL/SQL程序块: BEGIN INSERT INTO employee(salary,last_name,first_name)VALUES(35000,’Wang’,'Fre d ’); SAVEPOINT save_a; INSERT INTO employee(salary,last_name,first_name) VALUES(40000,’Woo’,'David’); SAVEPOINT save_b; DELETE FROM employee WHERE dept_no=10; SAVEPOINT save_c; INSERT INTO employee(salary,last_name,first_name) VALUES(25000,’Lee’,'Bert’); ROLLBACK TO SAVEPOINT save_c;

Oracle数据库简答题-考试重点

1.简单描述Oracle数据库体系结构的组成及其关系? 答:Oracle数据库体系结构由物理存储结构、逻辑存储结构和实例组成。其中物理存储结构描述了操作系统层次数据的存储与管理,包括数据文件、日志文件、重做日志文件等组成。逻辑结构描述了数据库内部数据的组织与管理,由表空间、段、区、块组成。实例是数据库运行的软件结构,由内存结构和后台进程组成。数据库运行过程中,用户的操作在内存区中进行,最终通过后台进行转化为对数据库的操作。 2、说明Oracle数据库物理存储结构的组成? Oracle数据库物理结构包括数据文件、控制文件、重做日志文件、初始化参数文件、归档文件、口令文件等。在控制文件中记录了当前数据库所有的数据文件的名称与位置、重做日志文件的名称与位置,以及数据文件、重做日志文件的状态等。 3、说明Oracle数据库数据文件的作用? 数据文件中保存了数据库中的所有数据,包括数据字典以及用户数据。 4、说明Oracle数据库控制文件的作用? 控制文件保存数据库的物理结构信息,包括数据库名称、数据文件的名称与状态、重做日志文件的名称与状态等。在数据库启动时,数据库实例依赖初始化参数定位控制文件,然后根据控制文件的信息加载数据文件和重做日志文件,最后打开数据文件和重做日志文件。 5、说明Oracle数据库重做日志文件的作用? 重做日志文件是以重做记录的形式记录、保存用户对数据库所进行的修改操作,包括用户执行DDL、DML语句的操作。如果用户只对数据库进行查询操作,那么查询信息是不会记录到重做日志文件中的。 6、说明数据库逻辑存储结构的组成和相互关系。 Oracle9i数据库的逻辑存储结构分为数据块、区、段和表空间四种。其中,数据块是数据库中的最小I/O单元,由若干个连续的数据块组成的区是数据库中最小的存储分配单元,由若干个区形成的段是相同类型数据的存储分配区域,由若干个段形成的表空间是最大的逻辑存储单元,所有的表空间构成一个数据库。 7、说明数据库表空间的种类,以及不同类型表空间的作用。 数据库表空间分为系统表空间和非系统表空间两类,其中非系统表空间包括撤销表空间、临时表空间和用户表空间等。 SYSTEM表空间主要用于存储数据库的数据字典、PL/SQL程序的源代码和解释代码、数据库对象的定义。撤销表空间专门进行回退信息的自动管理。临时表空间是专门进行临时段管理的表空间。用户表空间用于分离不同应用的数据,而且能够减少读取数据文件时产生的I/O冲突。 8、说明数据库、表空间、数据文件以及数据库对象之间的关系。 一个数据库由一个或多个表空间构成,不同的表空间用于存放不同应用的数

Oracle数据库试题及答案

Oracle数据库试题 一、选择题 1、段是表空间中一种逻辑存储结构,以下( D )不是ORACLE数据库使用的段类型。(A)索引段(B)临时段(C)回滚段(D)代码段 2、 ORACLE数据库物理结构包括以下三种文件,以下不属于的是( A )。 ?(A)系统文件(B)日志文件(C)数据文件(D)控制文件 3、数据库中有两个用户scott和muuser,物资表wz是属于myuser用户的,但当前用户是scott,要求查询物资表wz(wno,wname,wtype,wunit)物资单位wunit列为null的记录,取结果的前5条记录显示,以下正确的SQL语句是( C ) (A)select*from scott.wz where wunit is null and rownum<5; (B)select*from myuser.wz where wunit = null and rownum<5; (C) select*from myuser.wz where wunit is null and rownum<6; (D)select*form scott.wz where wunit is null and rownum<6; ?4、若当前日期为’25-5月-06’,以下( D? )表达式能计算出5个月后那一天所在月份的最后一天的日期。 (A)NEXT_DAY(ADD_MONTHS(28-5月-06,5)) (B)NEXT_DAY(MONTHS_BETWEEN(28-5月-06,5)) (C)NEXT_DAY(MONTHS_BETWEEN(’28-5月-06’,5)) (D)NEXT_DAY(ADD_MONTHS(’28-5月-06’,5)) 5、下列叙述中正确的是_C_。 A、数据库是一个独立的系统,不需要操作系统的支持 B、数据库设计是指设计数据库管理系统 C、数据库技术的根本目标是要解决数据共享的问题 D、数据库系统中,数据的物理结构必须与逻辑结构一致 6、SQL语句中修改表结构的命令是 ???C?? ?。 A、MODIFY TABLE B、MODIFY STRUCTURE C、ALTER TABLE D、ALTER STRUCTURE 7、数据库DB、数据库系统DBS、数据库管理系统DBMS三者之间的关系是__ A___。 A、DBS包括DB和DBMS B、DBMS包括DB和DBS C、DB包括DBS和DBMS D、DBS就是DB,也就是DBMS 8、要控制两个表中数据的完整性和一致性可以设置"参照完整性",要求这两个表_A___。 A、是同一个数据库中的两个表 B、不同数据库中的两个表 C、两个自由表 D、一个是数据库表另一个是自由表 9、在关系模型中,实现"关系中不允许出现相同的元组"的约束是通过__B_ __。 A、候选键 B、主键 C、外键 D、超键 10、索引字段值不唯一,应该选择的索引类型为___ B__。 A、主索引 B、普通索引 C、候选索引 D、唯一索引 11、从数据库中删除表的命令是___C __。 A、DROP TABLE B、ALTER TABLE C、DELETE TABLE D、USE 12、 DELETE FROM S WHERE 年龄>60语句的功能是___B___。 A、从S表中彻底删除年龄大于60岁的记录 B、S表中年龄大于60岁的记录被加上删除标记

ORACLE数据库期末考试题目及答案

期末考试卷(卷) 课程名称:数据库考试方式:开卷()闭卷(√) 、本试卷共4 页,请查看试卷中是否有缺页。 2、考试结束后,考生不得将试卷、答题纸带出考场。 1、以下(a )内存区不属于SGA。 A.PGA B.日志缓冲区 C.数据缓冲区 D.共享池 2、d )模式存储数据库中数据字典的表和视图。 (A.DBA B.SCOTT C.SYSTEM D.SYS 3、Oracle 中创建用户时,在若未提及DEFAULT TABLESPACE 关键字,Oracle 就将 c )则(表空间分配给用户作为默认表空间。A.HR B.SCOTT C.SYSTEM D.SYS

4、a )服务监听并按受来自客户端应用程序的连接请求。(A.OracleHOME_NAMETNSListener B.OracleServiceSID C.OracleHOME_NAMEAgent D.OracleHOME_NAMEHTTPServer 5、b )函数通常用来计算累计排名、移动平均数和报表聚合等。(A.汇总B.分析C.分组D.单行 6、b)SQL 语句将为计算列SAL*12 生成别名Annual Salary (A.SELECT ename,sal*12 …Annual Salary? FROM emp; B.SELECT ename,sal*12 “Annual Salary” FROM emp; C.SELECT ename,sal*12 AS Annual Salary FROM emp; D.SELECT ename,sal*12 AS INITCAP(“Annual Salary”) FROM emp; 7、锁用于提供(b )。 A.改进的性能 B.数据的完整性和一致性 C.可用性和易于维护 D.用户安全 8、( c )锁用于锁定表,允许其他用户查询表中的行和锁定表,但不允许插入、更新和删除行。 A.行共享B.行排他C.共享D.排他 9、带有( b )子句的SELECT 语句可以在表的一行或多行上放置排他锁。 A.FOR INSERT B.FOR UPDATE C.FOR DELETE D.FOR REFRESH

oracle考试试题及答案

试题一 一、填空题(每小题4分,共20分) 1、数据库管理技术经历了人工管理、文件系统、数据库系统三个阶段 2、数据库三级数据结构是外模式、模式、内模式 3、Oracle数据库中,SGA由数据库缓冲区,重做日志缓冲区,共享池组成 4、在Oracle数据库中,完正性约束类型有Primay key约束。Foreign key约束,Unique约束,check约束,not need约束 5、PL/SQL中游标操作包括声明游标,打开游标,提取游标,关闭游标 二、正误判断题(每小题2分,共20分) 1、数据库中存储的基本对象是数据(T) 2、数据库系统的核心是DBMS(T) 3、关系操作的特点是集合操作(T) 4、关系代数中五种基本运算是并、差、选择、投影、连接(F) 5、Oracle进程就是服务器进程(F) 6、oraclet系统中SGA所有用户进程和服务器进程所共享(T) 7、oracle数据库系统中数据块的大小与操作系统有关(T) 8、oracle数据库系统中,启动数据库和第一步是启动一个数据库实例(T) 9、PL/SQL中游标的数据是可以改变的(F) 10、数据库概念模型主要用于数据库概念结构设计() 三、简答题(每小题7分,共35分) 1、何谓数据与程序的逻辑独立性和物理独立性? 2、试述关系代数中等值连接与自然连接的区别与联系? 3、何谓数据库,数据库设计一般分为哪些阶段? 4、简述Oracle逻辑数据库的组成?

5、试任举一例说明游标的使用方法? 五、设有雇员表emp(empno,ename,age,sal,tel,deptno), 其中:empno-----编号,name------姓名,age -------年齡,sal-----工资,tel-----电话 deptno-----部门号。 请按下列要求分别晨SQL*PLUS下编程。(每小题3分,共15分)?1、查询家有电话的职工信息。 ?2、查询工资在500至800元之间的雇员信息 ?3、按年龄递增顺序显示雇员编号、姓名、年龄、工资 ?4、求部门号为D_01的平均工资 ?5、查找部门号为D_01的40岁以上而工资在400元以下的雇员名单。 1、SQL>SELECT * FROM emp WHERE tel NOT NULL; 2、SQL>SELECT * FROM emp WHERE BETWEEN 500 AND 800; 3、SQL>SELECT empno,ename,age,sal FROM emp ORDER BY age ASC; 4、SQL>SELECT AVG(sal) FROM emp WHERE deptno='D_01'; 5、SQL>SELECT ename FROM emp WHERE deptno='D_01' AND age>40 AND Sal<400; ? 试题一答案 一、填空题 1、人工管理、文件系统、数据库系统 2、外模式、模式、内模式 3、数据库缓冲区,重做日志缓冲区,共享池 4、Primay key约束。Foreign key约束,Unique约束,check约束,not need 约束 5、声明游标,打开游标,提取游标,关闭游标 二、正误判断题 1、T 2、T 3、T 4、F 5、F 6、T 7、T 8、T 9、F 三、(略) 五、 1、SQL>SELECT * FROM emp WHERE tel NOT NULL; 2、SQL>SELECT * FROM emp WHERE BETWEEN 500 AND 800; 3、SQL>SELECT empno,ename,age,sal FROM emp ORDER BY age ASC; 4、SQL>SELECT AVG(sal) FROM emp WHERE deptno='D_01'; 5、SQL>SELECT ename FROM emp WHERE deptno='D_01' AND age>40 AND Sal<400; 试题二

Oracle数据库试题

constraint pk_spj primary key (sno,pno,jno), constraint fk_spj_sno foreign key (sno) references s(sno), constraint fk_spj_pno foreign key (pno) references p(pno), constraint fk_spj_jno foreign key (jno) references j(jno) 实验二游标和函数 1、定义一个游标完成显示所有供应商名。 declare v_sname s.sname%type; cursor cursor_sname is select sname from s; begin for curso in cursor_sname loop dbms_output.put_line(curso.sname); end loop; end; 2、定义、调用一个简单函数:查询返回指定供应商编号的供应商名及其供应零件总数量。create or replace function fun(f_sno in s.sno%type,f_sname out s.sname%type) return number as f_qty number; begin SELECT s.sname,sum(qty) into f_sname,f_qty from s,spj WHERE s.sno=spj.sno GROUP BY s.sname,spj.sno having spj.sno=f_sno; return f_qty; end; declare v_sno s.sno%type:='&sno'; v_sname s.sname%type; v_qty spj.qty%type; begin v_qty:=fun(v_sno,v_sname); dbms_output.put_line(v_sname||v_qty); end; 3、定义一个函数:对于给定的供应商号,判断是否存在,若存在返回0,否则返回-1。写一段程序调用此函数,若供应商号存在则在spj插入一元组。

几个Oracle的笔试题

Oracle笔试试题 1. SQL必备 <选择题每空 1 分共 14题> 1. 如果在where子句中有两个条件要同时满足,应该用以下哪个逻辑符来连接 ( ) A.OR B.NOT C.AND D.NONE 2. 外连接的条件可以放在以下的那一个子句中( ) A.FROM B.WEHRE C.SELECT D.HAVING E.GROUP BY F.ORDER BY 3. 在从两个表中查询数据时,连接条件要放在哪个子句中( ) A.FROM B.WHERE C.SELECT D.HAVING E.GROUP BY 4. 用以下哪个子句来限制分组统计结果信息的显示( ) A.FROM B.WEHRE C.SELECT D.HAVING E.GROUP BY F.ORDER BY 5. 以下需求中哪个需要用分组函数来实现( ) A.把ORDER表中的定单时间显示成 'DD MON YYYY' 格式 B.把字符串 'JANUARY 28, 2000' 转换成日期格式 C.显示PRODUCT 表中的COST 列值总量 D.把PRODUCT表中的DESCRIPTION列用小写形式显示 6. 以下那些命令可以暗含提交操作( )

A.GRANT B.UPDATE C.SELECT D.ROLLBACK 7.RDBMS是下列哪一项的缩写( ) A. Relational DataBase Management System(关系数据库管理系统) B. Relational DataBase Migration System(关系数据库移植系统) C. Relational Data Migration System(关系数据移植系统) D. Relational DataBase Manage System(关系数据库管理系统) 8.INSERT 是( ) A. DML语句 B. DDL语句 C. DCL语句 D. DTL语句 9.SELECT CHR(66) FROM DUAL的结果是( ) A. Z B. S C. B D. 都不是 10.函数返回一个值除以另一个值后的余数( ) A. MOD B. ABS C. CEIL D. 以上都不是 11. 什么锁用于锁定表,仅允许其他用户查询表中的行,行不允许插入,更新, 或删除行( ) A. 共享 B. 排他 C. 共享更新 D. 以上都不是 12.什么是oracle提供的一个对象,可以生成唯一的连续的整数( ) A. 同义词 B. 序列 C. 视图 D. 没有 13. 那种类型的约束可以自动创建索引( ) A.CHECK B.UNIQUE

Oracle-选择题题库

Oracle 选择题题库 1.以下命令哪个是 SQL*PLUS 命令?() A.UPDATE B.EDIT C.SELECT D.ALTER TABLE 2.用SQL*PLUS的_____命令可以查看表的结构信息,包括列的名称和数据类型 A.DESCRIPTION B.DESC C.SHOW TABLE D.SHOW USER 3.Oracle的前端工具是() A.SQL*PLUS B.C++ C.PL/SQL D.JAVA 4.在SQL*PLUS中,如何运行SQL脚本程序( ) A./ B.@脚本C.EXE 脚本D.不能在SQL*PLUS中直接运行脚本5.用命令将SQL*PLUS缓冲区中的内容保存到文件中,使用下列哪种方法( ) A.将缓冲区的内容Ctrl+C,然后再Ctrl+V到文件中即可 B.使用SAVE命令参数是文件路径 C.WRITE 方式,参数是文件路径 D.Oracle会自动保存 6.用来设置一行能够显示的字符长度的命令是( ) A.SET LINESIZE B.SET LINE C.SET LINEBUFFER D.SET SIZELINE 7.以下哪个命令用来设置查询显示结果的列宽 A.SET COLUMN SIZE B.COLUMN 列 FORMAT 长度 C.COLUMN 列长度D.长度 OF COLUMN 8.ORACLE用来判断列值是否为空的操作符是____ A.= NULL B.IS NULL C.AS NULL D.NULL IS 9.在客户定单表(CUSTOMER)中有一列为单价(PRICE),写一个SELECT命令显示所有单价 在500以上的查询语句。 A SELECT * FROM CUSTOMER WHERE PRICE>500; B SELECT * FROM CUSTOMER WHERE PRICE BETWEEN 500 AND *; C SELECT * FROM CUSTOMER WHERE PRICE LIKE '%500%'; D SELECT * FROM CUSTOMER WHER E PRICE>=500; 10.分析以下SQL 命令: SELECT price FROM inventory WHERE price BETWEEN 1 AND 50 AND (price IN(55, 30, 95); 命令执行后的输出结果是:() A 55 B 30 C 95 D NULL 11.分析以下的SQL 命令: SELECT manufacturer_id FROM inventory WHERE manufacturer_id LIKE '%N\%P\%O%' ESCAPE '\'; 命令执行的返回结果是() A 所有包含'NPO'的纪录 B 所有包含'N\P\O'的纪录 C 所有包含'N%P%O'的纪录

ORACLE数据库习题(有答案)

--1.列出至少有一个雇员的所有部门。 SELECT * FROM DEPT WHERE DEPTNO IN (SELECT DISTINCT DEPTNO FROM EMP); --2.列出薪金比“SMITH”多的所有雇员。 SELECT * FROM EMP WHERE SAL>(SELECT SAL FROM EMP WHERE ENAME='SMITH'); --3.列出所有雇员的姓名及其上级的姓名。 SELECT AS empName, AS mgrName FROM emp ygb,emp sjb WHERE =; --4.列出入职日期早于其直接上级的所有雇员。 SELECT * FROM emp ygb WHERE hiredate<(SELECT hiredate FROM emp sjb WHERE =; --5.列出所有部门的名称和这些部门的雇员编号及姓名(没有雇员的部门包含在内) SELECT dname,ename FROM dept a LEFT JOIN emp b ON =; --6.列出所有JOB 为“CLERK”(办事员)的员工姓名及其部门名称 SELECT ename,dname FROM dept a,emp b WHERE = AND job='CLERK'; --7.列出各种类型的最低薪金,并使最低薪金大于。 SELECT job,MIN(sal) FROM emp GROUP BY job HAVING MIN(sal)>1500; --8.列出从事“SALES”(销售)工作的雇员的姓名,假定不知道销售部的部门编号。 SELECT ename FROM emp WHERE deptno=(SELECT deptno FROM dept WHERE dname='SALES'); --9.列出薪金高于公司平均水平的所有雇员。 SELECT * FROM EMP WHERE SAL>(SELECT AVG(SAL) FROM EMP); --10.列出与“SCOTT”从事相同工作的所有雇员。 SELECT * FROM EMP WHERE JOB=(SELECT JOB FROM EMP WHERE ENAME='SCOTT') AND ENAME<>'SCOTT'; --11.列出薪金等于部门中任何一个雇员薪金的员工姓名和 薪金 SELECT ENAME,SAL FROM EMP WHERE SAL IN(SELECT SAL FROM EMP WHERE DEPTNO=30); SELECT ENAME,SAL FROM EMP WHERE SAL =ANY(SELECT SAL FROM EMP WHERE DEPTNO=30); --12.列出薪金高于部门中所有雇员薪金的员工姓名和薪金SELECT * FROM EMP WHERE SAL >ALL(SELECT SAL FROM EMP WHERE DEPTNO=30); --13.列出所有部门的部门名称、地点以及该部门中雇员的数量 SELECT DNAME,DEPTNO,LOC, (SELECT COUNT(*) FROM EMP E WHERE = AS TOTAL FROM DEPT; --14.列出各种类别工作的最低工资 SELECT job,MIN(sal) FROM emp GROUP BY job; --15.列出各个部门的MANAGER(经理)的最低薪金。 SELECT MIN(sal) FROM emp WHERE job='MANAGER' GROUP BY DEPTNO; --1. 查询所有部门员工的编号、姓名、月薪及奖金。 select empno,ename,sal,comm from emp where deptno=10; --2. 查询员工WHITE的员工编号。 select empno from emp where ename='WHITE'; --3. 查询所有员工的编号及收入。(提示:收入=月薪+奖金)select empno 编号,sal+nvl(comm,0) as 收入from emp; --4. 查询所有员工的编号、姓名、工种及其工龄,按工龄降序排序,工龄相同时按编号升序排序。 Select empno,ename,job,trunc(months_between(sysdate,hiredate)/12) 工龄from emp order by 工龄desc,empno asc; --5. 统计各部门的员工人数及工种类型数。 select deptno,count(*) 人数,count(distinct job) 工种类型数from emp group by deptno; --6. 查询部门人数多于人的部门编号。 select deptno,count(*) from emp group by deptno having count(*) > 3; --7. 统计各部门各种工作类别的最低月薪,显示最低薪金大于的记录。 select deptno,job,min(sal) from emp group by deptno,job having min(sal)>1500; --8. 统计、及部门员工平均工资。 select deptno,coung(*) from emp where deptno in (10,20,30) group by deptno; --9. 查询工资水平在至间的各部门员工人数。 select deptno,count(*) from emp where sal between 2000 and 5000 group by deptno; --10. 查询公司最高领导人的员工编号及姓名。 select empno,ename from emp where mgr is null; --1、编写一查询,显示与Blake在同一部门工作的雇员的姓名和受雇日期,但是Blake不包含在结果内。 select ename,hiredate from emp where deptno in (select deptno from emp where lower(ename)='black') and lower(ename)!='black'; --2、创建一查询,显示工资大于平均工资水平的雇员的编号及姓名,输出结果按工资降序排列。 select empno,ename,sal from emp where sal>(select avg(sal) from emp) order by sal desc; --3、显示位置在Dallas的部门内的雇员的姓名、编号及工作。 select ename,empno,job from emp inner join dept on = where lower(loc)='dallas'; --4、显示被King直接管理的雇员的姓名及其工资。 select , from emp e1 inner join emp e2 on = where lower='king'; --5、显示在Sales部门工作的雇员的部门编号、姓名及工作。 select empno,ename,job from emp inner join dept on = where lower(dname)='sales'; --6、编写一查询,显示与能获得奖金的雇员的奖金和工资同时匹配的雇员的编号和工资。 select ,, from emp e1 inner join emp e2 on = and = where !=; --7、显示与工作在Dallas的雇员的工资及奖金同时匹配的雇员的姓名、部门名称及工资。 select ,, from emp e inner join dept d on = where (sal,nvl(comm,0)) in (select sal,nvl(comm,0) from emp where deptno in (select deptno from dept where lower(loc)='dallas') ); --8、创建一查询,显示能获得与Scott一样工资和奖金的其他雇员的姓名、受雇日期及工资。 select ename,hiredate,sal from emp where (sal,nvl(comm,0)) in

oracle数据库期末考试试题及复习资料

oracle数据库期末考试试题及答案 A1、以下()内存区不属于SGA。 A.PGA B.日志缓冲区C.数据缓冲区D.共享池 D2、()模式存储数据库中数据字典的表和视图。 A.DBA B.SCOTT C.SYSTEM D.SYS C3、在Oracle中创建用户时,若未提及DEFAULT TABLESPACE 关键字,则Oracle就将()表空间分配给用户作为默认表空间。A.HR B.SCOTT C.SYSTEM D.SYS A4、()服务监听并按受来自客户端应用程序的连接请求。A.OracleHOME_NAMETNSListener B.OracleServiceSID C.OracleHOME_NAMEAgent D.OracleHOME_NAMEHTTPServer B5、()函数通常用来计算累计排名、移动平均数和报表聚合等。A.汇总B.分析C.分组D.单行 B6、()SQL语句将为计算列SAL*12生成别名Annual Salary A.SELECT ename,sal*12 ‘Annual Salary' FROM emp; B.SELECT ename,sal*12 “Annual Salary”FROM emp; C.SELECT ename,sal*12 AS Annual Salary FROM emp; D.SELECT ename,sal*12 AS INITCAP(“Annual Salary”) FROM

12 / 1 emp; B7、锁用于提供( )。 A.改进的性能 B.数据的完整性和一致性 C.可用性和易于维护 D.用户安全 C8、( )锁用于锁定表,允许其他用户查询表中的行和锁定表,但不允许插入、更新和删除行。 A.行共享B.行排他C.共享D.排他 B9、带有( )子句的SELECT语句可以在表的一行或多行上放置排他锁。 A.FOR INSERT B.FOR UPDATE C.FOR DELETE D.FOR REFRESH C10、使用( )命令可以在已分区表的第一个分区之前添加新分区。A.添加分区B.截断分区 C.拆分分区D.不能在第一个分区前添加分区 C11、( )分区允许用户明确地控制无序行到分区的映射。 A.散列B.范围C.列表D.复合 C12、可以使用()伪列来访问序列。 A.CURRVAL和NEXTVAL B.NEXTVAL和PREVAL C.CACHE和NOCACHE D.MAXVALUE和MINVALUE

Oracle必背选择题

1.( )触发器允许触发操作的语句访问行的列值。(选一项) A、行级 B、语句级 C、模式 D、数据库级 2.( )是oracle在启动期间用来标识物理文件和数据文件的二进制文件。(选一项) A、控制文件 B、参数文件 C、数据文件 D、可执行文件 3.CREATE TABLE 语句用来创建(选一项) A、表 B、视图 C、用户 D、函数 4.imp命令的哪个参数用于确定是否要倒入整个导出文件。(选一项) A、constranints B、tables C、full D、file 5.ORACLE表达式NVL(phone,'0000-0000')的含义是(选一项) A、当phone为字符串0000-0000时显示空值 B、当phone为空值时显示0000-0000 C、判断phone和字符串0000-0000是否相等 D、将phone的全部内容替换为0000-0000 6.ORACLE交集运算符是(选一项) A、intersect B、union C、set D、minus 7.ORACLE使用哪个系统参数设置日期的格式(选一项) A、nls_language B、nls_date C、nls_time_zone D、nls_date_format 8.Oracle数据库中,通过()访问能够以最快的方式访问表中的一行(选一项) A、主键

B、Rowid C、唯一索引 D、整表扫描 9.Oracle数据库中,下面()可以作为有效的列名。(选一项) A、Column B、123_NUM C、NUM_#123 D、#NUM123 10.Oracle数据库中,以下()命令可以删除整个表中的数据,并且无法回滚(选一项) A、drop B、delete C、truncate D、cascade 11.Oracle中, ( )函数将char或varchar数据类型转换为date数据类型。(选一项) A、date B、to_date C、todate D、ctodate 12.ORACLE中,执行语句:SELECT address1||','||address2||','||address2 "Address" FROM employ; 将会返回()列(选一项) A、0 B、1 C、2 D、3 13.Oralce数据库中,以下()函数可以针对任意数据类型进行操作。(选一项) A、TO_CHAR B、LOWER C、MAX D、CEIL 14.partition by list(msn_id)子句的含义是(选一项) A、按msn_id列进行范围分区 B、按msn_id列进行列表分区 C、按msn_id列进行复合分区 D、按msn_id列进行散列分区 15.比较pagesize和linesize两个命令的特点,正确的是(选两项) A、pagesize命令用于设置屏幕上每一页包含的行数 B、linesize命令用于设置屏幕上每一行的字符数

Oracle数据库试题及答案word版本

O r a c l e数据库试题及 答案

Oracle数据库试题 一、选择题 1、段是表空间中一种逻辑存储结构,以下( D )不是ORACLE数据库使用的段类型。 (A)索引段(B)临时段(C)回滚段(D)代码段 2、 ORACLE数据库物理结构包括以下三种文件,以下不属于的是( A )。(A)系统文件(B)日志文件(C)数据文件(D)控制文件 3、数据库中有两个用户scott和muuser,物资表wz是属于myuser用户的,但当前用户是scott,要求查询物资表wz(wno,wname,wtype,wunit)物资单位wunit列为null的记录,取结果的前5条记录显示,以下正确的SQL语句是( C ) (A)select*from scott.wz where wunit is null and rownum<5; (B)select*from myuser.wz where wunit = null and rownum<5; (C) select*from myuser.wz where wunit is null and rownum<6; (D)select*form scott.wz where wunit is null and rownum<6; 4、若当前日期为’25-5月-06’,以下( D )表达式能计算出5个月后那一天所在月份的最后一天的日期。 (A)NEXT_DAY(ADD_MONTHS(28-5月-06,5)) (B)NEXT_DAY(MONTHS_BETWEEN(28-5月-06,5)) (C)NEXT_DAY(MONTHS_BETWEEN(’28-5月-06’,5)) (D)NEXT_DAY(ADD_MONTHS(’28-5月-06’,5))

相关文档