【OCP-12c】2019年CUUG OCP 071考试题库(74题)
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题)的更多相关文章
- 【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 ...
- 【OCP-12c】2019年CUUG OCP 071考试题库(79题)
79.Which statement is true about transactions? A. A set of Data Manipulation Language (DML) statemen ...
- 【OCP-12c】2019年CUUG OCP 071考试题库(78题)
78.View the exhibit and examine the structure of the CUSTOMERStable. Which two tasks would require s ...
- 【OCP-12c】2019年CUUG OCP 071考试题库(77题)
77.Which two statements are true about sequences created in a single instance database? (Choose two. ...
- 【OCP-12c】2019年CUUG OCP 071考试题库(76题)
76.View the exhibit and examine the description of the DEPARTMENTSand EMPLOYEEStables. The retrieve ...
- 【OCP-12c】2019年CUUG OCP 071考试题库(75题)
75.Which statements are correct regarding indexes? (Choose all that apply.) A. A non-deferrable PRIM ...
- 【OCP-12c】2019年CUUG OCP 071考试题库(73题)
73.Which statement correctly grants a system privilege? A. GRANT CREATE VIEW ON table1 TO user1; B. ...
- 【OCP题库-12c】最新CUUG OCP 071考试题库(72题)
72.View the exhibit for the structure of the STUDENTand FACULTYtables. STUDENT Name Null? Type ----- ...
- 【OCP题库-12c】最新CUUG OCP 071考试题库(71题)
71.(32-18) choose three Which three statements indicate the end of a transaction? (Choose three.) A) ...
随机推荐
- 重新设定McAfee Agent的菜单语言
默认安装的McAfee Agent,语言会根据系统中的设置,自动选择了语言. 有时想更换语言,却又不想重装McAfee Agent (以前叫 ePO Agent) 其实可以直接运行下面的命令进行重新设 ...
- C++ 获取特定进程的CPU使用率<转>
C++ 获取特定进程的CPU使用率 近来发现笔记本在关闭屏幕后风扇转得特别快,打开屏幕后看任务管理器,风扇马上减速,也没有发现大量占用CPU的进程.于是想写一个小程序在后台记录每个进程的CPU使用情况 ...
- Git 仓库 SSH、HTTP、Gitweb (Nginx) 乱炖
简介: 自己搭建 Git 仓库,实现 SSH 协议.配合 Nginx 实现 HTTP 协议拉取.推送代码. 利用 Nginx 实现 Gitweb 在线浏览代码,使用 Gitweb-theme 更新默认 ...
- Notepad++中的高级查找
准备以下字符串用来演示 abcdeab cdeabcde abcd eabcde 基于扩展的查找 基于扩展的查找不能算是真正的正则表达式搜索,因此这种查找方式仅是提供了支持转义字符.主要常用的 ...
- 迷你MVVM框架 avalonjs 1.3.3发布
大家可以在仓库中看到,多出了一个叫avalon.observe的东西,它是基于Object.observe,dataset, Promise等新API实现.其中,它也使用全新的静态收集依赖的机制,这个 ...
- iOS开源项目:AFNetworking----写得非常好
https://github.com/AFNetworking/AFNetworking 与asi-http-request功能类似的网络库,不过是基于NSURLConnection 和 NSOper ...
- 2015年传智播客JavaEE 第168期就业班视频教程day45-ERP项目-0107-其他子系统
一套ERP系统中一定会有CRM,不可能说我所有数据都是散着放的,你想用就随便写一个.你出去和人聊,一定得说我这里有什么有什么,然后你就可以和人说你做的是进销存.人家要问CRM或者说财务系统你就说那不是 ...
- leetcode 14 最长公共前缀
描述: 给个字符串vector,求最长公共前缀. 解决: 直接取第一个字符串作为最长公共前缀,将其每个字符遍历过一次.设最长字符实际为k,共n个元素,则复杂度O(nk) string longestC ...
- 基于 Web 的远程 Terminal 模拟器安装使用详解
http://lzw.me/a/shellinabox.html 一.Shellinabox 简介 Shellinabox 是一个基于 web 的终端模拟器,采用 C 语言编写,使用 Ajax 与后端 ...
- Castle ActiveRecord学习(六)数据验证
参考.来源:http://www.cnblogs.com/Terrylee/archive/2006/04/13/374173.html https://github.com/castleprojec ...