Album » OptB » q21  (12 Slides)     [Page 1 of 1] :: Jump To  
select
    s_name,
    count(*) as numwait
from
    supplier,
    lineitem l1,
    orders,
    nation
where
    s_suppkey = l1.l_suppkey
    and o_orderkey = l1.l_orderkey
    and o_orderstatus = 'F'
    and exists (
        select
            *
        from
            lineitem l2
        where
            l2.l_orderkey = l1.l_orderkey
            and l2.l_suppkey <> l1.l_suppkey
    )
    and not exists (
        select
            *
        from
            lineitem l3
        where
            l3.l_orderkey = l1.l_orderkey
            and l3.l_suppkey <> l1.l_suppkey
            and l3.l_receiptdate > l3.l_commitdate
    )
    and s_nationkey = n_nationkey
    and s_acctbal :varies
    and l1.l_extendedprice :varies
    and n_name = 'SAUDI ARABIA'
group by
    s_name
order by
    numwait desc,
    s_name

  Up one level  
plan_diag * Plan Diagram * 1254 x 773 * (186KB)
reduced_diag * 1253 x 785 * (166KB)
cost_diag * Plan Cost Diagram * 1254 x 773 * (196KB)
card_diag * Plan Cardinality Diagram * 1254 x 773 * (199KB)
plan1 * PLAN 1 * 1254 x 867 * (59KB)
  plan_diag  
  reduced_diag  
  cost_diag  
  card_diag  
  plan1  
plan2 * PLAN 2 * 1243 x 867 * (52KB)
plan3 * PLAN 3 * 1243 x 867 * (62KB)
plan4 * PLAN 4 * 1243 x 867 * (59KB)
plan5 * PLAN 5 * 1243 x 867 * (50KB)
plan6 * PLAN 6 * 1243 x 867 * (56KB)
  plan2  
  plan3  
  plan4  
  plan5  
  plan6  
plan7 * PLAN 7 * 1243 x 867 * (59KB)
plan8 * PLAN 8 * 1243 x 867 * (48KB)
  plan7  
  plan8  
Album last updated on 5/19/07 12:55 AM
Powered by JAlbum 7.1 and BluPlusPlus skin