加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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

发布时间:2020-12-14 04:37:04 所属栏目:大数据 来源:网络整理
导读:80、View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables. You need to create a view that displays the ORDER_ID,ORDER_DATE,and the total number of items in each order. Which CREATE VIEW statement would create the view

80、View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables.

You need to create a view that displays the ORDER_ID,ORDER_DATE,and the total number of items in each order.

Which CREATE VIEW statement would create the views successfully?

A . AS SELECT o.order_id,o.order_date,COUNT (i.line_item_id)

FROM orders o JOIN order_items i

ON (o.order_id = i.order_id)

GROUP BY o.order_id,o.order_date;

?

B. CREATE OR REPLACE VIEW ord_vu (order_id,order_date)

AS SELECT o.order_id,COUNT (i.line_item_id)

"NO OF ITEMS"

FROM orders o JOIN order_items i ON

(o.order_id = i.order_id) GROUP BY o.order_id,

o.order_date;

?

C. CREATE OR REPLACE VIEW ord_vu

AS SELECT o.order_id,COUNT (i.line_item_id)

"NO OF ITEMS"

FROM orders o JOIN order_items i

ON (o.order_id = i.order_id) GROUP BY

o.order_id,o.order_date;

?

D. CREATE OR REPLACE VIEW ord_vu

AS SELECT o.order_id,COUNT (i.line_item_id) ||

"NO OF ITEMS"

FROM orders o JOIN order_items i

ON (o.order_id = i.order_id) GROUP BY

o.order_id,o.order_date

WHITH CHECK OPTION;

Correct Answer: C

Section: (none) Explanation:A答案会报错:ORA-00998: 必须使用列别名命名此表达式,缺少一个别名;B答案视图缺少一个列名,如果加上"NO OF ITEMS"就是正确的。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读