text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE mk.movie_id = ci.movie_id AND ct.id = mc.company_type_id AND ...
job
SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_shippriority, o_orderdate FROM customer, orders, lineitem WHERE l_orderkey = o_orderkey AND c_mktsegment = 1 AND c_custkey = o_custkey AND l_shipdate > DATE 1 AND o_orderdate < DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mi.movie_id AND k.keyword LIKE '%sequel%' AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.production_year > 2010 A...
job
Select o_orderkey, c_name, Sum(l_quantity), o_orderdate, c_custkey, o_totalprice From customer, orders, lineitem Where o_orderkey In ( Select l_orderkey From lineitem Group By l_orderkey Having Sum(l_quantity) > 1 ) And c_custkey = o_custkey And o_orderkey = l_orderkey Group By c_name, c_custkey, o_orderkey, o_orderdat...
tpch
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND t.production_year > 2000 AND t.id = mi.movie_id AND k.keyword LIKE '%sequel%' AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'D...
job
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE it.id = mi.info_type_id AND it.info = 'release dates' AND ci.note IN ('(v...
job
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v where p.FavoriteCount >= 0 and c.Score = 0 and p.Id = v.PostId and pl.LinkTypeId = 1 and p.Id = c.PostId and p.Id = ph.PostId and p.Id = pl.PostId
stats
select min(an.name) as acress_pseudonym, min(t.title) as japanese_anime_movie from aka_name as an, cast_info as ci, company_name as cn, company_type as ct, keyword as k, movie_companies as mc, movie_keyword as mk, name as n, role_type as rt, title as t where n.id = ci.person_id and mc.note like '%(Japan)%' and ci.note ...
job
with ss as ( select i_manufact_id, sum(ss_ext_sales_price) as total_sales from store_sales inner join date_dim on ss_sold_date_sk = d_date_sk inner join customer_address on ss_addr_sk = ca_address_sk inner join item on ss_item_sk = i_item_sk where ca_gmt_offset = -5 and d_year = 2000 and d_moy = 2 and i_category in ('E...
tpcds
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue 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_nationkey = n1.n_nationkey AND c...
tpch
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.Id = v.PostId AND p.Id = pl.PostId AND p.AnswerCount >= 0 AND p.Id = ph.PostId AND u.Id = p.OwnerUserId AND p.Id = c.PostId AND p.PostTypeId = 1
stats
Select Count(*) From comments As c, posts As p, votes As v, users As u Where c.Score = 0 AND p.ViewCount >= 0 AND u.Id = c.UserId AND p.Score >= 0 AND u.Id = p.OwnerUserId AND u.Id = v.UserId
stats
SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE it.info = 'bottom 10 rank' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi.movie_id AND ct.kind = 'production companies' AND mc.movie_id = mi.movie_id AND ct...
job
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE rt.role = 'actress' AND n.gender = 'f' AND an.person_id = n.i...
job
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v Where p.Id = v.PostId And p.FavoriteCount >= 0 And c.Score = 0 And p.Id = pl.PostId And p.Id = c.PostId And pl.LinkTypeId = 1 And p.Id = ph.PostId
stats
SELECT MIN(t.production_year) AS movie_year, MIN(mc.note) AS production_note, MIN(t.title) AS movie_title FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.info = 'top 250 rank' AND it.id = mi_idx.info_type_id AND ct.kind = 'production companies' AND mc.note ...
job
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE ml.movie_id = mk.movie_id AND mc.no...
job
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE t.production_year > 1990 AND n.id = ci.person_id AND ct.id = ...
job
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE pi.person_id = an.person_id AND it.info = 'mini biography' AND lt.id = ml.link_type_id AND ci.movie_id = ml.linked_mov...
job
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE cn.id = mc.company_id AND mc.movie_id = t.id AND cn.country_code ='[nl]' AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-IN-title' AND t.id = mk.movie_id AND mk.keyword_id ...
job
SELECT AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1, AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, i_item_id FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo...
tpcds
SELECT c_comment, n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_name, c_phone, c_address, c_acctbal, c_custkey FROM customer, orders, lineitem, nation WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AN...
tpch
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue 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 c_nationkey = n2.n_nationkey AND o...
tpch
SELECT i_item_id, AVG(cs_list_price) AS agg2, AVG(cs_coupon_amt) AS agg3, AVG(cs_quantity) AS agg1, AVG(cs_sales_price) AS agg4 FROM catalog_sales JOIN customer_demographics ON cs_bill_cdemo_sk = cd_demo_sk JOIN date_dim ON cs_sold_date_sk = d_date_sk JOIN item ON cs_item_sk = i_item_sk JOIN promotion ON cs_promo_sk = ...
tpcds
SELECT * FROM ( SELECT AVG(ss_list_price) AS b1_lp, COUNT(ss_list_price) AS b1_cnt, COUNT(DISTINCT ss_list_price) AS b1_cntd FROM store_sales WHERE ss_quantity >= 0 AND (ss_list_price BETWEEN 71 AND 71 + 10 OR ss_coupon_amt BETWEEN 1905 AND 1905 + 1000 OR ss_wholesale_cost BETWEEN 61 AND 61 + 20) ) AS b3 AND ss_quantit...
tpcds
SELECT l_shipmode, SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count FROM orders, lineitem WHERE o_orderkey = l_orderkey AND l_shipdate < l_c...
tpch
SELECT total_revenue, s_phone, s_address, s_suppkey, s_name FROM supplier, revenue0 WHERE s_suppkey = supplier_no AND total_revenue = ( SELECT MAX(total_revenue) FROM revenue0 ) ORDER BY s_suppkey
tpch
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE t.id = mk.movie_id AND an.person_id = ci.person_id AND ci.movie_id = mk.movie_id AND t.epis...
job
SELECT MAX(cn.name) AS from_company, MAX(lt.link) AS link_type, MAX(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE ml.movie_id = mk.movie_id AND ct.id...
job
SELECT MAX(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND mc.movie_id = t.id AND cn.country_code =...
job
SELECT i_manufact_id, i_brand AS brand, i_manufact, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO...
tpcds
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE k.keyword ='character-name-in-title' AND cn.country_code ='[sm]' AND cn.id = mc.company_id AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND mk.keyword_id ...
job
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE n1.n_regionkey = r_re...
tpch
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE chn.id = ci.person_role_id AND t.id = ci.movie_id AND ci.movie_id = mc.mo...
job
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 = 1 And p_type Like 1 And s_nationkey = n_nationkey And n_regionkey = r_regionkey And r_name = 1 And ps_supplycost = ( Selec...
tpch
select min(n.name) as voicing_actress, min(t.title) as voiced_movie from aka_name as an, char_name as chn, cast_info as ci, company_name as cn, info_type as it, movie_companies as mc, movie_info as mi, name as n, role_type as rt, title as t where mc.note like '%(USA)%' AND ci.person_id = an.person_id AND ci.note in ('(...
job
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE p_name LIKE 1 ) AS profit AND ps_suppkey = l_suppkey AND s_su...
tpch
Select Min(n.name) As of_person, Min(t.title) As biography_movie From aka_name As an, cast_info As ci, info_type As it, link_type As lt, movie_link As ml, name As n, person_info As pi, title As t Where n.name_pcode_cf >= 'A' And n.name_pcode_cf <= 'F' And n.id = an.person_id And lt.link = 'features' And it.id = pi.info...
job
SELECT MIN(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE ci.role_id = rt.id AND n1.id = ci.person_id AND ci.movie_id = t.id AND mc.note LIKE '%(Japan)%' AND n1.name LIK...
job
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND cn.country_code ='[sm]' AND t.id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_id ...
job
SELECT AVG(ss_list_price) AS agg2, i_item_id, AVG(ss_coupon_amt) AS agg3, AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1 FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo...
tpcds
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue 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 l_shipda...
tpch
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE k.keyword IN ('sequel', 'revenge', ...
job
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE it.id = miidx.info_type_id AND it2.info = 'rele...
job
Select nation, o_year, Sum(amount) As sum_profit From ( Select n_name As nation, EXTRACT(YEAR From o_orderdate) As o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity As amount From part, supplier, lineitem, partsupp, orders, nation Where p_partkey = l_partkey AND s_suppkey = l_suppkey AND o_orderke...
tpch
SELECT cust_nation, SUM(volume) AS revenue, supp_nation, l_year 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 l_shipdate BETWEEN DATE '1995-01-0...
tpch
Select i_item_id, i_item_desc, s_store_id, s_store_name, Max(ss_net_profit) As store_sales_profit, Max(sr_net_loss) As store_returns_loss, Max(cs_net_profit) As catalog_sales_profit From store_sales Join store_returns On store_sales.ss_customer_sk = store_returns.sr_customer_sk And store_sales.ss_item_sk = store_return...
tpcds
SELECT AVG(cs_coupon_amt) AS agg3, AVG(cs_list_price) AS agg2, AVG(cs_sales_price) AS agg4, AVG(cs_quantity) AS agg1, i_item_id FROM catalog_sales JOIN customer_demographics ON cs_bill_cdemo_sk = cd_demo_sk JOIN date_dim ON cs_sold_date_sk = d_date_sk JOIN item ON cs_item_sk = i_item_sk JOIN promotion ON cs_promo_sk = ...
tpcds
SELECT i_item_id, i_item_desc, s_store_id, s_store_name, MAX(ss_net_profit) AS store_sales_profit, MAX(sr_net_loss) AS store_returns_loss, MAX(cs_net_profit) AS catalog_sales_profit FROM store_sales INNER JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_...
tpcds
Select Min(cn.name) As movie_company, Min(mi_idx.info) As rating, Min(t.title) As western_violent_movie From company_name As cn, company_type As ct, info_type As it1, info_type As it2, keyword As k, kind_type As kt, movie_companies As mc, movie_info As mi, movie_info_idx As mi_idx, movie_keyword As mk, title As t Where...
job
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE an.name LIKE '%a%' AND it.id = pi.info_type_id AND lt.link = 'features' AND t.id = ci.movie_id AND ml.linked_movie_id ...
job
Select c_custkey, c_name, Sum(l_extendedprice * (1 - l_discount)) As revenue, c_acctbal, n_name, c_address, c_phone, c_comment From customer, orders, lineitem, nation Where l_returnflag = 'R' And o_orderdate < DATE 1 + INTERVAL '3' MONTH And c_nationkey = n_nationkey And o_orderdate >= DATE 1 And c_custkey = o_custkey ...
tpch
WITH _q AS ( Select Count(*) From postHistory As ph, posts As p, users As u, badges As b Where ph.UserId = u.Id AND p.OwnerUserId = u.Id AND p.Score >= -7 AND ph.PostHistoryTypeId = 3 AND u.Reputation >= 1 AND u.Id = b.UserId ) SELECT * FROM _q;
stats
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE s_nationkey = n_nationkey AND l_suppkey = s_suppkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND n_regionkey = r_regionkey AND c_custkey = o_custkey AND r_name ...
tpch
SELECT SUM(ss_quantity) AS store_sales_quantity, i_item_id, s_store_id, i_item_desc, s_store_name, SUM(cs_quantity) AS catalog_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti...
tpcds
SELECT ss_ticket_number, c_preferred_cust_flag, c_last_name, cnt, c_salutation, c_first_name FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_linestatus, SUM(l_extendedprice) AS sum_base_price, l_returnflag, SUM(l_quantity) AS sum_qty, COUNT(1) AS count_order, AVG(l_extendedprice) AS avg_price, A...
tpch
select p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt from partsupp, part where ps_suppkey not in ( select s_suppkey from supplier where s_comment like '%Customer%Complaints%' ) and p_type not like 1 and p_size in (1, 1, 1, 1, 1, 1, 1, 1) and p_brand <> 1 and p_partkey = ps_partkey group by p_brand...
tpch
select count(ss_quantity) as store_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) / avg(sr_return_quantity) as store_returns_quantitycov, STDDEV_SAMP(ss_quantity) / avg(ss_quantity) as store_sales_quantitycov, s_state, count(sr_return_quantity) as store_returns_quantitycount, avg(sr_return_quantity) as store_retu...
tpcds
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE it2.id = mi.info_type_id AND mi.movie_id = mc.m...
job
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where t.id = mk.movie_id AND t.production_year > 2010 AND mi.info In ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND mk.movie_id = mi.movie_id AND k.keyword Like '%sequel%' A...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, votes AS v, users AS u WHERE u.Id = p.OwnerUserId AND c.Score = 0 AND p.ViewCount >= 0 AND u.Id = v.UserId AND u.Id = c.UserId AND p.Score >= 0 LIMIT 100;
stats
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE rt.id = ci.role_id AND t.id = mc.movie_id AND rt.role = 'actor' AND chn.id = ci.person_role_id AND t...
job
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE ct.id = mc.company_type_id AND mc.movie_id = mi_idx.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.n...
job
SELECT SUM(ss_ext_wholesale_cost), AVG(ss_ext_sales_price), AVG(ss_quantity), AVG(ss_ext_wholesale_cost) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr...
tpcds
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.id = mi_idx.info_type_id AND mc.movie_id = mi_idx.movie_id AND (mc.note LIKE '%(co-production)%' OR mc....
job
SELECT i_manufact, i_manufact_id, i_brand AS brand, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO...
tpcds
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE s_nationkey = n_nationkey AND l_orderkey = o_orderkey AND l_suppkey = s_suppkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_custkey = o_custkey AND r_name = 1 AND n_regionkey = r_regi...
tpch
SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr...
tpcds
select min(cn.name) as from_company, min(lt.link) as link_type, min(t.title) as western_sequel from company_name as cn, company_type as ct, info_type as it, keyword as k, link_type as lt, movie_companies as mc, movie_info as mi, movie_keyword as mk, movie_link as ml, title as t where lt.link like '%follow%' and t.id = ...
job
Select Min(an.name) As acress_pseudonym, Min(t.title) As japanese_anime_movie From aka_name As an, cast_info As ci, company_name As cn, company_type As ct, keyword As k, movie_companies As mc, movie_keyword As mk, name As n, role_type As rt, title As t Where rt.role = 'actress' And t.id = ci.movie_id And k.keyword = 'a...
job
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE it.id = mi.info_type_id AND mi.movie_id = mc.movie_id AND t.id = ci.movie...
job
SELECT MIN(t.title) AS biography_movie, MIN(n.name) AS of_person FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE t.id = ci.movie_id AND pi.person_id = ci.person_id AND t.production_year BETWEEN 1980 AND 1995 AND ci.person_id = n.id...
job
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE an.person_id = n.id AND t.id = mc.movie_id AND t.episode_nr < 100 AND t.episode_nr >= 50 AN...
job
SELECT i_item_id, i_item_desc, s_store_id, s_store_name, SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti...
tpcds
Select Min(an.name) As cool_actor_pseudonym, Min(t.title) As series_named_after_char From aka_name As an, cast_info As ci, company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, name As n, title As t Where t.episode_nr >= 50 AND t.episode_nr < 100 AND n.id = ci.person_id AND cn.country_code = '[u...
job
SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE t.id = mi.movie_id AND ct.kind = 'production companies' AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.movie_id = mi.movie_id AND ct.id = mc.company_typ...
job
SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr...
tpcds
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND mk.keyword_id = k.id AND k.keyword ='character-name-in-title' AND cn.id = mc.comp...
job
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where mk.movie_id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German']) AND t.production_year > 2000 AND t.id = mi.movie_id AND k.id = mk.keyword...
job
SELECT ca_zip, SUM(cs_sales_price) FROM catalog_sales JOIN customer ON cs_bill_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JOIN date_dim ON cs_sold_date_sk = d_date_sk WHERE d_year = 2001 AND d_qoy = 1 AND (SUBSTR(ca_zip, 1, 5) IN ( '85669', '86197', '88274', '83405', '86475',...
tpcds
SELECT MIN(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE ci.movie_id = t.id AND ci.role_id = rt.id AND n1.name NOT LIKE '%Yu%' AND an1.person_id = n1.id AND rt.role = '...
job
SELECT SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_returnflag, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice) AS sum_base_price, AVG(l_quantity) AS avg_qty, COUNT(*) AS count_order, SUM(l_quantity) AS sum_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, l_linestatus, A...
tpch
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE s_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_nationkey = s_nationkey AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND r_name = 1 AND n_regionkey = r_...
tpch
select min(mi_idx.info) as rating, min(t.title) as movie_title from info_type as it, movie_info_idx as mi_idx, title as t where it.id = mi_idx.info_type_id and it.info ='rating' and t.production_year between 2000 and 2005 and t.id = mi_idx.movie_id and mi_idx.info > '8.0'
job
SELECT COUNT(1) FROM comments AS c, votes AS v, users AS u WHERE c.CreationDate >= '2010-08-10 17:55:45'::timestamp AND u.Reputation >= 1 AND u.Id = v.UserId AND u.Id = c.UserId LIMIT 100;
stats
WITH _q AS ( SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German']) AND mk.movie_id = mi.movie_id AND t.id = mk.movie_id AND k.keyword ...
job
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE cn.country_code = '[us]' AND cn.id = mc.company_id AND kt.id = t.kind_...
job
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.Id = pl.PostId AND p.Id = ph.PostId AND p.Id = c.PostId AND p.AnswerCount >= 0 AND p.Id = v.PostId AND p.PostTypeId = 1 AND u.Id = p.OwnerUserId
stats
select count(1) from postHistory as ph, posts as p, votes as v, badges as b, users as u, comments as c where u.Id = p.OwnerUserId and p.Id = v.PostId and p.Score <= 192 and p.ViewCount >= 0 and p.Id = ph.PostId and p.Id = c.PostId and u.Id = b.UserId
stats
SELECT i_item_desc, s_store_id, i_item_id, MAX(sr_net_loss) AS store_returns_loss, MAX(ss_net_profit) AS store_sales_profit, s_store_name, MAX(cs_net_profit) AS catalog_sales_profit FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return...
tpcds
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_size = 1 AND s_nationkey = n_nationkey AND p_type LIKE 1 AND r_name = 1 AND p_partkey = ps_partkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, reg...
tpch
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE at.title LIKE '%Champion%' AND it1.id = mi_idx.info_type_id AND mi_idx...
job
SELECT MIN(miidx.info) AS rating, MIN(mi.info) AS release_date, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE it.info = 'rating' AND it2.info = 'release date...
job
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE s_suppkey = ps_suppkey AND p_partkey = ps_partkey AND p_type LIKE 1 AND p_size = 1 AND s_nationkey = n_nationkey AND r_name = 1 AND ps_supplycost = ( SELECT MAX(ps_supplycost) FROM part...
tpch
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_nationkey = n_nationkey AND p_name LIKE 1 ) AS profit AND p...
tpch
SELECT AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_quantity) AS sum_qty, l_linestatus, COUNT(*) AS count_order, AVG(l_discount) AS avg_disc, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_quantity...
tpch
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue 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 ( (n1.n_name = 1 AND n2.n_name = 1...
tpch
SELECT c_last_name, bought_city, extended_price, list_price, extended_tax, ca_city, ss_ticket_number, c_first_name FROM ( SELECT ss_ticket_number, ss_customer_sk, ca_city AS bought_city, SUM(ss_ext_sales_price) AS extended_price, SUM(ss_ext_list_price) AS list_price, SUM(ss_ext_tax) AS extended_tax FROM store_sales JOI...
tpcds
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue 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 c_nationkey = n2.n_nationkey AND l...
tpch