【1Z0-051点滴积累】Q1~Q10 (2011-09-10)

Q1.  SELECT promo_category FROM promotions

        MINUS
        SELECT promo_category FROM promotions
        WHERE promo_subcategory = 'discount';
        SELECT promo_category FROM promotions
        INTERSECT
        SELECT promo_category FROM promotions
        WHERE promo_subcategory <> 'discount';
Q2. UPDATE promotions SET promo_cost = promo_cost + 100
       WHERE TO_CHAR(promo_end_date,'yyyy') > '2000';
       SELECT promo_begin_date FROM promotions
       WHERE TO_CHAR(pro_begin_date,'mon dd yy') = 'jul 01 98';
Q3. CURRVAL is used to refer to the last sequence number that has been generated.
       When the MAXVALUE  limit for a sequence for reached , you can increase the MAXVALUE limit by     using the ALTER SEQUENCE statement.
Q4. CREATE TABLE product
       (pcode                  number(2),
        pname                 varchar2(10)
       );
       INSERT INTO product VALUES (1, 'pen');
       INSERT INTO product VALUES (2, 'pencil');
       SAVEPOINT a;
       UPDATE product SET pcode = 10 WHERE pcode = 1;
       SAVEPOINT b;
       DELETE FROM product WHERE pcode = 2;
       COMMIT;
       DELETE FROM product WHERE pcode = 10;
       ROLLBACK to SAVEPOINT a;
       The ROLLBACK generates an error.
       NO SQL statements are rolled back.
Q5. COMMIT, CREATE, ROLLBACK statement/commands would cause a transaction to end.
Q6. SELECT INTERVAL '300' MONTH,
                         INTERVAL '54-2' YEAR TO MONTH,
                         INTERVAL '11:12:10.1234567' HOUR TO SECOND
        FROM dual;
        OUTPUT: +25-00, +54-02, +00 11:12:10.1234567
Q7. Subqueries can contain GROUP BY and ORDER BY clauses
       Main query and subquery can get data from different tables
       Multiple columns or expressions can be compared between the main query and subquery
Q8. UPDATE customers SET cust_credit_limit = null 
       WHERE cust_income_level IS NULL;
Q9. The default internal storage of dates is in the numeric format.
       The RR date format automatically calculates the century from the SYSDATE function but allows the user to entry the century if required.
Q10. A view that is created with the subquery having the pseudo column ROWNUM keyword cannot be updated.
         A Data Manipulation Language (DML) operation can be performed on a view that is created with the subquery having all the NOT NULL columns of a table.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值