OCP-047 CREATE VIEW 必须指定列别名

来源:互联网 发布:数据代码10054 编辑:程序博客网 时间:2024/06/05 06:47

考点:创建视图必须指定列别名 ,否则创建视图的时候会提示ora-00998  错误信息

18. View the Exhibit and examine the data 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 successfully?
A. 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.

B. 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.

C. CREATE OR REPLACE VIEW ord_vu
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.
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

WITH CHECK OPTION.

Answer: B

原创粉丝点击