Album » OptB » q7  (10 Slides)     [Page 1 of 1] :: Jump To  
select
    supp_nation,
    cust_nation,
    l_year,
    sum(volume)
from
    (
        select
            n1.n_name as supp_nation,
            n2.n_name as cust_nation,
            extract(year from l_shipdate) as l_year,
            l_extendedprice * (1 - l_discount) as volume
        from
            supplier,
            lineitem,
            orders,
            customer,
            nation n1,
            nation n2
        where
            s_suppkey = l_suppkey
            and o_orderkey = l_orderkey
            and c_custkey = o_custkey
            and s_nationkey = n1.n_nationkey
            and c_nationkey = n2.n_nationkey
            and (
                (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
                or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
            )
            and l_shipdate between date '1995-01-01' and date '1996-12-31'
            and o_totalprice :varies
            and c_acctbal :varies
    )
group by
    supp_nation,
    cust_nation,
    l_year
order by
    supp_nation,
    cust_nation,
    l_year

  Up one level  
plan_diag * Plan Diagram * 1254 x 773 * (170KB)
reduced_diag * 1253 x 785 * (150KB)
cost_diag * Plan Cost Diagram * 1254 x 773 * (189KB)
card_diag * Plan Cardinality Diagram * 1254 x 773 * (189KB)
plan1 * PLAN 1 * 1243 x 867 * (46KB)
  plan_diag  
  reduced_diag  
  cost_diag  
  card_diag  
  plan1  
plan2 * PLAN 2 * 1243 x 867 * (46KB)
plan3 * PLAN 3 * 1243 x 867 * (43KB)
plan4 * PLAN 4 * 1243 x 867 * (43KB)
plan5 * PLAN 5 * 1243 x 867 * (43KB)
plan6 * PLAN 6 * 1243 x 867 * (47KB)
  plan2  
  plan3  
  plan4  
  plan5  
  plan6  
Album last updated on 5/19/07 12:53 AM
Powered by JAlbum 7.1 and BluPlusPlus skin