# SELECT SUM(L_EXTENDEDPRICE)/7.0 AS AVG_YEARLY FROM LINEITEM, PART WHERE P_PARTKEY = L_PARTKEY             AND P_BRAND = 'Brand#23'             AND P_CONTAINER = 'MED BOX'             AND L_QUANTITY < (SELECT 0.2*AVG(L_QUANTITY)                                              FROM LINEITEM                                              WHERE P_PARTKEY=L_PARTKEY);

SELECT S_ACCTBAL, S_NAME, N_NAME, P_PARTKEY, P_MFGR, S_ADDRESS, S_PHONE, S_COMMENT FROM PART, SUPPLIER, PARTSUPP, NATION, REGION WHERE P_PARTKEY = PS_PARTKEY        AND S_SUPPKEY = PS_SUPPKEY        AND P_SIZE = 15        AND S_NATIONKEY = N_NATIONKEY        AND N_REGIONKEY = R_REGIONKEY        AND R_NAME = 'EUROPE'       AND PS_SUPPLYCOST = (SELECT MIN(PS_SUPPLYCOST)                            FROM PARTSUPP, SUPPLIER, NATION, REGION                           WHERE P_PARTKEY = PS_PARTKEY                                  AND S_SUPPKEY = PS_SUPPKEY                                 AND S_NATIONKEY = N_NATIONKEY                                  AND N_REGIONKEY = R_REGIONKEY                                  AND R_NAME = 'EUROPE') ORDER BY S_ACCTBAL DESC, N_NAME, S_NAME, P_PARTKEY limit 100;
