• OCP-1Z0-051-V9.02-150题


    150. View the Exhibit and examine the data in the PROMOTIONS table.

    You need to display all promo categories that do not have 'discount' in their subcategory.

    Which two SQL statements give the required result? (Choose two.)

     

    A. SELECT promo_category

    FROM promotions

    MINUS

    SELECT promo_category

    FROM promotions

    WHERE promo_subcategory = 'discount';

    所有promo_category 减去包含promo_subcategory = 'discount'的,符合题意。

    B. SELECT promo_category

    FROM promotions

    INTERSECT 交集

    SELECT promo_category

    FROM promotions

    WHERE promo_subcategory = 'discount';

    所有promo_category 中包含promo_subcategory = 'discount'的,与题意相反。

    C. SELECT promo_category

    FROM promotions

    MINUS

    SELECT promo_category

    FROM promotions

    WHERE promo_subcategory <> 'discount';

    所有promo_category 中减去不包含promo_subcategory = 'discount'的,与题意相反。

     

    D. SELECT promo_category

    FROM promotions

    INTERSECT

    SELECT promo_category

    FROM promotions

    WHERE promo_subcategory <> 'discount';
     
    所有promo_category 交集不包含promo_subcategory = 'discount'的,符合题意。
    Answer: AD
     
    答案解析:
    本题意是让找出不包含promo_subcategory = 'discount'的产品。
     

    MINUS 返回第一个查询有,第二个查询无的

    which returns only unique rows returned by the first query but not by the second

    INTERSECT 返回共同有的

    which returns only those unique rows returned by both queries
     
     
  • 相关阅读:
    690. 员工的重要性
    【递推算法】
    【数据排序】快速排序
    【数据排序】车厢重组
    【基本算法--高精度计算】大整数相加
    【基本算法--高精度计算】回文数
    高精度计算 除法 高精除以低精
    PReLU
    重学C++(1)
    概率论基础知识回顾(1)
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317201.html
Copyright © 2020-2023  润新知