【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) ...
随机推荐
- JAVA_03
在Java中,理解JDK.JRE.JVM三者的区别是十分重要的; JDK JDK是Java Development Kit(Java开发工具包)的缩写,包含JRE和其他开发工具. JRE JRE是Ja ...
- TCP/IP知识总结(TCP/IP协议族读书笔记一)
一.简述TCP/IP协议 Transmission Control Protocol/Internet Protocol的简写,即传输控制协议/互联网互联协议,又名网络通信协议.是Internet最基 ...
- Taints和Tolerations
Taints和Tolerations和搭配使用的,Taints定义在Node节点上,声明污点及标准行为,Tolerations定义在Pod,声明可接受得污点. 可以在命令行为Node节点添加Taint ...
- Golang之继承,多重继承(struct)
热乎的代码来了 package main import "fmt" /* 继承 一个结构体嵌到另一个结构体,称作组合 匿名和组合的区别 如果一个struct嵌套了另一个匿名结构体, ...
- Golang作用域—坑
先举个栗子,全局作用域变量,与 := 符号声明赋值新变量 package main import "fmt" var a = "GG" func main() ...
- 如何规范移动应用交互设计?UI/UX设计师须知的11个小技巧
以下内容由Mockplus团队翻译整理,仅供学习交流,Mockplus是更快更简单的原型设计工具. 十年前,手机的使用只是为了沟通. 而近几年,情况发生了很大变化,我们很难找到不使用手机的人.手机在极 ...
- JavaScript 对象笔记
1. JS 将对象看成是属性的无序集合, 每个属性是一个key/value, 属性名是字符串, 值为任意类型; 对象除了键值对, 还从一个称为 "原型" 的 对象 继承属性(为啥是 ...
- 解决Error running 'index.jsp : Address localhost:1099 is already in use的方法
晚上在idea中 启动服务器一次后 正常运行,但是改了注解配置后 报错,报错为Error running 'index.jsp : Address localhost:1099 is alread ...
- UVa 1616 Caravan Robbers (二分+贪心)
题意:给定 n 个区间,然后把它们变成等长的,并且不相交,问最大长度. 析:首先是二分最大长度,这个地方精度卡的太厉害了,都卡到1e-9了,平时一般的1e-8就行,二分后判断是不是满足不相交,找出最长 ...
- pyhon 去除列表中重复元素
Python set() 函数 描述 set() 函数创建一个无序不重复元素集,可进行关系测试,删除重复数据,还可以计算交集.差集.并集等. 语法 set 语法: class set([iterabl ...