The SQL syntax for the OCP 001

Source: Internet
Author: User

2. View the Exhibit to examine the description for the SALES table. Which views can has all DML operations performed on it? (Choose all, apply.)

Create TableSales (prod_id Number  not NULL, cust_id Number  not NULL, time_id date not NULL, channel_id Number  not NULL, promo_id Number  not NULL, Quantity_sold Number(Ten,2) not NULL);

A.CREATE VIEWv3 as SELECT *  fromSALESWHEREcust_id= 2034 with CHECK OPTION; B.CREATE VIEWv1 as SELECT *  fromSALESWHEREtime_id<=Sysdate- 2*365 with CHECK OPTION; C.CREATE VIEWv2 as SELECTprod_id, cust_id, time_id fromSALESWHEREtime_id<=Sysdate- 2*365 with CHECK OPTION;D.CREATE VIEWV4 as SELECTprod_id, cust_id,SUM(Quantity_sold) fromSALESWHEREtime_id<=Sysdate- 2*365GROUP  byprod_id, cust_id with CHECK OPTION; Answer:ab

CD option, the view created does not contain all fields, the view does not contain fields when the default is blank, and all fields of the sales table are not nullable, so the view created by the CD option cannot complete the insert operation.

Sql> Insert  intoV2Values(1,2, sysdate);Insert  intoV2Values(1,2, Sysdate)*ERROR at line1: ORA-01400: CannotInsert NULL  into("SCOTT".) SALES "." channel_id ")

And the V3 view can

Sql> Insert  intoV3Values(1,2034, Sysdate,1,1,1);1row created. SQL> Commit;CommitComplete . SQL> Select *  fromv3; prod_id cust_id time_id channel_id promo_id quantity_sold---------- ---------- ------------------ ---------- ---------- -------------     1     2034 Geneva-JAN- -           1         1           1

5. Which SQL statements would display the value 1890.55 as $1,890.55? (Choose three.)

A.SELECTTo_char (1890.55,'$0g000d00') fromDUAL; B.SELECTTo_char (1890.55,'$9,999v99') fromDUAL; C.SELECTTo_char (1890.55,'$99,999d99') fromdual;d.SELECTTo_char (1890.55,'$99g999d00') fromDUAL; E.SELECTTo_char (1890.55,'$99g999d99') fromDUAL; Answer:ade

Note that the letter class, such as D, and the symbol class, such as ",", can only appear one, cannot appear at the same time, so exclude the C option.

Sql> SelectTo_char (1890.55,'$99,999d99') fromdual;SelectTo_char (1890.55,'$99,999d99') fromDual*ERROR at line1: ORA-01481: invalid NumberFormat model

The SQL syntax for the OCP 001

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.