Chinaunix首页 | 论坛 | 博客
  • 博客访问: 667188
  • 博文数量: 487
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4936
  • 用 户 组: 普通用户
  • 注册时间: 2018-07-05 13:59
个人简介

ocp考试资料群:569933648 验证码:ocp OCP 12c 19c考试题库解析与资料群:钉钉群号:35277291

文章分类

全部博文(487)

文章存档

2024年(2)

2023年(37)

2021年(151)

2020年(37)

2019年(222)

2018年(38)

我的朋友

分类: Oracle

2019-03-18 14:15: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 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, o.order_date, 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, o.order_date, 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, o.order_date, 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"就是正确的。

阅读(1988) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~