OCP-1Z0-051-題目解析-第2題

來源:互聯網
上載者:User

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 v3AS SELECT * FROM SALES   WHERE cust_id = 2034   WITH CHECK OPTION;

B. 

CREATE VIEW v1AS SELECT * FROM SALES   WHERE time_id <= SYSDATE - 2*365   WITH CHECK OPTION;

C. 

CREATE VIEW v2AS SELECT prod_id, cust_id, time_id FROM SALES   WHERE time_id <= SYSDATE - 2*365   WITH CHECK OPTION; 

D. 

CREATE VIEW v4AS SELECT prod_id, cust_id, SUM(quantity_sold) FROM SALES   WHERE time_id <= SYSDATE - 2*365   GROUP BY prod_id, cust_id   WITH CHECK OPTION;

Answer: AB

題目解析:

題目是問,哪個視圖可以執行所有的DML操作,我們知道要在視圖上執行insert操作,那麼該視圖就要包含基表所有的非空欄位,所以可以明顯的判斷出來C和D是錯誤的,另外D選項的SUM(quantity_sold) 也是錯誤的,該欄位必須要添加別名。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.