OCP-1Z0-051-V9.02-149题

OCP-1Z0-051-V9 02-96 阅读详情

149. View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables.

Evaluate the following SQL statement:

SQL> SELECT prod_id FROM costs  

WHERE promo_id IN  (SELECT promo_id FROM promotions                      

WHERE promo_cost < ALL                    

(SELECT MAX(promo_cost) FROM promotions                      

GROUP BY (promo_end_date-                                 

promo_begin_date)));

What would be the outcome of the above SQL statement?

A. It displays prod IDs in the promo with the lowest cost.

B. It displays prod IDs in the promos with the lowest cost in the same time interval.

C. It displays prod IDs in the promos with the highest cost in the same time interval.

D. It displays prod IDs in the promos with cost less than the highest cost in the same time interval.

Answer: D

 

答案解析:

1、首先查询出promo_end_date- promo_begin_date期间promo_cost的最大值

sh@TEST0924> SELECT MAX(promo_cost) FROM promotions
  2  GROUP BY (promo_end_date- promo_begin_date);
 
MAX(PROMO_COST)
---------------
              0
          98500
              0
          99900
         100000
          99000
          99300
          95900
          99600
          98000
 
10 rows selected.
 
2、<ALL,即小于1查询出来所有的的值,即小于最小值。
3、按题中查询,即查询出小于MAX(promo_cost) 的所有的值。
sh@TEST0924>  SELECT prod_id FROM costs
  2  WHERE promo_id IN  (SELECT promo_id FROM promotions
  3  WHERE promo_cost < ALL
  4  (SELECT MAX(promo_cost) FROM promotions
  5  GROUP BY (promo_end_date-
  6  promo_begin_date)));
 
 
no rows selected
 
OCP-1Z0-051149 子查询中ALL的应用 一、原 View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables. Evaluate the following SQL statement: SQL>SELECT prod_id   FROM costs  WHERE promo_id IN        (SELECT prom 阅读详情

相关推荐

149.View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables.

149.View the Exhibits and examine the structures of the COSTS and PROMOTIONS tables.

dwj19830118的专栏 1176

Oracle 19c OCP 1Z0-082认证考试库(51-60

51.View the Exhibit and examine the description of the tables You execute this SQL statement Which three statements are true? A.The sales table has five foreign keys B.The statement will execute successfully and a new row will be inserted into the SALES ta

姚远OracleACE的博客 2685

1z0-071 Oracle Database 12c SQL 第72 less than the highest

Q72. View the exhibits and examine the structures of the COSTS and PROMOTIONS tables.Evaluate the following SQL statement:SQL&gt; SELECT prod_id FROM costsWHERE promo_id IN (SELECT promo_id FROM promo...

点滴的幸福 967

ocp 1Z0-051 141-175解析

141. View the Exhibitand examine the structure of CUSTOMERS and GRADES tables. You need to displaynames and grades of customers who have the highest credit limit. Which two SQL statementswould accom

Database、Code 7732

OCP-1Z0-051-V9 02-32

OCP-1Z0-051-V9 02-32

sdfsdkk的博客 371

OCP-1Z0-051-V9.02-1

1. View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables. The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.

一抹曦阳-Oracle 1万+

OCP-1Z0-051-V9.02-14

14. Using the CUSTOMERS table,  you need to generate a report that shows 50% of each   credit amount in each income level. The report should NOT show any repeated credit amounts in each income l

一抹曦阳-Oracle 9994

OCP-1Z0-051-V9 02-152

OCP-1Z0-051-V9 02-152

sdfsdkk的博客 533

OCP-1Z0-051-V9.02-157

157. View the Exhibit and examine the structure of the ORDERS and CUSTOMERS tables. Evaluate the following SQL command: SQL> SELECT o.order_id, c.cust_name, o.order_total, c.credit_limit FROM order

一抹曦阳-Oracle 7627

OCP-1Z0-051-V9.02-148

148. View the Exhibit and examine the structure of the PRODUCTS tables. You want to generate a report that displays the average list price of product categories where the average list price is l

一抹曦阳-Oracle 7715

OCP-1Z0-051-V9.02-2

2. View the Exhibit to examine the description for the SALES table. Which views can have all DML operations performed on it? (Choose all that apply.)  A. CREATE VIEW v3 AS SELECT * FROM SALES  

一抹曦阳-Oracle 1万+

OCP-1Z0-051-V9.02-82

82. Examine the data in the CUST_NAME column of the CUSTOMERS table. CUST_NAME Renske Ladwig Jason Mallin Samuel McCain Allan MCEwen Irene Mikkilineni Julia Nayer You need to display customers

一抹曦阳-Oracle 9412

OCP-1Z0-051-V9.02-6

6. Examine the structure of the SHIPMENTS table: name           Null       Type PO_ID          NOT NULL    NUMBER(3) PO_DATE        NOT NULL    DATE SHIPMENT_DATE NOT NULL    DATE SHIPMENT_MODE  

一抹曦阳-Oracle 1万+

OCP-1Z0-051-V9.02-90

90. Examine the structure and data in the PRICE_LIST table:  name             Null       Type PROD_ID         NOT NULL     NUMBER(3)  PROD_PRICE                  VARCHAR2(10)   PROD_ID    PROD_P

一抹曦阳-Oracle 1万+

OCP-1Z0-051-V9.02-119

119. Examine the data in the ORD_ITEMS table: ORD_NO     ITEM_NO    QTY 1          111        10 1          222        20 1          333        30 2          333        30 2          444 

一抹曦阳-Oracle 9470

OCP-1Z0-051-V9.02-91

91. View the Exhibit and examine the structure of the PROMOTIONS table. Which two SQL statements would execute successfully? (Choose two.) A. UPDATE promotions SET promo_cost = promo_cost+ 1

一抹曦阳-Oracle 1万+

OCP-1Z0-051-V9.02-94

94. Examine the structure of the PROGRAMS table: name            Null        Type PROG_ID         NOT NULL    NUMBER(3) PROG_COST                  NUMBER(8,2) START_DATE      NOT NULL   

一抹曦阳-Oracle 9367

OCP-1Z0-051-V9.02-100

100. View the Exhibit and examine the structure of the PROMOTIONS table. Which SQL statements are valid?  (Choose all that apply.)  A. SELECT promo_id, DECODE(NVL(promo_cost,0), promo_cost,       

一抹曦阳-Oracle 1万+
上一篇: OCP-1Z0-051-V9.02-148题
下一篇: OCP-1Z0-051-V9.02-151题
Riveore
博客等级 码龄19年 1801粉丝 1432原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值