Album » OptA » q21  (17 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 * 1277 x 769 * (201KB)
reduced_diag * 1255 x 773 * (181KB)
cost_diag * Plan Cost Diagram * 1277 x 769 * (214KB)
card_diag * Plan Cardinality Diagram * 1277 x 769 * (264KB)
plan1 * PLAN 1 * 1252 x 871 * (44KB)
  plan_diag  
  reduced_diag  
  cost_diag  
  card_diag  
  plan1  
plan2 * PLAN 2 * 1252 x 871 * (45KB)
plan3 * PLAN 3 * 1252 x 871 * (44KB)
plan4 * PLAN 4 * 1252 x 871 * (44KB)
plan5 * PLAN 5 * 1252 x 871 * (48KB)
plan6 * PLAN 6 * 1252 x 871 * (40KB)
  plan2  
  plan3  
  plan4  
  plan5  
  plan6  
plan7 * PLAN 7 * 1252 x 871 * (44KB)
plan8 * PLAN 8 * 1252 x 871 * (44KB)
plan9 * PLAN 9 * 1252 x 871 * (44KB)
plan10 * PLAN 10 * 1252 x 871 * (43KB)
plan11 * PLAN 11 * 1252 x 871 * (46KB)
  plan7  
  plan8  
  plan9  
  plan10  
  plan11  
plan12 * PLAN 12 * 1252 x 871 * (45KB)
plan13 * PLAN 13 * 1252 x 871 * (43KB)
  plan12  
  plan13  
Album last updated on 5/19/07 12:51 AM
Powered by JAlbum 7.1 and BluPlusPlus skin