OCP考试真题007SQL

合集下载

ocp认证考试题库

ocp认证考试题库

ocp认证考试题库
OCP模拟试题(数据库方向)
1. 选择题
关于Oracle数据库中的数据文件(datafiles),以下哪项说法是正确的?
A. 数据文件只能存储在一个表空间中。

B. 一个数据文件可以属于多个表空间。

C. 一个表空间可以包含多个数据文件。

D. 数据文件的大小是固定的,创建后不能更改。

2. 简答题
描述Oracle数据库中redo log文件的作用及其在数据库恢复中的重要性。

3. SQL操作题
给定一个名为employees的表,其中包含
employee_id, first_name, last_name, email, hire_date, 和 salary等列。

请编写一个SQL查询,找出2022年1月1日之后入职且薪水高于50000的员工。

OCP模拟试题(PL/SQL方向)
1. 选择题
在PL/SQL中,哪个关键字用于声明一个常量?
A. VARIABLE
B. CONSTANT
C. DECLARE
D. STATIC
2. 简答题
解释PL/SQL中的异常处理机制,并举例说明如何在代码中使用BEGIN, EXCEPTION, 和 END块来处理异常。

3. 编程题
编写一个PL/SQL程序,该程序接收一个数字作为输入参数,并计算从1到该数字的所有整数的和。

如果输入的数字小于1,程序应该抛出一个异常。

SQL基础知识题库100道及答案(完整版)

SQL基础知识题库100道及答案(完整版)

SQL基础知识题库100道及答案(完整版)1. 在SQL 中,用于创建表的语句是()A. CREATE TABLEB. INSERT INTOC. UPDATED. DELETE答案:A2. 以下哪个关键字用于在SQL 中添加数据()A. ADDB. INSERTC. APPENDD. PUT答案:B3. 在SQL 中,用于从表中检索数据的语句是()A. SELECTB. GETC. FETCHD. REQUEST答案:A4. 以下哪个关键字用于在SQL 中更新数据()A. MODIFYB. CHANGEC. UPDATED. REPLACE答案:C5. 要从表中删除数据,应使用的SQL 语句是()A. DROPB. DELETEC. REMOVED. CLEAR答案:B6. SQL 中用于创建索引的关键字是()A. CREATE INDEXB. MAKE INDEXC. BUILD INDEXD. ESTABLISH INDEX答案:A7. 以下哪种数据类型用于存储整数()A. INTB. FLOATC. VARCHARD. DATE答案:A8. 用于存储字符串的常见数据类型是()A. CHARB. INTC. DECIMALD. DOUBLE答案:A9. 在SQL 中,用于对结果集进行排序的关键字是()A. SORTB. ORDER BYC. ARRANGED. ALIGN答案:B10. 以下哪个运算符用于等于比较()A. =B. ==C. <>D. >答案:A11. 用于不等于比较的运算符是()A.!=B. < >C. NOT EQUALSD. DIFFERENT答案:B12. 以下哪个运算符用于大于比较()A. >B. >=C. <D. <=答案:A13. 用于小于比较的运算符是()A. <B. <=C. >D. >=答案:A14. 以下哪个关键字用于在SQL 中进行分组操作()A. GROUP BYB. SORT BYC. CLASSIFY BYD. CATEGORIZE BY答案:A15. 聚合函数SUM 用于()A. 计算总和B. 计算平均值C. 计算数量D. 计算最小值答案:A16. 聚合函数AVG 用于()A. 计算总和B. 计算平均值C. 计算数量D. 计算最大值答案:B17. COUNT 函数用于()A. 计算总和B. 计算平均值C. 计算数量D. 计算最小值答案:C18. MAX 函数用于()A. 计算总和B. 计算平均值C. 计算最大值D. 计算最小值答案:C19. MIN 函数用于()A. 计算总和B. 计算平均值C. 计算最大值D. 计算最小值答案:D20. 在SQL 中,用于连接两个表的关键字是()A. JOINB. CONNECTC. LINKD. BIND答案:A21. 内连接使用的关键字是()A. INNER JOINB. LEFT JOINC. RIGHT JOIND. FULL JOIN答案:A22. 左连接使用的关键字是()A. INNER JOINB. LEFT JOINC. RIGHT JOIND. FULL JOIN答案:B23. 右连接使用的关键字是()A. INNER JOINB. LEFT JOINC. RIGHT JOIND. FULL JOIN答案:C24. 全连接使用的关键字是()A. INNER JOINB. LEFT JOINC. RIGHT JOIND. FULL JOIN答案:D25. 在SQL 中,用于限制结果集行数的关键字是()A. LIMITB. RESTRICTC. BOUNDD. CONSTRAINT答案:A26. 以下哪个子句用于在SQL 中进行条件筛选()A. WHEREB. HAVINGC. FROMD. GROUP BY答案:A27. HAVING 子句通常与()一起使用A. GROUP BYB. ORDER BYC. WHERED. FROM答案:A28. 在SQL 中,用于创建视图的语句是()A. CREATE VIEWB. MAKE VIEWC. BUILD VIEWD. ESTABLISH VIEW 答案:A29. 以下哪个关键字用于删除视图()A. DROP VIEWB. DELETE VIEWC. REMOVE VIEWD. CLEAR VIEW 答案:A30. 要在SQL 中添加注释,可以使用()A. //B. /* */C. #D. --答案:D31. 在SQL 中,以下哪种数据类型用于存储日期和时间()A. DATEB. TIMEC. DATETIMED. TIMESTAMP答案:C32. 用于提取日期部分的函数是()A. DATEPART()B. DAY()C. MONTH()D. YEAR()答案:A33. 以下哪个函数用于计算字符串的长度()A. LENGTH()B. SIZE()C. COUNT()D. LEN()答案:A34. 在SQL 中,用于将字符串转换为大写的函数是()A. UPPER()B. TO_UPPER()C. CAPITALIZE()D. BIGCASE()答案:A35. 用于将字符串转换为小写的函数是()A. LOWER()B. TO_LOWER()C. SMALLCASE()D. DECAPITALIZE()答案:A36. 以下哪个函数用于去除字符串两端的空格()A. TRIM()B. CLEAN()C. REMOVE_SPACES()D. STRIP()答案:A37. 在SQL 中,用于执行事务的语句是()A. BEGIN TRANSACTIONB. START TRANSACTIONC. OPEN TRANSACTIOND. INITIATE TRANSACTION答案:A38. 提交事务使用的语句是()A. COMMITB. SUBMITC. CONFIRMD. VALIDATE答案:A39. 回滚事务使用的语句是()A. ROLLBACKB. REVERTC. CANCELD. ABORT答案:A40. 以下哪个关键字用于在SQL 中创建存储过程()A. CREATE PROCEDUREB. MAKE PROCEDUREC. BUILD PROCEDURED. ESTABLISH PROCEDURE答案:A41. 调用存储过程使用的语句是()A. EXECUTEB. CALLC. INVOKED. RUN答案:B42. 在SQL 中,用于删除存储过程的语句是()A. DROP PROCEDUREB. DELETE PROCEDUREC. REMOVE PROCEDURED. CLEAR PROCEDURE答案:A43. 以下哪个关键字用于在SQL 中创建触发器()A. CREATE TRIGGERB. MAKE TRIGGERC. BUILD TRIGGERD. ESTABLISH TRIGGER44. 删除触发器使用的语句是()A. DROP TRIGGERB. DELETE TRIGGERC. REMOVE TRIGGERD. CLEAR TRIGGER答案:A45. 在SQL 中,用于授予权限的语句是()A. GRANTB. ALLOWC. PERMITD. AUTHORIZE答案:A46. 收回权限使用的语句是()A. REVOKEB. DENYC. REFUSED. FORBID答案:A47. 以下哪个关键字用于在SQL 中创建索引的唯一性约束()A. UNIQUEB. PRIMARY KEYC. FOREIGN KEYD. CHECK答案:A48. 用于定义主键约束的关键字是()A. PRIMARY KEYB. UNIQUE KEYC. FOREIGN KEYD. INDEX KEY答案:A49. 外键约束使用的关键字是()A. FOREIGN KEYB. OUTER KEYC. RELATED KEYD. REFERENCED KEY答案:A50. 以下哪个约束用于检查数据的有效性()A. CHECKB. VALIDATEC. INSPECTD. VERIFY答案:A51. 在SQL 中,以下哪个语句用于创建数据库()A. CREATE DATABASEB. MAKE DATABASEC. BUILD DATABASED. ESTABLISH DATABASE 答案:A52. 要删除数据库,应使用的语句是()A. DROP DATABASEB. DELETE DATABASEC. REMOVE DATABASED. CLEAR DATABASE 答案:A53. 以下哪个关键字用于在SQL 中切换数据库()A. USEB. SELECT DBC. CHANGE DBD. SWITCH DB答案:A54. 在SQL 中,以下哪种操作可以对多个表同时进行()A. 联合查询B. 子查询C. 交叉连接D. 内连接55. 子查询可以在以下哪个子句中使用()A. SELECTB. FROMC. WHERED. 以上都可以答案:D56. 以下哪个语句用于在SQL 中创建用户()A. CREATE USERB. MAKE USERC. BUILD USERD. ESTABLISH USER答案:A57. 删除用户使用的语句是()A. DROP USERB. DELETE USERC. REMOVE USERD. CLEAR USER答案:A58. 在SQL 中,用于修改表结构的语句是()A. ALTER TABLEB. MODIFY TABLEC. CHANGE TABLED. UPDATE TABLE答案:A59. 以下哪个操作可以添加列到表中()A. ADD COLUMNB. INSERT COLUMNC. APPEND COLUMND. PUT COLUMN答案:A60. 要删除表中的列,应使用()A. DROP COLUMNB. DELETE COLUMNC. REMOVE COLUMND. CLEAR COLUMN答案:A61. 在SQL 中,以下哪个关键字用于对结果集进行分页()A. PAGEB. PAGINGC. OFFSETD. LIMIT答案:D62. 以下哪个函数用于返回当前日期()A. CURDATE()B. NOW()C. CURRENT_DATE()D. TODAY()答案:C63. 用于返回当前时间的函数是()A. CURTIME()B. NOW()C. CURRENT_TIME()D. THIS_TIME()答案:C64. 在SQL 中,以下哪个关键字用于为表中的列设置默认值()A. DEFAULTB. INITIALC. BASED. START答案:A65. 以下哪个语句用于在SQL 中重命名表()A. RENAME TABLEB. MODIFY TABLE NAMEC. CHANGE TABLE NAMED. UPDATE TABLE答案:A66. 要获取表的结构信息,可以使用以下哪个语句()A. DESCRIBE TABLEB. SHOW TABLE STRUCTUREC. EXPLAIN TABLED. GET TABLE DETAILS答案:A67. 在SQL 中,以下哪个关键字用于在查询结果中去除重复行()A. DISTINCTB. UNIQUEC. SINGLED. ONLY答案:A68. 以下哪个函数用于对字符串进行拼接()A. CONCAT()B. JOIN()C. MERGE()D. COMBINE()答案:A69. 在SQL 中,用于创建临时表的关键字是()A. TEMPORARY TABLEB. TEMP TABLEC. TRANSIENT TABLED. SHORT_LIVED TABLE答案:A70. 以下哪个语句用于在SQL 中为列添加注释()A. COMMENT ON COLUMNB. NOTE ON COLUMNC. REMARK ON COLUMND. EXPLAIN COLUMN答案:A71. 在SQL 中,以下哪个关键字用于在子查询中引用外部查询的结果()A. CORRELATEDB. RELATEDC. CONNECTEDD. LINKED答案:A72. 以下哪个操作符用于在SQL 中进行范围查询()A. BETWEENB. INC. LIKED. EXISTS答案:A73. 用于模糊匹配的操作符是()A. LIKEB. SIMILARC. MATCHD. CLOSE_TO答案:A74. 在SQL 中,以下哪个关键字用于对查询结果进行排序时按照多个列进行()A. ORDER BY MULTIPLEB. SORT BY SEVERALC. ORDER BY MORE THAN ONED. ORDER BY MULTIPLE COLUMNS答案:D75. 以下哪个函数用于返回字符串的子串()A. SUBSTRING()B. PART()C. SEGMENT()D. SLICE()答案:A76. 在SQL 中,以下哪个关键字用于在存储过程中定义输入参数()A. INB. OUTC. INOUTD. PARAMETER答案:A77. 用于定义输出参数的关键字是()A. INB. OUTC. INOUTD. PARAMETER答案:B78. 以下哪个关键字用于在存储过程中定义既可以输入又可以输出的参数()A. INB. OUTC. INOUTD. PARAMETER答案:C79. 在SQL 中,以下哪个关键字用于在创建表时指定自增列()A. AUTO_INCREMENTB. SELF_INCREMENTC. AUTO_GROWD. SELF_GROW答案:A80. 以下哪个语句用于在SQL 中创建序列()A. CREATE SEQUENCEB. MAKE SEQUENCEC. BUILD SEQUENCED. ESTABLISH SEQUENCE 答案:A81. 要获取序列的下一个值,可以使用以下哪个函数()A. NEXTVAL()B. GET_NEXT()C. NEXT_VALUE()D. FOLLOWING_VALUE()答案:A82. 在SQL 中,以下哪个关键字用于锁定表()A. LOCKB. HOLDC. FREEZED. BLOCK答案:A83. 以下哪种锁类型用于防止其他事务读取或修改数据()A. 共享锁B. 排他锁C. 意向共享锁D. 意向排他锁答案:B84. 共享锁允许其他事务()A. 读取数据B. 修改数据C. 删除数据D. 以上都不行答案:A85. 在SQL 中,以下哪个关键字用于解锁表()A. UNLOCKB. RELEASEC. FREED. UNBIND答案:A86. 以下哪个函数用于计算两个日期之间的天数差()A. DATEDIFF()B. DATE_DIFFERENCE()C. DAY_DIFFERENCE()D. TIME_DIFFERENCE()答案:A87. 在SQL 中,以下哪个关键字用于在查询中使用别名()A. ASB. LIKEC. SAME ASD. EQUALS答案:A88. 以下哪个语句用于在SQL 中创建索引的唯一约束()A. UNIQUE INDEXB. PRIMARY INDEXC. FOREIGN INDEXD. CHECK INDEX答案:A89. 要在SQL 中创建全文索引,应使用()A. FULLTEXT INDEXB. COMPLETE TEXT INDEXC. ALL_TEXT INDEXD. WHOLE_TEXT INDEX 答案:A90. 在SQL 中,以下哪个关键字用于在存储过程中声明变量()A. DECLAREB. DEFINEC. STATED. ANNOUNCE答案:A91. 以下哪个语句用于在SQL 中为变量赋值()A. SETB. ASSIGNC. GIVED. PUT答案:A92. 在SQL 中,以下哪个关键字用于在存储过程中进行条件判断()A. IFB. WHENC. CASED. CHECK答案:A93. 以下哪种语句用于在SQL 中进行循环操作()A. FORB. WHILEC. LOOPD. 以上都是答案:D94. 在SQL 中,用于退出循环的语句是()A. BREAKB. EXITC. STOPD. END答案:A95. 以下哪个函数用于将数字转换为字符串()A. CAST()B. CONVERT()C. TO_STRING()D. NUM_TO_STR()答案:B96. 在SQL 中,用于获取当前会话的用户名称的函数是()A. CURRENT_USERB. SYSTEM_USERC. LOGGED_IN_USERD. SESSION_USER答案:A97. 以下哪个关键字用于在SQL 中创建存储函数()A. CREATE FUNCTIONB. MAKE FUNCTIONC. BUILD FUNCTIOND. ESTABLISH FUNCTION 答案:A98. 要删除存储函数,应使用的语句是()A. DROP FUNCTIONB. DELETE FUNCTIONC. REMOVE FUNCTIOND. CLEAR FUNCTION答案:A99. 在SQL 中,用于获取数据库版本信息的函数是()A. VERSION()B. DB_VERSION()C. DATABASE_VERSION()D. SYSTEM_VERSION()答案:A100. 以下哪个操作可以在SQL 中对表进行重命名()A. RENAME TABLEB. MODIFY TABLE NAMEC. CHANGE TABLE NAMED. UPDATE TABLE NAME答案:A。

OCP考题学习

OCP考题学习
If the POWER clause of a rebalance operation is not specified, then the default power will be the value of ASM_POWER_LIMIT
5. Manually, you set the consumer group of all of the newly created users to MYDB_GRP. You want the users to be able to change their consumer groups as per the application requirement. What was the first step that was needed in the process to achieve this objective? A.The user must have been granted the DBA role.
分区 ORACLE认证试题 的第 1 页
A.The user must have been granted the DBA role. B.The user must have been granted the switch privilege as a part of a role. C.The user must have been granted the Resource Manager administrator privilege. D.The user must have been granted the switch privilege by using the DBMS_RESOURCE_MANAGER_PRIVS package. Answer: D Note: 资源管理概述: 资源管理器有三个部件组成: 资源用户组(Resource consumer group ) 资源规划(Resource plan ) 资源分配方法(Resource allocation method) 资源计划目录(Resource plan directives) 它们的功能如下: 资源用户组: 根据数据库资源处理需求,将用户会话分成组资源规划: 指定哪些资源分配给资源用 户的命令资源分配方法: 数据库资源管理器分配特殊资源时采用的方法,由资源用户组和资源规划 来使用。

OCP考试题库原题

OCP考试题库原题

052题库解析OCP考试052最新考试题库原题-4-20180601题库新特点:●更加灵活,题库的顺序与考试时的顺序每场都在变化●更加考验知识点的掌握,题库答案为二,考试时要求选择最佳一个答案●不断有新的考题出现,目前最新已经更新到130道题1、Yourdatabase Is configuredIn archivelogmode.TheUSERS01tablespaceIscurrently online.You arerequiredtotakethetablespaceoffline.Which clauseorclausesensurethatnomediarecoveryis requiredwhen thetablespaceIs broughtbackonline?•❑A)eitherthe NORMALor theTEMPORARYclause•❑B)onlythe NORMALclause•❑C)only the TEMPORARYclause•❑D)eitherthe NORMALor the IMMEDIATEclause•❑E)onlytheIMMEDIATEclause•Answer:B1offlinetemporary表空间时,如果表空间中没有offline的数据文件,则online该表空间时不需要介质恢复。

2offlinetemporary表空间时,不会对已经offline的数据文件执行检查点操作,仅仅对online的数据文件执行检查点操作3offlinetemporary表空间时,对于离线表空间之前已经offline的数据文件,则online该表空间时,offline数据文件需要介质恢复。

•2、Which twostatementsaretrueabouttablespaces?•❑A)Adatabasecancon tain multipleundotablespaces.•❑B)A databasecancontainonlya singletemporarytablespace.•❑C)A databaseinstancestoresundo data In the SYSTEM tablespaceIf no undo tablespace exists.•❑D)Adatabaseinstancehangs Ifthe SYSAUXtablespace beesunavailable.•❑E)Adatabasewithalocally managedSYSTEMtablespace canhavedictionary-manageduser tablepaces.•Answer:AE•3、You wanttoInstallOracle 11gdatabase softwareand createadatabaseonASMImmediatelyafter the Install. Yourplan is toinstallbothOracledatabaseand Grid Infrastructure.Which twoaretruein this scenario?•❑A)GridInfrastructuremustbe installed first.•❑B)Both products mustbe Installedbythe sameOS user. •❑C)Eachproduct mustbe Installed Ina different ORACLE_HOME.•❑D)BothproductscansharetheOSgroup assigned totheir OSDBA and OSOPER privileged groups•❑E)Bothproductsmustbe installedbyusing thesame ORACLE_BASE.•❑F)Bothproducts mustbe of thesameversion.•Answer:AC4、Which istrue aboutinvalidPL/SQLobjects?•❑A)Theyareautomaticallyrepiled againstthenewdefinitionof areferencedobjectatthesametimeas thereferencedobjectis modified.•❑B)Theycanbe manuallyrepiledonly byusingSQL mands.•❑C)Theyareautomaticallyrepiled againstthe new definitionof areferencedobjectwhen they arecalled.•❑D)Theymust be manuallyrepiledbeforetheycanbeused if a DDL isperformed on atable that is referencedin thePL/SQL object.•Answer:D5、Whichis trueaboutthe SYSTEMand SYSAUXtablespaces? •❑A)TheSYSAUXtablespacecanbe maderead-onlybut the SYSTEMtablespacecannot.•❑B)Bothtablespacescanbe used fortemporarystorageif no temporary tablespaceis defined.•❑C)Only the SYSTEMtablespacecontainsdatadictionary tables.•❑D)Bothtablespaces mustbe online foradatabasetobe accessible.•Answer:A6、Whichtwoaretrueaboutroles?•❑A)A rolecanbe password-protected.•❑B)A rolecanbe grantedtoanotherrole.•❑C)Onlyone defaultrolecanbe grantedto a user.•❑D)A rolecan be grantedonly multiplesystemprivileges not multipleobjectprivileges.•❑E)A rolecan be created onlybyauser withthe SYSDBA privilege.•Answer:AB7、YouareplanningasoftwareinstallationforbothOracleDatabase11g Release1and Release2.Youplantohaveatleaseone databaseforeach releasemanagedbyGridInfrastructureforaStandaloneServer. Whichthreearetrue inthisscenario?•A)Oracle11gRelease1databasesmustbemanagedbyGridInfrastructure 11gRelease1.•B)Both databasescanbemanagedby GridInfrastructure11gRelease2. •C) BothOracleversionsandGridInfrastructure canbeowned by thesame O/Saccount.•D) GirdInfrastructuremustbe installedbeforebothOracleDatabase versions.•E)Eachversionofthe databasemaybemanagedby aseparateversionof Grid Infrastructure.•F)BothOracleversionsand Grid Infrastructurecanbe installedunderthe sameORCALE_BASE.•Answer:ADE•8、Which twoaretrueaboutdatadictionaryand dynamic performance views(v$views)?•A)Alldatabaseusershaveaccess toALL_* views.•B)Datadictionaryviewoutputissubject toreadconsistency. •C)Thedefiningqueries forOracle supplied dynamic performance viewsarestoredIn the datadictionary.•D)Allv$viewsdisplayoutput when queries, iftheinstance isin nomountstate•E)Alldatabaseusershaveaccess toallv$views.•Answer:AB9、YOURDB_RECOVERY_FILE_DEST_SIZEIs8G. Currently,5GofthespaceIsused ofwhich4Gconsistsofobsoletebackups.Youexecutethismand:SQL>ALTERSYSTEMSETdb_recovery_file_dest_size=2G;Whati sthe oute?•A)ItchangesDB_RECOVERY_FILE_DEST_SIZEto5G.•B)ItchangesDB_RECOVERY_FILE_DEST_SIZEto2Gwithout deletingvalidbackups.•C)It fallsbecauseDB_RECOVERY_FILE_DEST_SIZEis astatic parameter.•D)It changesDB_RECOVERY_FILE_DEST_SIZEto2Gand deletesthe obsoletebackups.•E)Itfailsbecause the newsizeis lessthan 5G.•Answer:D10、Whichis trueaboutlogicalandphysicaldatabasestructures? (Choosethe best answer)•A.Anundotablespacehas a tempfile insteadof a datafile.•B.Asegmentcanconsistofextentsof differentsizes.•C.Apermanenttablespace canonlycontaintablessegments and index segments.•D.Atablespacecanconsistofdatablocksofdifferentsizes.•E. Anextentalwaysconsists of physicallycontiguousdata blocksin storage.•CorrectAnswer: B•11、Inwhichstatecanyou backup a database in ARCHIVELOGMODEusingRMAN?•A.NOMOUNT,MOUNT,ANDOPEN•B.NOMOUNTANDMOUNTONLY•C.OPENONLY •D.MOUNT AND OPENONLY•E. OPEN RESTRICTEDONLY•CorrectAnswer: D12、Examine these factsaboutadatabase: 1. USERSisthedatabasedefaulttablespace.2. USER1,USER2,ANDUSER3havetheCREATE SESSIONprivilege.3. TheyalsohaveUNLIMITED QUOTAonthe defaulttablespaceUSERS.4. Theyhaveno otherprivileges. Examinethesemands: SQL>conn/ assysdbaConnected.SQL>GRANTCREATETABLETOuser1WITHADMINOPTION;Grantsucceeded. SQL>connuser1/oracle_4U Connected.SQL> GRANTCREATETABLETOuser2;Grantsucceeded.SQL>GRANTCREATETABLETOuser3WITHADMINOPTION;Grantsucceeded.12、Whichtwoaretrue?•A.Any user with createtablewithadmin optioncanrevokecreatetable fromuser1.•B.IfSYSrevokescreatetablefromuser1,it isrevokedfromuser2butnot fromuser3.•C.OnlySYSandUSER1canrevokeCREATETABLEfromUSER3.•D.OnlySYSC ANREVOKE CREATETABLEFROM USER1.•E.If SYSrevokescreatetablefromuser1, itis notrevokedfromUSER2and USER3.•CorrectAnswer: AE13、Which twoaretrueaboutexternaltables?•A.Theysupport the ORACLE_DATAPUMPaccessdriver.•B.Theyhaveextents. •C.TheysupportallDMLoperations.•D.Theycanalways be updatedusing SQL.•E. Theycanbe storedinan ASMClusterFileSystem(ACFS).•CorrectAnswer: AE14、Inoneof your databases:* ThedatabasedefaulttablespaceisEXAMPLE.*Deferred_segment_creation is false.Examine these mands: SQL>createuser user1identifiedbyoracle_4upasswordexpire;Usercreated.SQL> alter user user1account unlock;Useraltered.SQL>grantcreatesessiontouser1;Grantsucceeded.SQL>grantcreatetable touser1 withadminoption;Grantsucceeded.14、Which threearetrue?•er1 can login tothe databaseinstance.•er1cangrant thecreatetable privilegetootherusers.•er1 cancreate tablesin the exampletablespace.•er1 must changeit’s passwordatfirstlogin.•E. user1cancreateindexes in exampletablespace.•CorrectAnswer: ABD15、Which istrue when adatabaseinstanceis shutdown? •A.Only transactionalandnormalmodeswait forallunmittedtransactionstomitorrollback and thenclosethe database.•B.Immediate,transactional,and normalmodes allresultin a checkpoint.•C.Neitherthe immediatenor the abortmode rollsback unmittedtransactions.•D.Immediate,transactional,and normalmodes waitforallunmittedtransactionseithertomitor rollbackandthen closethe database.•CorrectAnswer:AB。

最新版精选ORCLE认证考核题库288题(含答案)

最新版精选ORCLE认证考核题库288题(含答案)

2020年ORCLE认证考试题库288题[含答案]一、选择题1.查看操作在数据表中所影响的行书,可通过游标的(9个字)属性实现。

2.Oracle数据库的完整启动过程依次为如下3个步骤:启动数据库实例,、(8个字)、将数据库设置为打开状态。

3.当对某个表加SRX锁时,则表中行的锁类型为。

4.当Oracle检测到死锁后,它会选择一个事务退出。

选择退出事务的原则是执行修改数目的事务。

5.簇是一种用于存储数据表中数据的方法。

簇实际上是(3个字),由一组共享相同数据块的多个(1个字)组成。

6.查看下面的程序块,其中变量var_b 的结果为(1个字).DECLAREVar_a number:=1200;Var_b number;BEGINIF Var_a>500 THENVar_b:=5;ELSIF var_a>1000 thenVar_b:=10;ElseVar_b:=8;End if;End;7.查看下面的程序块,其中变量var_b 的结果为(1个字).DECLAREVar_a number:=1200;Var_b number;BEGINIF Var_a>500 THENVar_b:=5;ELSIF var_a>1000 thenVar_b:=10;ElseVar_b:=8;End if;End;8.当进行模糊查询时,应使用关键字______和通配符_______或百分号%。

9.查看下面的程序块,DBMS_OUTPUT将显示什么结果?(1个字).DECLAREV AR_a CHAR(1):’N’;BEGINDECLAREVar_a CHAR(2);BEGINVar_a:’Y’;END;DBMS_OUTPUT.PUT_LINE(V AR_A);END;10.当设置了多个列的显示属性后,如果清除设置的显示属性,可以使用命令(5个字),而当要清除某列具体的显示属性时,需要使用命令(5个字)11.表空间的管理类型可以分为(3个字)和(4个字)。

OracleOCP认证考试题库

OracleOCP认证考试题库

OracleOCP认证考试题库Oracle OCP认证考试题库Oracle开发的关系数据库产品因性能卓越而闻名,Oracle数据库产品为财富排行榜上的前1000家公司所采用,许多大型网站也选用了Oracle系统,是世界最好的数据库产品。

以下是店铺整理的关于Oracle OCP认证考试题库,希望大家认真阅读!QUESTION 1You notice that the performance of the database has degraded because of frequent checkpoints.Which two actions resolve the issue? (Choose two.)A. Disable automatic checkpoint tuningB. Check the size of the redo log file size and increase the size if it is smallC. Set the FAST_START_MTTR_TARGET parameter as per the advice given by the MTTR AdvisorD. Decrease the number of redo log members if there are more than one redo log members available in each redo log groupCorrect Answer: BCExplanation/Reference:检查点进程:The checkpoint process (CKPT) updates the control file and data file headers with checkpoint information and signals DBWn to write blocks to disk. Checkpoint information includes the checkpoint position, SCN, location in online redo log to begin recovery, and so on. CKPT does not write data blocks to data files or redo blocks to online redo log files.检查点作用:(1)定期促进DBWn进程把内存的脏块写回到数据文件,数据库故障时不会丢数据(2)减少实例恢复的时间(3)确保所有已提交的数据在一致性关闭期间会被写入数据文件实例恢复时间:指的是将数据文件的最后一个检查点(检查点位置)推进到控制文件中记录的最新SCN所需的时间.管理员可以通过设置MTTR 目标以及调整重做日志组的大小来控制该时间.MTTR:Mean Time T o Repair,即平均修复时间.是指可修复产品的平均修复时间,就是从出现故障到修复中间的`这段时间.MTTR越短表示易恢复性越好.在数据库中可以通过设置参数FAST_START_MTTR_TARGET(单位为秒),控制数据库对单个实例执行崩溃恢复所花费的时间.FAST_START_MTTR_TARGE=非0值, 启用快速启动检查点功能,自动控制发检查点速度.FAST_START_MTTR_TARGE=0,禁用快速启动检查点功能.如果重做日志文件的size太小,会频繁切换日志,即会频繁发生检查点,故可以增大重做日志文件的size减少检查点发生频率.FAST_START_MTTR_TARGET如果设置的太小,为了要控制数据库单实例的实例恢复时间,则必须频繁发生检查点,确保内存中已修改的数据块能够定期写入到磁盘,故可以使用MTTR Advisor来设置推荐的值.QUESTION 2Identify the memory component from which memory may be allocated for:Session memory for the shared server, Buffers for I/O slaves Oracle Database Recovery Manager (RMAN) backup and restore operationsA. Large PoolB. Redo Log BufferC. Database Buffer CacheD. Program Global Area (PGA)Correct Answer: AExplanation/Reference:Large PoolThe large pool is an optional memory area intended for memory allocations that are larger than is appropriate for the shared pool. The large pool can provide large memory allocations for the following:UGA for the shared server and the Oracle XA interface (used where transactions interact with multiple databases)Message buffers used in the parallel execution of statements Buffers for Recovery Manager (RMAN) I/O slavesBy allocating session memory from the large pool for shared SQL, the database avoids performance overhead caused by shrinking the shared SQL cache. By allocating memory in large buffers for RMAN operations, I/O server processes, and parallel buffers, the large pool can satisfy large memory requests better than the shared pool.QUESTION 3You executed the following command to create a tablespace called SALES_DATA:SQL> CREATE TABLESPACE sales_dataDATAFILE SIZE 100MSEGMENT SPACE MANAGEMENT AUTO;Which two statements are true about the SALES_DATA tablespace? (Choose two)A. The database automatically determines the extent-sizing policy for the tablespace.B. The segments are automatically shrunk when the contents are removed from them.C. The allocation of extents within the tablespace is managed through the dictionary tables.D. The space utilization description of the data blocks in segments is recorded in bitmap blocks.E. The space utilization description of the data blocks in segments is managed through free lists.Correct Answer: ADExplanation/Reference:段空间管理: 本地管理的表空间中的段空间管理方式可指定为:自动:Oracle DB 使用位图管理段中的空闲空间.位图描述了段中每个数据块的状态,该状态与可插入行的块中的空间量有关.当数据块中可用空间增多或减少时,位图中会反映数据块的新状态.通过使用位图,Oracle DB 可以提高管理空闲空间的自动化程度.因此,这种空间管理方式称为"自动段空间管理(ASSM)".手动:此方法指定要使用空闲列表来管理段中的空闲空间.空闲列表是由一些数据块组成的列表,这些数据块中有可插入行的空间.由于这种管理段空间的方式需要为在表空间中创建的方案对象指定并优化PCTUSED、FREELISTS和FREELIST GROUPS存储参数,因此这种方式称为"手动段空间管理".支持使用此方法是为了向后兼容,建议使用ASSM.可通过dba_tablespaces查看分区和段空间管理方式:SYS@ENMOEDU> select tablespace_name,extent_management,segment_space_manage ment from dba_tablespaces;TABLESPACE_NAME EXTENT_MAN SEGMENSYSTEM LOCAL MANUALSYSAUX LOCAL AUTOTEMP LOCAL MANUALUSERS LOCAL AUTOEXAMPLE LOCAL AUTOUNDOTBS1 LOCAL MANUALQUESTION 4In which of the scenario will the DBA perform recovery? (Choose all that apply.)A. The alert log file is corruptedB. A tablespace is accidentally droppedC. One of the redo log members is corruptedD. A database user terminates the session abnormallyE. The hard disk on which the data files is stored is corruptedCorrect Answer: BEExplanation/Reference:DBA一般在数据库出现介质损坏的时候执行恢复操作.A: 错误,alert日志损坏数据库不会丢失数据,不需要恢复.B: 正确,表空间在操作系统改名需要执行恢复,数据库找不到表空间对应的数据文件.C: 错误,丢失redo成员,不会丢失数据,不需要执行恢复操作.D: 错误,会话异常终止不会丢失数据,不需要恢复,数据库会释放异常会话占用的资源.E: 正确,磁盘损坏会导致在该磁盘的数据文件损坏,需要执行恢复操作.【Oracle OCP认证考试题库】。

新版精编ORCLE认证完整考题库288题(含标准答案)

新版精编ORCLE认证完整考题库288题(含标准答案)

2020年ORCLE认证考试题库288题[含答案]一、选择题1.标准的SQL语言语句类型可以分为: (9个字) 、数据操纵语句(DML)和(9个字) 。

2.Oracle数据库的启动过程可以分为3个阶段:(启动数据库实例)、加载数据库、(5个字)。

在(7个字)阶段,需要完成3个操作:读取定义启动参数的文件、分配SGA 区、启动后台进程。

加载数据库文件则是将数据库文件与启动的实例相关联。

在(7个字)阶段,系统会读取参数文件中指定的控制文件。

3.查看下面的程序块,其中变量var_b 的结果为(1个字).DECLAREVar_a number:=1200;Var_b number;BEGINIF Var_a>500 THENVar_b:=5;ELSIF var_a>1000 thenVar_b:=10;ElseVar_b:=8;End if;End;4.查看下面的程序块,其中变量var_b 的结果为(1个字).DECLAREVar_a number:=1200;Var_b number;BEGINIF Var_a>500 THENVar_b:=5;ELSIF var_a>1000 thenVar_b:=10;ElseVar_b:=8;End if;End;5.查看下面的程序块,DBMS_OUTPUT将显示什么结果?(1个字).DECLAREV AR_a CHAR(1):’N’;BEGINDECLAREVar_a CHAR(2);BEGINVar_a:’Y’;END;DBMS_OUTPUT.PUT_LINE(V AR_A);END;6.查看下面的程序块,DBMS_OUTPUT将显示什么结果?(1个字).DECLAREV AR_a CHAR(1):’N’;BEGINDECLAREVar_a CHAR(2);BEGINVar_a:’Y’;END;DBMS_OUTPUT.PUT_LINE(V AR_A);END;7.查看操作在数据表中所影响的行书,可通过游标的(9个字)属性实现。

SQL查询优化考试试卷

SQL查询优化考试试卷

SQL查询优化考试试卷(答案见尾页)一、选择题1. SQL查询优化的目的是什么?A. 提高查询速度B. 增加数据库负担C. 减少数据冗余D. 降低系统稳定性2. 在进行SQL查询优化时,以下哪个不是常用的优化方法?A. 使用分区表B. 使用存储过程C. 尽量避免使用SELECT *D. 避免使用子查询3. 以下哪个不是索引的作用?A. 提高查询速度B. 增加数据冗余C. 加速表之间的连接D. 减少查询所需的时间4. 在SQL查询优化中,通常建议避免使用哪种类型的子查询?A. 相关子查询B. 非相关子查询C. 标量子查询D. 表子查询5. 在SQL查询优化中,使用哪个命令可以帮助分析查询性能?A. EXPLAINB. DESCRIPTORC. ANALYZED. PROFILE6. 以下哪个因素可能导致SQL查询性能下降?A. 数据库服务器硬件故障B. 数据库表空间不足C. 索引过多或缺失D. 查询语句语法错误7. 在进行SQL查询优化时,如何确定是否需要优化?A. 查看查询执行时间B. 分析查询计划C. 询问开发人员D. 直接修改查询语句8. 在SQL查询优化中,通常建议使用哪种类型的连接(INNER JOIN)?A. 左连接(LEFT JOIN)B. 右连接(RIGHT JOIN)C. 内连接(INNER JOIN)D. 外连接(OUTER JOIN)9. 在SQL查询优化中,如何减少查询中的数据量?A. 使用LIMIT子句B. 使用WHERE子句过滤C. 使用JOIN代替子查询D. 使用GROUP BY和HAVING子句10. 在SQL查询优化中,如何提高查询结果的准确性?A. 使用正则表达式B. 使用聚合函数C. 使用视图(VIEW)D. 使用触发器(TRIGGER)11. SQL查询优化的首要目标是提高查询效率,减少查询所需的时间和资源。

以下哪个不是优化查询性能的常用方法?A. 使用索引B. 优化数据结构C. 添加冗余数据D. 使用分页查询12. 在进行SQL查询优化时,对查询语句进行规范化处理可以提高查询效率。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Oracle__1Z0-007_v2011-11-07_175q_By-sam Number: 1Z0-007Passing Score: 800Time Limit: 120 minFile Version: 2011-11-07Exam : Oracle__1Z0-007Ver :2011-11-07Question : 175This product will provide you questions and answers carefully compiled and written by our experts. Try to understand the concepts behind the questions instead of cramming the questions.good luckBy-samExam AQUESTION 1Examine the structure of the EMPLOYEES table:EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2(25)LAST_NAME VARCHAR2(25)Which three statements insert a row into the table? (Choose three.)A. INSERT INTO employeesVALUES ( NULL, 'John', 'Smith');B. INSERT INTO employees( first_name, last_name)VALUES( 'John', 'Smith');C. INSERT INTO employeesVALUES ( '1000', 'John', NULL);D. INSERT INTO employees (first_name, last_name, employee_id) VALUES ( 1000, 'John','Smith');E. INSERT INTO employees (employee_id)VALUES (1000);F. INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'John', '');Answer: CEFSection: (none)Explanation/Reference:QUESTION 2Evaluate the SQL statement:SELECT ROUND(45.953, -1), TRUNC(45.936, 2)FROM dual;Which values are displayed?A. 46 and 45B. 46 and 45.93C. 50 and 45.93D. 50 and 45.9E. 45 and 45.93F. 45.95 and 45.93Answer: CSection: (none)Explanation/Reference:QUESTION 3Which are DML statements? (Choose all that apply.)A. COMMITB. MERGEC. UPDATED. DELETE - Make You Succeed To Pass IT ExamsCertkey 1Z0-007E. CREATEF. DROP...Answer: BCDSection: (none)Explanation/Reference:QUESTION 4Evaluate the set of SQL statements:CREATE TABLE dept(deptno NUMBER(2),dname VARCHAR2(14),loc VARCHAR2(13));ROLLBACK;DESCRIBE DEPTWhat is true about the set?A. The DESCRIBE DEPT statement displays the structure of the DEPT table.B. The ROLLBACK statement frees the storage space occupied by the DEPT table.C. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does notexist.D. The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is aCOMMIT statement introduced before the ROLLBACK statement.Answer: ASection: (none)Explanation/Reference:QUESTION 5Evaluate this SQL statement:SELECT ename, sal, 12*sal+100FROM emp;The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"?A. No change is required to achieve the desired results.B. SELECT ename, sal, 12*(sal+100)FROM emp;C. SELECT ename, sal, (12*sal)+100FROM emp;D. SELECT ename, sal+100,*12FROM emp;Answer: BSection: (none)Explanation/Reference:QUESTION 6Examine the SQL statement that creates ORDERS table:CREATE TABLE orders - Make You Succeed To Pass IT ExamsCertkey 1Z0-007(SER_NO NUMBER UNIQUE,ORDER_ID NUMBER,ORDER_DATE DATE NOT NULL,STATUS VARCHAR2(10)CHECK (status IN ('CREDIT', 'CASH')),PROD_ID NUMBERREFERENCES PRODUCTS(PRODUCT_ID),ORD_TOTAL NUMBER,PRIMARY KEY (order_id, order_date));For which columns would an index be automatically created when you execute the above SQL statement? (Choose two.)A. SER_NOB. ORDER_IDC. STATUSD. PROD_IDE. ORD_TOTALF. composite index on ORDER_ID and ORDER_DATEAnswer: AFSection: (none)Explanation/Reference:QUESTION 7Examine the structure of the EMP_DEPT_VU view:Column Name Type RemarksEMPLOYEE_ID NUMBER From the EMPLOYEES tableEMP_NAME VARCHAR2(30) From the EMPLOYEES tableJOB_ID VARCHAR2(20) From the EMPLOYEES tableSALARY NUMBER From the EMPLOYEES tableDEPARTMENT_ID NUMBER From the DEPARTMENTS tableDEPT_NAME VARCHAR2(30) From the DEPARTMENTS tableWhich SQL statement produces an error?A. SELECT *FROM emp_dept_vu;B. SELECT department_id, SUM(salary)FROM emp_dept_vuGROUP BY department_id;C. SELECT department_id, job_id, AVG(salary)FROM emp_dept_vuGROUP BY department_id, job_id;D. SELECT job_id, SUM(salary)FROM emp_dept_vuWHERE department_id IN (10,20)GROUP BY job_id - Make You Succeed To Pass IT ExamsCertkey 1Z0-007HAVING SUM(salary) > 20000;E. None of the statements produce an error; all are valid.Answer: ESection: (none)Explanation/Reference:QUESTION 8Evaluate this SQL statement:SELECT e.EMPLOYEE_ID,ST_NAME,e.DEPARTMENT_ID,A. DEPARTMENT_NAMEFROM EMPLOYEES e, DEPARTMENTS dWHERE e.DEPARTMENT_ID = d.DEPARTMENT_ID;In the statement, which capabilities of a SELECT statement are performed?B. selection, projection, joinC. difference, projection, joinD. selection, intersection, joinE. intersection, projection, joinF. difference, projection, productAnswer: ASection: (none)Explanation/Reference:QUESTION 9Click the Exhibit button and examine the data from the EMP table. The COMMISSION column shows the monthly commission earned by the employee. Which three tasks would require subqueries or joins in order to be performed in a single step? (Choose three.)A. deleting the records of employees who do not earn commissionB. increasing the commission of employee 3 by the average commission earned indepartmentC. finding the number of employees who do NOT earn commission and are working fordepartment 20D. inserting into the table a new employee 10 who works for department 20 and earns acommission that is equal to the commission earned by employee 3 - MakeYou Succeed To Pass IT ExamsCertkey 1Z0-007E. creating a table called COMMISSION that has the same structure and data as thecolumns EMP_ID and COMMISSION of the EMP tableF. decreasing the commission by 150 for the employees who are working in department 30and earning a commission of more than 800Answer: BDESection: (none)Explanation/Reference:QUESTION 10You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?A. ALTER TABLE studentsADD PRIMARY KEY student_id;B. ALTER TABLE studentsADD CONSTRAINT PRIMARY KEY (student_id);C. ALTER TABLE studentsADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;D. ALTER TABLE studentsADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);E. ALTER TABLE studentsMODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);Answer: DSection: (none)Explanation/Reference:QUESTION 11Which three are DATETIME data types that can be used when specifying column definitions? (Choose three.)A. TIMESTAMPB. INTERVAL MONTH TO DAYC. INTERVAL DAY TO SECONDD. INTERVAL YEAR TO MONTHE. TIMESTAMP WITH DATABASE TIMEZONEAnswer: ACDSection: (none)Explanation/Reference:QUESTION 12The EMPLOYEES table contains these columns:LAST_NAME VARCHAR2 (25)SALARY NUMBER (6,2)COMMISSION_PCT NUMBER (6)You need to write a query that will produce these results:1. Display the salary multiplied by the commission_pct.2. Exclude employees with a zero commission_pct. - Make You Succeed To Pass IT ExamsCertkey 1Z0-0073. Display a zero for employees with a null commission value.Evaluate the SQL statement:SELECT LAST_NAME, SALARY*COMMISSION_PCTFROM EMPLOYEESWHERE COMMISSION_PCT IS NOT NULL;What does the statement provide?A. all of the desired resultsB. two of the desired resultsC. one of the desired resultsD. an error statementAnswer: CSection: (none)Explanation/Reference:QUESTION 13Evaluate the SQL statement:TRUNCATE TABLE DEPT;Which three are true about the SQL statement? (Choose three.)A. It releases the storage space used by the table.B. It does not release the storage space used by the table.C. You can roll back the deletion of rows after the statement executes.D. You can NOT roll back the deletion of rows after the statement executes.E. An attempt to use DESCRIBE on the DEPT table after the TRUNCATE statementexecutes will display an error.F. You must be the owner of the table or have DELETE ANY TABLE system privileges totruncate the DEPT table.Answer: ADFSection: (none)Explanation/Reference:QUESTION 14The EMP table contains these columns:EMPLOYEE_ID NUMBER(4)EMPNAME VARCHAR2 (25)SALARY NUMBER(9,2)HIRE_DATE DATEYou query the database with this SQL statement:SELECT empname,hire_date HIREDATE, salaryFROM EMPORDER BY hire_date;How will the results be sorted?A. randomlyB. ascending by date - Make You Succeed To Pass IT ExamsCertkey 1Z0-007C. descending by dateD. ascending alphabeticallyE. descending alphabeticallyAnswer: BSection: (none)Explanation/Reference:QUESTION 15Mary has a view called EMP_DEPT_LOC_VU that was created based on the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables. She granted SELECT privilege to Scott on this view. Which option enables Scott to eliminate the need to qualify the view with the nameMARY.EMP_DEPT_LOC_VU each time the view is referenced?A. Scott can create a synonym for the EMP_DEPT_LOC_VU by using the commandCREATE PRIVATE SYNONYM EDL_VUFOR mary.EMP_DEPT_LOC_VU;then he can prefix the columns with this synonym.B. Scott can create a synonym for the EMP_DEPT_LOC_VU by using the commandCREATE SYNONYM EDL_VUFOR mary.EMP_DEPT_LOC_VU;then he can prefix the columns with this synonym.C. Scott can create a synonym for the EMP_DEPT_LOC_VU by using the commandCREATE LOCAL SYNONYM EDL_VUFOR mary.EMP_DEPT_LOC_VU;then he can prefix the columns with this synonym.D. Scott can create a synonym for the EMP_DEPT_LOC_VU by using the commandCREATE SYNONYM EDL_VUON mary(EMP_DEPT_LOC_VU);then he can prefix the columns with this synonym.E. Scott cannot create a synonym because synonyms can be created only for tables.F. Scott cannot create any synonym for Mary's view. Mary should create a private synonymfor the view and grant SELECT privilege on that synonym to Scott.Answer: BSection: (none)Explanation/Reference:QUESTION 16A subquery can be used to ___.A. create groups of dataB. sort data in a specific orderC. convert data to a different formatD. retrieve data based on an unknown conditionAnswer: DSection: (none)Explanation/Reference: - Make You Succeed To Pass IT ExamsCertkey 1Z0-007QUESTION 17Click the Exhibit button to examine the data of the EMPLOYEES table. Which statement lists the ID, name, and salary of the employee, and the ID and name of the employee's manager, for all the employees who have a manager and earn more than 4000?A. SELECT employee_id "Emp_id", emp_name "Employee",salary,employee_id "Mgr_id", emp_name "Manager"FROM employeesWHERE salary > 4000;B. SELECT e.employee_id "Emp_id", e.emp_name "Employee",C. salary,D. employee_id "Mgr_id", m.emp_name "Manager"FROM employees e JOIN employees mWHERE e.mgr_id = m.mgr_idAND e.salary > 4000;E. SELECT e.employee_id "Emp_id", e.emp_name "Employee",F. salary,G. employee_id "Mgr_id", m.emp_name "Manager"FROM employees e JOIN employees mON (e.mgr_id = m.employee_id)AND e.salary > 4000;H. SELECT e.employee_id "Emp_id", e.emp_name "Employee",I. salary,J. mgr_id "Mgr_id", m.emp_name "Manager"FROM employees e SELF JOIN employees mWHERE e.mgr_id = m.employee_idAND e.salary > 4000;K. SELECT e.employee_id "Emp_id", e.emp_name "Employee", L. salary,M. mgr_id "Mgr_id" m.emp_name "Manager"FROM employees e JOIN employees m - Make You Succeed To Pass IT ExamsCertkey 1Z0-007USING (e.employee_id = m.employee_id)AND e.salary > 4000;Answer: CSection: (none)Explanation/Reference:QUESTION 18The EMPLOYEES table has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)HIRE_DATE DATEManagement wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement:ALTER TABLE EMPLOYEESMODIFY (SALARY DEFAULT 5000);Which is true about your ALTER statement?A. Column definitions cannot be altered to add DEFAULT values.B. A change to the DEFAULT value affects only subsequent insertions to the table.C. Column definitions cannot be altered to add DEFAULT values for columns with aNUMBER data type.D. All the rows that have a NULL value for the SALARY column will be updated with the value5000.Answer: BSection: (none)Explanation/Reference:QUESTION 19Examine the description of the CUSTOMERS table:CUSTOMER_ID NUMBER(4) NOT NULLCUSTOMER_NAME VARCHAR2(100) NOT NULLSTREET_ADDRESS VARCHAR2(150)CITY_ADDRESS VARCHAR2(50)STATE_ADDRESS VARCHAR2(50)PROVINCE_ADDRESS VARCHAR2(50)COUNTRY_ADDRESS VARCHAR2(50)POSTAL_CODE VARCHAR2(12)CUSTOMER_PHONE VARCHAR2(20)The CUSTOMER_ID column is the primary key for the table. Which statement returns the city address and the number of customers in the cities Los Angeles or San Francisco?A. SELECT city_address, COUNT(*)FROM customersWHERE city_address IN ('Los Angeles', 'San Francisco');B. SELECT city_address, COUNT(*) - Make You Succeed To Pass IT ExamsCertkey 1Z0-007FROM customersWHERE city_address IN ('Los Angeles', 'San Francisco') GROUP BY city_address;C. SELECT city_address, COUNT(customer_id)FROM customersWHERE city_address IN ('Los Angeles', 'San Francisco') GROUP BY city_address,customer_id;D. SELECT city_address, COUNT(customer_id)FROM customersGROUP BY city_address IN ('Los Angeles', 'San Francisco');Answer: BSection: (none)Explanation/Reference:QUESTION 20Click the Exhibit button to examine the structures of the EMPLOYEES, DEPARTMENTS, and TAX tables.For which situation would you use a nonequijoin query?A. to find the tax percentage for each of the employeesB. to list the name, job_id, and manager name for all the employeesC. to find the name, salary, and the department name of employees who are not working withSmithD. to find the number of employees working for the Administrative department and earningless than 4000E. to display name, salary, manager ID, and department name of all the employees, even ifthe employees do not have a department ID assigned - Make You Succeed To Pass IT ExamsCertkey 1Z0-007Answer: ASection: (none)Explanation/Reference:QUESTION 21The EMP table contains these columns:LAST_NAME VARCHAR2 (25)SALARY NUMBER (6,2)DEPARTMENT_ID NUMBER (6)You need to display the employees who have not been assigned to any department. You write the SELECT statement:SELECT LAST_NAME, SALARY, DEPARTMENT_IDFROM EMPWHERE DEPARTMENT_ID = NULL;What is true about this SQL statement ?A. The SQL statement displays the desired results.B. The column in the WHERE clause should be changed to display the desired results.C. The operator in the WHERE clause should be changed to display the desired results.D. The WHERE clause should be changed to use an outer join to display the desired results. Answer: CSection: (none)Explanation/Reference:QUESTION 22Which two statements about sequences are true? (Choose two.)A. You use a NEXTVAL pseudo column to look at the next possible value that would begenerated from a sequence, without actually retrieving the value.B. You use a CURRVAL pseudo column to look at the current value just generated from asequence, without affecting the further values to be generated from the sequence.C. You use a NEXTVAL pseudo column to obtain the next possible value from a sequence byactually retrieving the value from the sequence.D. You use a CURRVAL pseudo column to generate a value from a sequence that would beused for a specified database column.E. If a sequence starting from a value 100 and incremented by 1 is used by more than oneapplication, then all of these applications could have a value of 105 assigned to theircolumn whose value is being generated by the sequence.F. You use a REUSE clause when creating a sequence to restart the sequence once itgenerates the maximum value defined for the sequence.Answer: BCSection: (none)Explanation/Reference:QUESTION 23What is true of using group functions on columns that contain NULL values? - Make You Succeed To Pass IT ExamsCertkey 1Z0-007A. Group functions on columns ignore NULL values.B. Group functions on columns returning dates include NULL values.C. Group functions on columns returning numbers include NULL values.D. Group functions on columns cannot be accurately used on columns that contain NULLvalues.E. Group functions on columns include NULL values in calculations if you use the keywordINC_NULLS.Answer: ASection: (none)Explanation/Reference:QUESTION 24Which SQL statement generates the alias Annual Salary for the calculated column SALARY*12?A. SELECT ename, salary*12 'Annual Salary'FROM employees;B. SELECT ename, salary*12 "Annual Salary"FROM employees;C. SELECT ename, salary*12 AS Annual SalaryFROM employees;D. SELECT ename, salary*12 AS INITCAP("ANNUAL SALARY") FROM employeesAnswer: BSection: (none)Explanation/Reference:QUESTION 25Click the Exhibit button and examine the data in the EMPLOYEES and DEPARTMENTS tables. You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use? - Make You Succeed To Pass IT ExamsCertkey 1Z0-007A. SELECT last_name, department_nameFROM employees NATURAL JOIN departments;B. SELECT last_name, department_nameFROM employees JOIN departments ;C. SELECT last_name, department_nameFROM employees e JOIN departments dON (e.department_id = d.department_id);D. SELECT last_name, department_nameFROM employees eRIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E. SELECT last_name, department_nameFROM employees FULL JOIN departmentsON (e.department_id = d.department_id);F. SELECT last_name, department_nameFROM employees e LEFT OUTERJOIN departments d ON (e.department_id = d.department_id);Answer: FSection: (none)Explanation/Reference:QUESTION 26Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP table?A. CREATE TABLE EMP(empno NUMBER(4),ename VARCHAR2(35),deptno NUMBER(7,2) NOT NULL,CONSTRAINT emp_deptno_fk FOREIGN KEY deptnoREFERENCES dept deptno);B. CREATE TABLE EMP(empno NUMBER(4),ename VARCHAR2(35),deptno NUMBER(7,2)CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));C. CREATE TABLE EMP(empno NUMBER(4),ename VARCHAR2(35),deptno NUMBER(7,2) NOT NULL,CONSTRAINT emp_deptno_fk REFERENCES dept (deptno)FOREIGN KEY (deptno));D. CREATE TABLE EMP(empno NUMBER(4),ename VARCHAR2(35), - Make You Succeed To Pass IT ExamsCertkey 1Z0-007deptno NUMBER(7,2) FOREIGN KEYCONSTRAINT emp_deptno_fk REFERENCES dept (deptno)); Answer: BSection: (none)Explanation/Reference:QUESTION 27Click the Exhibit button and examine the data in the EMPLOYEES table. Which three subqueries work? (Choose three.)A. SELECT *FROM employeeswhere salary > (SELECT MIN(salary)FROM employeesGROUP BY department_id);B. SELECT *FROM employeesWHERE salary = (SELECT AVG(salary)FROM employeesGROUP BY department_id);C. SELECT distinct department_idFROM employeesWHERE salary > ANY (SELECT AVG(salary)FROM employeesGROUP BY department_id);D. SELECT department_idFROM employeesWHERE salary > ALL (SELECT AVG(salary)FROM employeesGROUP BY department_id);E. SELECT last_nameFROM employeesWHERE salary > ANY (SELECT MAX(salary)FROM employeesGROUP BY department_id);F. SELECT department_idFROM employeesWHERE salary > ALL (SELECT AVG(salary) - Make You Succeed To Pass IT ExamsCertkey 1Z0-007FROM employeesGROUP BY AVG(SALARY));Answer: CDESection: (none)Explanation/Reference:QUESTION 28Which SQL statement accepts user input for the columns to be displayed, the table name, and the WHERE condition?A. SELECT &1, "&2"FROM &3WHERE last_name = '&4';B. SELECT &1, '&2'FROM &3WHERE '&last_name = '&4'';C. SELECT &1, &2FROM &3WHERE last_name = '&4';D. SELECT &1, '&2'FROM EMPWHERE last_name = '&4';Answer: CSection: (none)Explanation/Reference:QUESTION 29Evaluate these two SQL statements:SELECT last_name, salary , hire_dateFROM EMPLOYEESORDER BY salary DESC;SELECT last_name, salary , hire_dateFROM EMPLOYEESORDER BY 2 DESC;What is true about them?A. The two statements produce identical results.B. The second statement returns a syntax error.C. There is no need to specify DESC because the results are sorted in descending order bydefault.D. The two statements can be made to produce identical results by adding a column alias forthe salary column in the second SQL statement.Answer: ASection: (none)Explanation/Reference:QUESTION 30 - Make You Succeed To Pass IT ExamsCertkey 1Z0-007In which scenario would an index be most useful?A. The indexed column is declared as NOT NULL.B. The indexed columns are used in the FROM clause.C. The indexed columns are part of an expression.D. The indexed column contains a wide range of values.Answer: DSection: (none)Explanation/Reference:QUESTION 31Which SELECT statement should you use to extract the year from the system date and display it in the format "1998"?A. SELECT TO_CHAR(SYSDATE,'yyyy')FROM dual;B. SELECT TO_DATE(SYSDATE,'yyyy')FROM dual;C. SELECT DECODE(SUBSTR(SYSDATE, 8), 'YYYY')FROM dual;D. SELECT DECODE(SUBSTR(SYSDATE, 8), 'year')FROM dual;E. SELECT TO_CHAR(SUBSTR(SYSDATE, 8,2),'yyyy')FROM dual;Answer: ASection: (none)Explanation/Reference:QUESTION 32Examine the description of the EMPLOYEES table:EMP_ID NUMBER(4) NOT NULLLAST_NAME VARCHAR2(30) NOT NULLFIRST_NAME VARCHAR2(30)DEPT_ID NUMBER(2)Which statement produces the number of different departments that have employees with last name Smith?A. SELECT COUNT(*)FROM employeesWHERE last_name='Smith';B. SELECT COUNT(dept_id)FROM employeesWHERE last_name='Smith';C. SELECT DISTINCT(COUNT(dept_id))FROM employeesWHERE last_name='Smith'; - Make You Succeed To Pass IT ExamsCertkey 1Z0-007D. SELECT COUNT(DISTINCT dept_id)FROM employeesWHERE last_name='Smith';E. SELECT UNIQUE(dept_id)FROM employeesWHERE last_name='Smith';Answer: DSection: (none)Explanation/Reference:QUESTION 33Examine the description of the MARKS table:STD_ID NUMBER(4)STUDENT_NAME VARCHAR2(30)SUBJ1 NUMBER(3)SUBJ2 NUMBER(3)SUBJ3 NUMBER(3)SUBJ1, SUBJ2, and SUBJ3 indicate the marks (grades) obtained by a student in the three subjects.Which two statements are valid? (Choose two.)A. SELECT SUM(subj1, subj2, subj3)FROM marks;B. SELECT SUM(subj1 + subj2 + subj3)FROM marks;C. SELECT SUM(subj1), SUM(subj2), SUM(subj3)FROM marks;D. SELECT MAX(subj1, subj2, subj3)FROM marks;E. SELECT MINIMUM(subj1)FROM marks;F. SELECT COUNT(std_id)FROM marksWHERE subj1 >= AVG(subj1);Answer: BCSection: (none)Explanation/Reference:QUESTION 34Which are iSQL*Plus commands? (Choose all that apply.)A. INSERTB. UPDATEC. SELECTD. DESCRIBEE. DELETE - Make You Succeed To Pass IT ExamsCertkey 1Z0-007F. RENAMEAnswer: DSection: (none)Explanation/Reference:QUESTION 35Which three SELECT statements display 2000 in the format "$2,000.00"? (Choose three.)A. SELECT TO_CHAR(2000, '$#,###.##')FROM dual;B. SELECT TO_CHAR(2000, '$0,000.00')FROM dual;C. SELECT TO_CHAR(2000, '$9,999.00')FROM dual;D. SELECT TO_CHAR(2000, '$9,999.99')FROM dual;E. SELECT TO_CHAR(2000, '$2,000.00')FROM dual;F. SELECT TO_CHAR(2000, '$N,NNN.NN')FROM dual;Answer: BCDSection: (none)Explanation/Reference:QUESTION 36What does the FORCE option for creating a view do?A. creates a view with constraintsB. creates a view even if the underlying parent table has constraintsC. creates a view in another schema even if you don't have privilegesD. creates a view regardless of whether or not the base tables existAnswer: DSection: (none)Explanation/Reference:QUESTION 37Click the Exhibit button to examine the structure of the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables.Two new departments are added to your company as shown:DEPARTMENT_ID DEPARTMENT_NAME MGR_ID LOCATION_ID9998 Engineering 1239999 AdministrativeBostonYou need to list the names of employees, the department IDs, the department names, and the cities where the departments are, even if there are no employees in the departments and even if the departments are not yet assigned to a location. You need to join the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables to retrieve this information. - Make You Succeed To Pass IT ExamsCertkey 1Z0-007Which statement do you execute to retrieve this information?A. SELECT st_name, d.department_id,B. department_name, l.cityFROM departments dRIGHT OUTER JOIN employees eON d.department_id = e.department_idRIGHT OUTER JOIN locations lON d.location_id = l.location_id;C. SELECT st_name, d.department_id,D. department_name, l.cityFROM departments dFULL OUTER JOIN employees eON d.department_id = e.department_idFULL OUTER JOIN locations lON d.location_id = l.location_id;E. SELECT st_name, d.department_id,F. department_name, l.cityFROM departments dLEFT OUTER JOIN employees eON d.department_id = e.department_idLEFT OUTER JOIN locations lON d.location_id = l.location_id;G. SELECT last_name, department_id,department_name, cityFROM departments d - Make You Succeed To Pass IT Exams Certkey 1Z0-007NATURAL JOIN employees eNATURAL JOIN locations l;Answer: CSection: (none)Explanation/Reference:QUESTION 38What is true about joining tables through an equijoin?A. You can join a maximum of two tables through an equijoin.B. You can join a maximum of two columns through an equijoin.C. You specify an equijoin condition in the SELECT or FROM clauses of a SELECTstatement.D. To join two tables through an equijoin, the columns in the join condition must be primarykey and foreign key columns.E. You can join n tables (all having single column primary keys) in a SQL statement byspecifying a minimum of n-1 join conditions.Answer: ESection: (none)Explanation/Reference:QUESTION 39Which two statements are true about constraints? (Choose two.)A. The UNIQUE constraint does not permit a null value for the column.B. A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.C. The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.D. The NOT NULL constraint ensures that null values are not permitted for the column. Answer: BDSection: (none)Explanation/Reference:QUESTION 40Which two statements complete a transaction? (Choose two.)A. DELETE employees;B. DESCRIBE employees;C. ROLLBACK TO SAVEPOINT C;D. GRANT SELECT ON employees TO SCOTT;E. ALTER TABLE employeesSET UNUSED COLUMN sal;F. SELECT MAX(sal)FROM employeesWHERE department_id = 20;Answer: DESection: (none)。

相关文档
最新文档