Album » OptD » q21  (8 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 * 1252 x 786 * (153KB)
reduced_diag * 1258 x 781 * (133KB)
cost_diag * Plan Cost Diagram * 1252 x 786 * (171KB)
card_diag * Plan Cardinality Diagram * 1252 x 786 * (169KB)
plan1 * PLAN 1 * 1256 x 870 * (38KB)
  plan_diag  
  reduced_diag  
  cost_diag  
  card_diag  
  plan1  
plan2 * PLAN 2 * 1256 x 870 * (37KB)
plan3 * PLAN 3 * 1256 x 870 * (38KB)
plan4 * PLAN 4 * 1256 x 870 * (37KB)
  plan2  
  plan3  
  plan4  
Album last updated on 5/19/07 1:08 AM
Powered by JAlbum 7.1 and BluPlusPlus skin