74、View the exhibit and examine the structure of ORDERS and CUSTOMERS tables.

ORDERS

Name     Null?       Type

ORDER_ID  NOT NULL  NUMBER(4)

ORDER_DATE  NOT NULL   DATE

ORDER_MODE   VARCHAR2(8)

CUSTOMER_ID NOT NULL  NUMBER(6)

ORDER_TOTAL   NUMBER(8, 2)

CUSTOMERS

Name  Null?  Type

CUSTOMER_ID  NOT NULL  NUMBER(6)

CUST_FIRST_NAME NOT NULL  VARCHAR2(20)

CUST_LAST_NAME  NOT NULL  VARCHAR2(20)

CREDIT_LIMIT  NUMBER(9,2)

CUST_ADDRESS  VARCHAR2(40)

Which INSERT statement should be used to add a row into the ORDERStable for the customer whose CUST_LAST_NAMEis Robertsand CREDIT_LIMITis 600?Assume there exists only one row with CUST_LAST_NAME as Roberts and CREDIT_LIMIT as 600.

A. INSERT INTO (SELECT o.order_id, o.order_date, o.order_mode, c.customer_id, o.order_total

FROM orders o, customers c

WHERE o.customer_id = c.customer_id AND c.cust_last_name='Roberts' AND c.credit_limit=600)

VALUES (1,'10-mar-2007', 'direct', (SELECT customer_id

FROM customers

WHERE cust_last_name='Roberts' AND credit_limit=600), 1000);

B. INSERT INTO orders (order_id, order_date, order_mode,

(SELECT customer id FROM customers

WHERE cust_last_name='Roberts' AND credit_limit=600), order_total);

VALUES (1,'10-mar-2007', 'direct', &customer_id, 1000);

C. INSERT INTO orders

VALUES (1,'10-mar-2007', 'direct',

(SELECT customer_id

FROM customers

WHERE cust_last_name='Roberts' AND credit_limit=600), 1000);

D. INSERT INTO orders (order_id, order_date, order_mode,

(SELECT customer_id FROM customers

WHERE cust_last_name='Roberts' AND credit_limit=600), order_total);

VALUES (1,'10-mar-2007', 'direct', &customer_id, 1000);

Correct Answer: C

Section: (none)

Explanation 相关的语句,注意子查询查出来的是某个列的值:

INSERT INTO emp (empno,ename,job,deptno,sal)

VALUES (1,'cuug', 'direct',

(SELECT deptno

FROM dept

WHERE dname='RESEARCH' ), 1000);

【OCP-12c】2019年CUUG OCP 071考试题库(74题)的更多相关文章

  1. 【OCP-12c】2019年CUUG OCP 071考试题库(80题)

    80.View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables. You need to create a ...

  2. 【OCP-12c】2019年CUUG OCP 071考试题库(79题)

    79.Which statement is true about transactions? A. A set of Data Manipulation Language (DML) statemen ...

  3. 【OCP-12c】2019年CUUG OCP 071考试题库(78题)

    78.View the exhibit and examine the structure of the CUSTOMERStable. Which two tasks would require s ...

  4. 【OCP-12c】2019年CUUG OCP 071考试题库(77题)

    77.Which two statements are true about sequences created in a single instance database? (Choose two. ...

  5. 【OCP-12c】2019年CUUG OCP 071考试题库(76题)

    76.View the exhibit and examine the description of the DEPARTMENTSand EMPLOYEEStables. The retrieve ...

  6. 【OCP-12c】2019年CUUG OCP 071考试题库(75题)

    75.Which statements are correct regarding indexes? (Choose all that apply.) A. A non-deferrable PRIM ...

  7. 【OCP-12c】2019年CUUG OCP 071考试题库(73题)

    73.Which statement correctly grants a system privilege? A. GRANT CREATE VIEW ON table1 TO user1; B. ...

  8. 【OCP题库-12c】最新CUUG OCP 071考试题库(72题)

    72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type ----- ...

  9. 【OCP题库-12c】最新CUUG OCP 071考试题库(71题)

    71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) ...

随机推荐

  1. struts2配置默认首页

    配置struts2 默认欢迎页的几种办法: 1.首先需要明确的是struts过滤器配置映射的模式是路径匹配还是扩展匹配,如果url-pattern配置为/*,如果不做特殊处理,是不会转到welcome ...

  2. 迷你MVVM框架 avalonjs 学习教程9、类名操作

    ms-class是avalon用得最多的几个绑定之一,也正因为如此其功能一直在扩充中.根据时期的不同,分为旧风格与新风格两种. 旧风格是指ms-class-xxx=”expr”,*ms-class-a ...

  3. 在eclipse中使用maven

    现在一般的eclipse工具中都自带的有maven插件,我们使用自带的即可,但需要修改二个参数 具体设置为: 1.设置Installations 2.设置user settings

  4. 四种常见的 POST 提交数据方式,使用postman会用到

    http://www.aikaiyuan.com/6324.html 用postman时候,选错了就出不来结果.用postman选择 application/x-www-form-urlencoded

  5. java 线程之对象的同步和异步

    一.多线程环境下的同步与异步 同步:A线程要请求某个资源,但是此资源正在被B线程使用中,因为同步机制存在,A线程请求不到,怎么办,A线程只能等待下去. package com.jalja.org.th ...

  6. [leetcode]253. Meeting Rooms II 会议室II

    Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si ...

  7. 通过Jenkins自动构建dubbo服务时的问题汇总

    最近接触新的dubbo项目,项目初始时,测试环境的提供者服务发布较频繁,奈何公司又没有自动发布工具,遂自己在测试环境中搭建了Jenkins用于dubbo服务的发布.由于第一次使用,过程中也遇到了一些问 ...

  8. 浅析JavaScript访问对象属性和方法及区别

    属性是一个变量,用来表示一个对象的特征,如颜色.大小.重量等:方法是一个函数,用来表示对象的操作,如奔跑.呼吸.跳跃等. 在JavaScript中通常使用”."运算符来存取对象的属性的值.或 ...

  9. CRC32加密算法原理

    [转]:https://blog.csdn.net/android_mnbvcxz/article/details/78902737

  10. Kubernetes基本原理与示例

    1. Kubernetes介绍 基本概念 Pod Pod是Kubernetes的基本操作单元,把相关的一个或多个容器构成一个Pod,通常Pod里的容器运行相同的应用.Pod包含的容器运行在同一个Nod ...