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. Eclipse 插件集合

    以下是我整理的自己开发过程中的常用Eclipse插件,按字母排序: (1)    AmaterasUML        介绍:Eclipse的UML插件,支持UML活动图,class图,sequenc ...

  2. 创建django的8大步骤xxx.setAttribute('name', 'user'); 添加属性和值 xxx.attr('name') 查看属性的值 $(xxx).addClass 添加样式 $().after() 添加在标签后面

    第一步.创建django 方法一:django-admin startproject 方法二: 直接在python上创建 第二步:创建工程名cmdb python manage.py startapp ...

  3. Hadoop Streaming:aggregate

    [Hadoop Streaming:aggregate] 1.实例1 测试文件test.txt mapper程序: 运行: $hadoop streaming -input /app/test.txt ...

  4. 并发包下常见的同步工具类详解(CountDownLatch,CyclicBarrier,Semaphore)

    目录 1. 前言 2. 闭锁CountDownLatch 2.1 CountDownLatch功能简介 2.2 使用CountDownLatch 2.3 CountDownLatch原理浅析 3.循环 ...

  5. for 续4

    ---------siwuxie095             (四)tokens=x,y,m-n 显示指定的列     tokens=x 只显示第 x 列 tokens=x,y,z 只显示第 x,y ...

  6. CentOS6,7不同

    centos6与centos7,防火墙,开机自启不同 6用iptables,7用firewall-cmd http://www.cnblogs.com/liyuanhong/articles/7064 ...

  7. Python 使用Pandas读取Excel的学习笔记

    这里介绍Python中使用Pandas读取Excel的方法 一.软件环境: OS:Win7 64位 Python 3.7 二.文件准备 1.项目结构: 2.在当前实验文件夹下建立一个Source文件夹 ...

  8. php解决时间超过2038年

    问题 超过2038年的时间 php怎么处理? echo date('Y-m-d',2147483647); //date函数能处理的最大整数2147483647 ->2038-01-19 就是2 ...

  9. NLTK和Stanford NLP两个工具的安装配置

    这里安装的是两个自然语言处理工具,NLTK和Stanford NLP. 声明:笔者操作系统是Windows10,理论上Windows都可以: 版本号:NLTK 3.2 Stanford NLP 3.6 ...

  10. 12个优秀的国外Material Design网站案例

    眼看2017年就快完了,你是不是还没完全搞懂Material Design呢?是嫌说明文档太长,还是觉得自己英文不好?都没关系,小编今天给大家整理了一份干货满满的学习笔记,并列举了一些国外的Mater ...