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


    141. View the Exhibit and examine the structure of CUSTOMERS and GRADES tables.

    You need to display names and grades of customers who have the highest credit limit.

    Which two SQL statements would accomplish the task? (Choose two.) 

    A. SELECT custname, grade

    FROM customers, grades

    WHERE (SELECT MAX(cust_credit_limit)       

    FROM customers) BETWEEN startval and endval;

    B. SELECT custname, grade

    FROM customers, grades

    WHERE (SELECT MAX(cust_credit_limit)       

    FROM customers) BETWEEN startval and endval   

    AND cust_credit_limit BETWEEN startval AND endval;

    C. SELECT custname, grade

    FROM customers, grades

    WHERE cust_credit_limit = (SELECT MAX(cust_credit_limit)                            

    FROM customers)

    AND cust_credit_limit BETWEEN startval AND endval;

    D. SELECT custname, grade

    FROM customers , grades

    WHERE cust_credit_limit IN (SELECT MAX(cust_credit_limit)                            

    FROM customers)

    AND MAX(cust_credit_limit) BETWEEN startval AND endval;

    Answer: BC

    答案解析:

    参考:http://blog.csdn.net/rlhua/article/details/12879585

    题意要求显示有最高credit limit的用户的名称和等级。

    A,缺少cust_credit_limit BETWEEN startval AND endval这个条件。
    BC,使用的非等值连接
    D有语法错误,WHERE子句里不能使用组函数

  • 相关阅读:
    bzoj1731 [Usaco2005 dec]Layout 排队布局
    loj10087 Intervals
    差分约束小结
    bzoj1112 [POI2008]砖块Klo
    bzoj3524 [POI2014]Couriers
    poj2752 Seek the Name, Seek the Fame
    1027C Minimum Value Rectangle
    bzoj2212 [POI2011]Tree Rotations
    bzoj3747 [POI2015]Kinoman
    628D Magic Numbers
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13316848.html
Copyright © 2020-2023  润新知