博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【OCP-12c】2019年CUUG OCP 071考试题库(80题)
阅读量:5925 次
发布时间:2019-06-19

本文共 1246 字,大约阅读时间需要 4 分钟。

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"就是正确的。

转载于:https://www.cnblogs.com/cnblogs5359/p/10551948.html

你可能感兴趣的文章
mysql数据库(二)
查看>>
js与jsp
查看>>
vsftpd服务
查看>>
HTML基础
查看>>
将U盘虚拟成软驱加载控制器驱动安装windows server 2003
查看>>
Computer
查看>>
LNMP服务器安装配置(Rhel+Nginx+PHP+MySQL)
查看>>
我的友情链接
查看>>
cookie 和 session
查看>>
mysql cmake 参数详解
查看>>
防火墙
查看>>
流程再造:信息化建设的最佳拍档
查看>>
swift学习笔记-----swift中的指针
查看>>
QT-Linux开发环境的搭建
查看>>
selenium webdirver之ruby-开发ide安装
查看>>
【1】淘宝sdk装修入门引言
查看>>
迭代器
查看>>
给IT新人的15个建议:苦逼程序员的辛酸反省与总结
查看>>
BZOJ3940:[USACO]Censoring(AC自动机,栈)
查看>>
利用“多说”制作留言板、评论系统
查看>>