text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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 mk.keyword_id = k.id AND cn.id = mc.company_id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND t.id = mk.movie_id AND mc.movie_id = mk.mo...
job
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(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 rt.role = 'actress' AND cn.country_code = '[jp]' AND mc.note LIKE '%(Japan)%' AND ci.note = '(voice: English ve...
job
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 COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = c.PostId AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.FavoriteCount >= 0 AND p.Id = pl.PostId AND p.Id = ph.PostId AND c.Score = 0
stats
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE c.Score = 0 AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND p.Id = v.PostId AND p.Id = ph.PostId AND b.UserId = c.UserId AND p.Id = pl.RelatedPostId
stats
SELECT item.i_brand AS brand, SUM(ss_ext_sales_price) AS sum_agg, dt.d_year, item.i_brand_id AS brand_id FROM date_dim AS dt INNER JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk INNER JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE item.i_manufact_id = 387 AND dt.d_moy = 12 GROUP BY dt.d_year...
tpcds
WITH year_total AS ( SELECT d_year AS dyear, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_preferred_cust_flag AS customer_preferred_cust_flag, c_email_address AS customer_email_address, c_login AS customer_login, c_birth_country AS customer_birth_cou...
tpcds
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE pl.LinkTypeId = 1 AND c.Score = 0 AND p.Id = v.PostId AND p.Id = c.PostId AND p.Id = ph.PostId AND p.FavoriteCount >= 0 AND p.Id = pl.PostId LIMIT 10;
stats
Select ps_partkey, Sum(ps_supplycost * ps_availqty) As VALUE From partsupp, supplier, nation Where s_nationkey = n_nationkey AND n_name = 1 AND ps_suppkey = s_suppkey Group By ps_partkey Having Sum(ps_supplycost * ps_availqty) > ( Select Sum(ps_supplycost * ps_availqty) * 1 From partsupp, supplier, nation Where ps_supp...
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 pi.person_id = an.person_id AND t.production_year BETWEEN 1980 AND 1995 AND pi.person_id = ci.person_id AND an.person_...
job
SELECT p_size, p_brand, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_type FROM partsupp, part WHERE ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_brand <> 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_type NOT LIKE 1 AND p_partkey = ps_partkey GROUP BY p_brand...
tpch
SELECT MIN(n.name) AS actor_name, MIN(k.keyword) AS movie_keyword, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND t.id = mk.movie_id AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND k.id ...
job
SELECT c_custkey, c_phone, c_comment, c_acctbal, n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_name 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 MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie, MIN(cn.name) AS movie_company 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(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 ct.id = mc.company_type_id AND miidx.movie_id =...
job
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE k.id = mk.keyword_id AND t.production_year > 2010 AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.id = mk.movie_id AND t.id = mi.movie_id AND mk.movie_...
job
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where mi.info in ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') and t.id = mi.movie_id and k.keyword like '%sequel%' and mk.movie_id = mi.movie_id and t.id = mk.movie_id and t....
job
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_partkey = ps_partkey AND p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) AND p_type NOT LIKE 1 AND p_brand <> 1 GROUP B...
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 it.info = 'release dates' AND mc.note LIKE '%(USA)%' AND cn.country_code ...
job
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 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 SUM(l_extendedprice * l_discount) AS revenue FROM lineitem WHERE l_shipdate < DATE 1 + INTERVAL '1' YEAR AND l_discount BETWEEN 1 - 0.01 AND 1 + 0.01 AND l_shipdate >= DATE 1 AND l_quantity < 1 LIMIT 200;
tpch
SELECT i_item_id, s_store_id, MAX(cs_net_profit) AS catalog_sales_profit, s_store_name, MAX(sr_net_loss) AS store_returns_loss, i_item_desc, MAX(ss_net_profit) AS store_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 COUNT(1) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE u.Id = b.UserId AND p.Id = c.PostId AND p.Score <= 192 AND u.Id = p.OwnerUserId AND p.ViewCount >= 0 AND p.Id = ph.PostId AND p.Id = v.PostId
stats
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where mi.info In ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND k.id = mk.keyword_id AND k.keyword Like '%sequel%' AND t...
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(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 cn.id = mc.company_id AND kt.id = t.kind_id AND...
job
select sum(case when (CAST(d_date as DATE) < CAST('2000-03-11' as DATE)) then cs_sales_price - COALESCE(cr_refunded_cash, 0) else 0 end) as sales_before, sum(case when (CAST(d_date as DATE) >= CAST('2000-03-11' as DATE)) then cs_sales_price - COALESCE(cr_refunded_cash, 0) else 0 end) as sales_after, i_item_id, w_state ...
tpcds
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.movie_id = mi_idx.movie_id AND kt.id = t.kind_id AND mi.movie_id = ...
job
SELECT AVG(ss_list_price) AS agg2, AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1, 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 MIN(t.title) AS russian_movie, MIN(chn.name) AS uncredited_voiced_character 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 ct.id = mc.company_type_id AND rt.role = 'actor' AND ci.movie_id = mc.movie_id AND chn.id = ci.perso...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE l1.l_receiptdate > l1.l_commitdate AND s_suppkey = l1.l_suppkey AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND o_orderkey = l1.l_orderkey AND s_nationkey = n_nationkey A...
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 = mc.movie_id AND k.keyword = 'character-name-in-title' AND n.id = ci.person_id AND an...
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 t.episode_nr < 100 AND ci.movie_id = t.id AND ci.movie_id = mk.movie_id AND ci.movie_id = m...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b, users AS u WHERE b.UserId = u.Id AND p.Score <= 40 AND p.Id = pl.RelatedPostId AND p.Id = v.PostId AND p.Id = c.PostId AND c.UserId = u.Id AND pl.LinkTypeId = 1 AND p.Id = ph.PostId
stats
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 t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '...
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 mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct.id = mc.company_type_id AND it.info = 'bottom 10 rank' AND it.id = mi.info_type_id AND ct.kind = 'production companies' ...
job
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE k.id = mk.keyword_id AND t.id = mk.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German']) AND k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND...
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 k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND cn.country_code ='[de]' AND t.id = mk.mo...
job
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 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 miidx.movie_id = mc.movie_id AND cn.country_cod...
job
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 u.Id = b.UserId AND p.Id = c.PostId AND p.Id = ph.PostId AND p.Id = v.PostId AND p.ViewCount >= 0 AND p.Score <= 192
stats
SELECT extended_price, ss_ticket_number, ca_city, c_last_name, bought_city, c_first_name, list_price, extended_tax 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 INN...
tpcds
SELECT c_salutation, c_last_name, ss_ticket_number, c_first_name, cnt, c_preferred_cust_flag FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(1) 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
WITH year_total AS ( SELECT c_email_address AS customer_email_address, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, 's' AS sale_type, c_first_name AS customer_first_name, d_year AS dyear, c_preferred_cust_flag AS customer_preferred_cust_flag, c_last_na...
tpcds
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name FROM customer, orders, lineitem, supplier, nation, region WHERE l_suppkey = s_suppkey AND r_name = 1 AND s_nationkey = n_nationkey AND c_nationkey = s_nationkey AND n_regionkey = r_regionkey AND o_orderdate >= DATE 1 AND c_custkey = o_custkey AND l_order...
tpch
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 miidx.movie_id = mc.movie_id AND mc.movie_id = ...
job
SELECT MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND t.id = mk.movie_id AND k.key...
job
SELECT * FROM (SELECT c_name, SUM(l_quantity), o_orderdate, o_orderkey, c_custkey, o_totalprice FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey) AS _agg WHERE SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey,...
tpch
SELECT ss_ticket_number, cnt, c_last_name, c_preferred_cust_flag, 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 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 mc.movie_id = mi.movie_id AND t.id = mi.movie_id AND t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.info = 'bottom 10 rank' AND ct.ki...
job
SELECT SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, COUNT(*) AS count_order, SUM(l_quantity) AS sum_qty, AVG(l_extendedprice) AS avg_price, AVG(l_quantity) AS avg_qty, l_returnflag, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_linestatus, A...
tpch
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 k.keyword ='character-name-In-title' AND t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND cn.country_code ='[sm]' AND mc.movie_id = t.id AND mk.keyword_id ...
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 mc.movie_id = mk.movie_id and mc.movie_id = t.id and cn.country_code ='[de]' and mk.keyword_id = k.id and cn.id = mc.company_id and t.id = mk.movie_id and k.keyword ='character-name-in-...
job
SELECT c_salutation, cnt, ss_ticket_number, c_preferred_cust_flag, c_first_name, c_last_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 c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt 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 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 cn.id = mc.company_id AND mi.movie_id = miidx.m...
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 lt.id = ml.link_type_id AND n.id = an.person_id AND ml.linked_movie_id = t.id AND n.id = pi.per...
job
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, users AS u, badges AS b WHERE u.Reputation >= 1 AND p.Score >= -7 AND ph.UserId = u.Id AND u.Id = b.UserId AND p.OwnerUserId = u.Id AND ph.PostHistoryTypeId = 3 LIMIT 500;
stats
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 l_shipdate < l_commitdate AND l_receiptdate ...
tpch
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 = mc.movie_id AND t.id = mi.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.info = 'bottom 10 rank' AND mc.movie_id = mi.movie_id AND mc.no...
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 r_name = 1 AND p_type...
tpch
WITH _q AS ( SELECT COUNT(*) FROM comments AS c, postHistory AS ph, users AS u WHERE c.UserId = ph.UserId AND u.Reputation >= 1 AND u.UpVotes <= 27 AND u.Id = c.UserId LIMIT 500 ) SELECT * FROM _q;
stats
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 s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE n_name = 1 AND o_orderkey = l1.l_orderkey AND o_orderstatus = 'F' AND s_nationkey = n_nationkey 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...
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 t.id = mc.movie_id AND cn.id = mc.company_id AND ci.role_id = rt.id AND a...
job
select s_comment, s_acctbal, p_mfgr, p_partkey, s_address, s_name, s_phone, n_name 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 s_store_id, s_store_name, SUM(sr_return_quantity) AS store_returns_quantity, i_item_desc, SUM(ss_quantity) AS store_sales_quantity, i_item_id, 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(t.production_year) AS movie_year, MIN(t.title) AS movie_title, MIN(mc.note) AS production_note FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE mc.movie_id = mi_idx.movie_id AND t.id = mi_idx.movie_id AND it.info = 'top 250 rank' AND t.id = mc.movie_...
job
SELECT cnt, c_first_name, c_salutation, c_last_name, ss_ticket_number, c_preferred_cust_flag 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 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 l_shipdate < l_commitdate AND l_shipmode In ...
tpch
SELECT MIN(t.title) AS marvel_movie, MIN(n.name) AS actor_name, MIN(k.keyword) AS movie_keyword FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE k.id = mk.keyword_id AND n.id = ci.person_id AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND t.id = mk.movie_id AND k.keyword = 'm...
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 c_nationkey = n1.n_na...
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.episode_nr < 100 And mk.keyword_id = k.id And n.id = ci.person_id And an.person_id = n.id...
job
SELECT COUNT(ss_quantity) AS store_sales_quantitycount, COUNT(sr_return_quantity) AS store_returns_quantitycount, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, s_state, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_...
tpcds
WITH ss AS ( SELECT i_manufact_id, SUM(ss_ext_sales_price) AS total_sales FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN customer_address ON ss_addr_sk = ca_address_sk JOIN item ON ss_item_sk = i_item_sk WHERE ca_gmt_offset = -6 AND d_year = 2002 AND i_category IN ('Sports') AND d_moy = 1 GROUP BY i...
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 mk.keyword_id = k.id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.id = mc.company_id AND k.keyword ='character-name-in-...
job
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE p.Id = pl.RelatedPostId AND p.Id = c.PostId AND p.Id = ph.PostId AND b.UserId = c.UserId AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND c.Score = 0
stats
select avg(cs_list_price) as agg2, avg(cs_sales_price) as agg4, i_item_id, avg(cs_coupon_amt) as agg3, avg(cs_quantity) as agg1 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 n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND n_regionkey = r_regionkey AND c_nationkey = s_nationkey AND l_sup...
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 ci.movie_id = mc.movie_id AND k.keyword = 'character-name-in-title' AND mc.company_id = cn....
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE p.Id = pl.RelatedPostId AND p.Id = ph.PostId AND p.Id = v.PostId AND b.UserId = c.UserId AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND c.Score = 0 LIMIT 10;
stats
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 l_shipmode IN (1, 1) AND l_shipdate < l_comm...
tpch
Select total_revenue, s_name, s_address, s_phone, s_suppkey From supplier, revenue0 Where s_suppkey = supplier_no AND total_revenue = ( Select Max(total_revenue) From revenue0 ) Order By s_suppkey
tpch
SELECT MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = mk.movie_id AND k.id = mk.keyword_id AND k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_id AND ci.movie_id = mk.movie_...
job
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = ci.movie_id AND k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND n.name LIKE '%Hemsworth%Chris%' AND k.keyword = 'marvel-cinem...
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.kind = 'production companies' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct.id = mc...
job
SELECT p_brand, p_type, p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_partkey = ps_partkey AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) AND p_type NOT LIKE 1 AND p_brand <> 1 GROUP B...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl WHERE p.CommentCount <= 18 AND p.CreationDate <= '2014-09-09 01:43:00'::timestamp AND p.CreationDate >= '2010-07-23 07:27:31'::timestamp AND c.UserId = p.OwnerUserId AND p.Id = pl.PostId LIMIT 500;
stats
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(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 t.id = mk.movie_id AND mc.movie_id = t.id AND mk.keyword_id = k.id AND cn.country_code ='[sm]' AND cn.id = mc.company_id AND mc.movie_id = mk.mo...
job
select i_item_id, avg(ss_quantity) as agg1, avg(ss_list_price) as agg2, avg(ss_coupon_amt) as agg3, avg(ss_sales_price) as agg4 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 MAX(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.id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND mk.movie_id = mi.movie_id AND k.id = mk.keyword_id AND t.produ...
job
SELECT AVG(cs_sales_price) AS agg4, i_item_id, AVG(cs_list_price) AS agg2, AVG(cs_coupon_amt) AS agg3, AVG(cs_quantity) AS agg1 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 n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate >= DATE 1 AND s_nationkey = n_nationkey AND c_custkey = o_custkey AND c_nationkey = s_nationkey AND l_orderkey = o_orderkey AND n_regionkey = r_regionkey AND o_orderdate < DATE 1...
tpch
SELECT MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND t.id = mk.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND n.name LIKE '%Hemsworth%Chris%' AND ci...
job
SELECT MAX(cn.name) AS movie_company, MAX(mi_idx.info) AS rating, MAX(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 c_acctbal, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_comment, c_name, c_custkey, c_phone, n_name FROM customer, orders, lineitem, nation WHERE c_nationkey = n_nationkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND l_returnflag = 'R' AND c_custkey = o_custkey AND o_orderdate < ...
tpch
With ss As ( Select i_manufact_id, Sum(ss_ext_sales_price) As total_sales From store_sales Join date_dim On ss_sold_date_sk = d_date_sk Join customer_address On ss_addr_sk = ca_address_sk Join item On ss_item_sk = i_item_sk Where d_year = 2002 AND ca_gmt_offset = -6 AND d_moy = 1 AND i_category = ANY(ARRAY['Sports']) G...
tpcds