版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1Z0-051V9.02156-160EvaluatethefollowingSQLSQL>SELECTcust_id,cust_last_name"LastName"FROMcustomersWHEREcountry_id=10SELECTcust_idCUST_NO,cust_last_nameFROMcustomersWHEREcountry_id=WhichORDERBYclausesarevalidfortheabovequery?(Chooseallthatapply.)ORDERBYORDERBYORDERBYORDERBYORDERBY"LastORDERORDERBY子句是有效的(选择所有正确的选项ORDERBYselect语句后的第几个字段,也可以使用列名。BD选项不正确,因为只能使用第一个查询的列进行排序,包括别名、列名或表达SELECTcust_id,cust_last_name"LastFROMWHEREcountry_id=10SELECTcust_idCUST_NO,FROMWHEREcountry_id=--ORDERBY2,1----ORDERBYCUST_NO--B.----ORDERBY2,cust_id----ORDERBY"CUST_NO"--D.----ORDERBY"LastName"--/*/*集合运算结果列表的列名以第一个SELECTselectcust_id,"LastName"fromSELECTcust_id,cust_last_name"LastFROMWHEREcountry_id=10SELECTcust_idCUST_NO,FROMWHEREcountry_id=--selectCUST_NO,cust_last_namefromSELECTcust_id,cust_last_name"LastFROMWHEREcountry_id=minus--此处集合运算符可以包括:交intersect,并union/unionall,差SELECTcust_idCUST_NO,FROMWHEREcountry_id=)ViewtheExhibitandexaminethestructureoftheORDERSandCUSTOMERStables.EvaluatethefollowingSQLSQL>SELECTo.order_id,c.cust_name,o.order_total,c.credit_limitFROMordersoJOINcustomerscUSING(customer_id)WHEREo.order_total>c.credit_limitFORUPDATEORDERBYWhichtwostatementsaretrueregardingthe eoftheabovequery?(Choosetwo.)ItlocksalltherowsthatsatisfytheconditionintheItlocksonlythecolumnsthatsatisfytheconditioninboththetables.ThelocksarereleasedonlywhenaCOMMITorROLLBACKisThelocksarereleasedafteraDMLstatementisexecutedonthelockedrows.SQL命令:关于上面查询的结果哪两句话是正确的?(2项)只有执 AA选项正确,selectforupdateselect出来的所有行,以防果在其它会话中在被锁定的行上做DML操作,则会被阻塞。DROPTABLEcreatetables157(sidnumber,snamevarchar2(2),s_reqnumber);insertintos157values(1,'ZS',60);insertintos157values(2,'LS',75);insertintos157DROPTABLEcreatetablesc157(sid amevarchar2(2),scorenumber);insertintosc157values(1,'EN',59);insertintosc157values(2,'EN',76);insertintosc157select*froms157whereselect*froms157wheresid=1forupdates157sets_req=60whereSELECTSID,S.Sname,SC.SCORE,FROMs157SJOINsc157ScUSING(SID)WHERESC.SCORE>FORUPDATEORDERBYS.Sname;--在另一个会话执行下面的语句,不受影响,因为SID=1的行未被锁UPDATESC157SETSCORE=58WHERESID=1;UPDATES157SETS_REQ=61WHERESID=1;--在另一个会话执行下面的语句排队等待,因为SID为2和3的行被锁UPDATESC157SETSCORE=77WHEREUPDATEUPDATES157SETS_REQ=70WHERE行WhichstatementsaretrueregardingtheFORUPDATEclauseinaSELECTstatement?(Chooseallthatapply.)ItlocksonlythecolumnsspecifiedintheSELECTItlockstherowsthatsatisfytheconditionintheSELECTItcanbeusedonlyinSELECTstatementsthatarebasedonasingletable.ItcanbeusedinSELECTstatementsthatarebasedonasingleormultipletables.AfteritisendbyaSELECTstatement,nootherqueryaccessthesamerowsuntilaCOMMITorROLLBACKisSELECTCOMMITROLLBACK后才能B选项正确,forupdateselectC选项不正确,selectforupdate可以用于基于一张表,也可以基于多张DE选项,forupdate语句执行之后,其它查询不能变更这些相关的行,但是不影响查SELECTSIDFROMS157WHERESID=1FOR--另一个会话中运行,出现了一直等待updates157setSname='WB'where--C,--C,下列语句锁定了两张表,每张表锁定了2SELECTSID,S.Sname,SC.SCORE,FROMs157SJOINsc157ScUSING(SID)WHERESC.SCORE>FORUPDATEORDERBYS.Sname;ViewtheExhibitandexaminethestructureoftheCUSTOMERSNEW_CUSTOMERSisanewtablewiththecolumnsCUST_ID,CUST_NAMEandCUST_CITYthathavethesamedatatypesandsizeasthecorrespondingcolumnsintheCUSTOMERStable.EvaluatethefollowingINSERTINSERTINTOnew_customers(cust_id,cust_name,cust_city)(SELECTcust_id,cust_first_name||''||cust_last_name,FROMWHEREcust_id>TheINSERTstatementfailswhenexecuted.WhatcouldbetheTheVALUESclausecannotbeusedinanINSERTwithaColumnnamesintheNEW_CUSTOMERSandCUSTOMERStablesdonotTheWHEREclausecannotbeusedinasubqueryembeddedinanINSERTstatement.ThetotalnumberofcolumnsintheNEW_CUSTOMERStabledoesnotmatchthetotalnumberofcolumnsintheCUSTOMERStable.NEW_CUSTOMERSNEW_CUSTOMERSCUST_IDCUST_NAMEandCUST_CITY列的CUSTOMERS相同.A.VALUESINSERT语句。B.NEW_CUSTOMERSCUSTOMERS表不匹配。droptablecreatetablenew_customers(cust_idnumber,varchar2(30),cust_cityINSERTINTO(cust_id,cust_name,cust_city)(SELECTcust_id,cust_first_name||'FROMWHEREcust_id>23004);--INSERTINTO(cust_id,cust_name,SELECTcust_id,cust_first_name||''||cust_last_name,FROMWHEREcust_id>ViewtheExhibitandexaminethestructureofORDERSandCUSTOMERStables.Thereisonlyonecustomerwiththecust_last_namecolumnhavingvalueRoberts.WhichINSERTstatementshouldbeusedtoaddarowintotheORDERStableforthecustomerwhoseCUST_LAST_NAMEisRobertsandCREDIT_LIMITis600?INSERTINTOorders(SELECTcustomer_idFROMcustomersWHEREcust_last_name='Roberts'ANDcredit_limit=600),INSERTINTOorders(SELECTcustomer_idFROMcustomersWHEREcust_last_name='Roberts'ANDcredit_limit=600),(1,'10-mar-2007','direct',&&customer_id,1000);C.INSERTINTO(SELECTFROMorderso,customersWHEREo.customer_id=ANDc.cust_last_name='Roberts'ANDc.credit_limit=600)(SELECTcustomer_idFROMcustomersWHEREcust_last_name='Roberts'ANDcredit_limit=600),D.INSERTINTOorders(SELECTcustomer_idFROMcustomersWHEREcust_last_name='Roberts'ANDcredit_limit=600),(1,'10-mar-2007','direct',&customer_id,ORDERSandORDERSandCUSTOMERSSELECTcustomer_idFROMWHEREcust_last_name=ANDcredit_limit=updateupdatecustomerssetcust_last_name=cu
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 心血管疾病遗传易感性的地域差异
- 心血管介入治疗并发症管理策略
- 心脏移植术后CMV感染的预防:供者筛查策略
- 心脏淀粉样病合并肺部感染的防治策略
- 心肌病纤维化影像学检查方法的选择策略
- 心理学在职业健康行为干预中的应用
- 心理健康传播与公众教育策略
- 微创技术推广中的文化差异与人文适应策略
- 微创三叉神经微血管减压术的住院时间缩短效果
- 影像引导手术安全与风险防控
- 2025广东深圳市光明区事业单位选聘博士20人笔试备考试题及答案解析
- 红色大气2026马年期末汇报展示
- 2026年及未来5年市场数据中国钓具市场竞争策略及行业投资潜力预测报告
- (2025)70周岁以上老年人换长久驾照三力测试题库(含参考答案)
- 探究4工业课件2026年中考地理一轮专题复习(河北)
- 党的二十届四中全会精神丨线上知识有奖竞答题库
- 销售案场保安主管述职报告
- 2025-2026学年人教版高中英语必修第一册知识点总结(核心主题+重点单词与短语+重点句型+核心语法)清单
- SF-36健康调查简表标准化操作手册(2025年更新版)
- 房地产开发公司建立质量保证体系情况说明
- 伤口造口院内专科护士护理考核试题与答案
评论
0/150
提交评论