text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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 = mc.movie_id AND mi.movie_id = mi_idx.movie_id AND at.mov...
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 it.info = 'top 250 rank' and (mc.note like '%(co-production)%' or mc.note like '%(presents)%') and t.id = ...
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 c.Score = 0 AND pl.LinkTypeId = 1 AND p.Id = pl.PostId AND p.Id = c.PostId AND p.Id = ph.PostId AND p.FavoriteCount >= 0
stats
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 = t.id AND t.id = mk.movie_id AND cn.country_code ='[nl]' AND mk.keyword_id = k.id AND k.keyword ='character-name-IN-title' AND mc.movie_id = mk.movie_id AND cn.id = mc.comp...
job
SELECT s_comment, s_name, p_partkey, s_acctbal, p_mfgr, s_address, n_name, s_phone 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
with year_total as ( select 's' as sale_type, c_customer_id as customer_id, c_email_address as customer_email_address, c_last_name as customer_last_name, c_first_name as customer_first_name, c_preferred_cust_flag as customer_preferred_cust_flag, c_login as customer_login, sum(((ss_ext_list_price - ss_ext_wholesale_cost...
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 ct.id = mc.company_type_id AND mc.movie_id = mi.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct.kind = 'production companies' AND it.info = 'bottom 10 rank...
job
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_custkey, n_name, c_address, c_acctbal, c_phone, c_name, c_comment 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 n_name, c_custkey, c_acctbal, c_comment, c_address, c_phone, sum(l_extendedprice * (1 - l_discount)) as revenue, c_name from customer, orders, lineitem, nation where c_nationkey = n_nationkey and l_orderkey = o_orderkey and c_custkey = o_custkey and o_orderdate >= DATE 1 and o_orderdate < DATE 1 + INTERVAL '3' M...
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 ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Downey%Robert%' AND k.id = mk.keyword_id AND t.id =...
job
SELECT STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, AVG(sr_return_quantity) AS store_returns_quantityave, COUNT(cs_quantity) AS catalog_sales_quantitycount...
tpcds
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.ViewCount >= 0 AND p.Id = c.PostId AND p.Id = v.PostId AND u.Id = p.OwnerUserId AND p.Score <= 192 AND u.Id = b.UserId AND p.Id = ph.PostId
stats
WITH year_total AS ( SELECT c_customer_id AS customer_id, c_first_name AS customer_first_name, c_birth_country AS customer_birth_country, 's' AS sale_type, c_preferred_cust_flag AS customer_preferred_cust_flag, c_login AS customer_login, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sa...
tpcds
WITH year_total AS ( SELECT c_email_address AS customer_email_address, c_preferred_cust_flag AS customer_preferred_cust_flag, c_last_name AS customer_last_name, c_customer_id AS customer_id, c_login AS customer_login, c_birth_country AS customer_birth_country, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_di...
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(k.keyword) AS movie_keyword, MIN(t.title) AS marvel_movie, 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 k.id = mk.keyword_id AND n.id = ci.person_id AND n.name LIKE '%Hemsworth%Chris%' AND k.keyword = 'marvel-cinematic-universe' AND ci.movie_i...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.PostTypeId = 1 AND u.Id = p.OwnerUserId AND p.Id = ph.PostId AND p.Id = v.PostId AND p.Id = c.PostId AND p.Id = pl.PostId AND p.AnswerCount >= 0
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 ct.id = mc.company_type_id AND t.id = mc.movie_id AND t.production_year > 2005 AND rt.role = 'actor'...
job
SELECT COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_size, p_brand, p_type FROM partsupp, part WHERE p_brand <> 1 AND p_type NOT LIKE 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_partkey = ps_partkey GROUP BY p_brand...
tpch
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 t.id = mk.movie_id AND ci.movie_id = mk.movie_id AND n.name Like '%Hemsworth%Chris%' AND t.production_year > 2010 AN...
job
SELECT SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share, o_year 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 p_size, p_type, count(distinct ps_suppkey) as supplier_cnt, p_brand from partsupp, part where ps_suppkey not in ( select s_suppkey from supplier where s_comment like '%Customer%Complaints%' ) AND p_size in (1, 1, 1, 1, 1, 1, 1, 1) AND p_type not like 1 AND p_brand <> 1 AND p_partkey = ps_partkey group by p_brand...
tpch
SELECT cc_name AS call_center_name, cc_call_center_id AS call_center, cc_manager AS manager, SUM(cr_net_loss) AS returns_loss FROM call_center JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk JOIN date_dim ON cr_returned_date_sk = d_date_sk JOIN customer ON cr_returning_customer_sk = c_customer_sk JOIN cus...
tpcds
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 cust_nation, l_year, supp_nation, 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 o_orderk...
tpch
SELECT 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, l_shipmode FROM orders, lineitem WHERE l_shipmode IN (1, 1) AND o_orderkey = l_orde...
tpch
SELECT SUM(cr_net_loss) AS returns_loss, cc_name AS call_center_name, cc_call_center_id AS call_center, cc_manager AS manager FROM call_center JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk JOIN date_dim ON cr_returned_date_sk = d_date_sk JOIN customer ON cr_returning_customer_sk = c_customer_sk JOIN cus...
tpcds
SELECT MIN(t.title) AS voiced_movie, MIN(n.name) AS voicing_actress 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 = ci.movie_id AND mi.movie_id = ci.movie_id AND cn.country_code = '[...
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 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 ( (n1.n_name = 1 AND n2.n_name = 1...
tpch
select sum(ss_quantity) as store_sales_quantity, s_store_name, i_item_desc, i_item_id, sum(sr_return_quantity) as store_returns_quantity, s_store_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 COUNT(*) FROM badges AS b, users AS u, posts AS p WHERE p.PostTypeId = 1 AND u.Id = p.OwnerUserId AND u.Reputation >= 1 AND u.Id = b.UserId LIMIT 10;
stats
Select c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price 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 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 k.keyword = 'marvel-cinematic-universe' AND ci.movie_id = mk.movie_id AND t.production_year > 2010 AND t.id = mk.movie_id AND n.name LIKE '...
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 mk.keyword_id = k.id AND mc.movie_id = t.id AND cn.country_code ='[de]' AND t.id = mk.movie_id AND k.keyword ='character-name-in-title' AND cn.id = mc.comp...
job
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_shipmode IN (1...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.FavoriteCount >= 0 AND p.Id = pl.PostId AND p.Id = c.PostId AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Id = ph.PostId AND c.Score = 0
stats
SELECT MIN(t.title) AS german_movie, MIN(miidx.info) AS rating, MIN(mi.info) AS release_date 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 kt.kind = 'movie' AND mi.movie_id = 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 k.keyword = 'marvel-cinematic-universe' AND t.id = mk.movie_id AND t.id = ci.movie_id AND n.id = ci.person_id AND n.name LIKE '%Downey%Robe...
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 cn.country_code = '[us]' And t.id = mk.movie_id And t.episode_nr >= 50 And t.id = mc.movie_...
job
select count(1) from comments as c, votes as v, badges as b, users as u where u.Id = b.UserId AND u.Id = c.UserId AND u.CreationDate >= '2010-07-20 01:27:29'::timestamp AND u.Id = v.UserId AND c.Score = 1
stats
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 k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Hemsworth%Chris%' AND t.id = mk.movie_id AND t.production_year > 2010 AND k.id = ...
job
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_commitdate <...
tpch
WITH _q AS ( 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_supplyc...
tpch
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 s_address, total_revenue, s_phone, s_name, s_suppkey from supplier, revenue0 where s_suppkey = supplier_no and total_revenue = ( select max(total_revenue) from revenue0 ) order by s_suppkey LIMIT 500;
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 k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND t.id = mk.movie_id AND cn.id = mc.company_id AND mk.keyword_id = k.id AND mc.movie_id ...
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 ci.person_id = an.person_id AND n.gender = 'f' AND ci.role_id = rt.id AND...
job
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_comment, n_name, c_address, c_custkey, c_phone, c_acctbal, c_name FROM customer, orders, lineitem, nation WHERE l_orderkey = o_orderkey AND l_returnflag = 'R' AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND c_nationkey = n_nationkey AND c_custkey = o_custke...
tpch
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 t.id = mk.movie_id AND t.production_year > 2010 AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-univ...
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.production_year > 2000 AND k.keyword Like '%sequel%' AND t.id = mk.movie_id AND mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND t...
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 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 t.id = mk.movie_id AND cn.country_code =...
job
Select Count(*) 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 u.Id = p.OwnerUserId AND p.ViewCount >= 0 AND p.Score <= 192 AND p.Id = c.PostId AND p.Id = v.PostId AND p.Id = ph.PostId
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.role = 'actor' and t.id = mc.movie_id and t.id = ci.movie_id and chn.id = ci.person_role_id and c...
job
SELECT supp_nation, SUM(volume) AS revenue, cust_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 c_nationkey = n2.n_nationkey AND (...
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 it.info = 'bottom 10 rank' AND ct.id = mc.company_type_id AND t.id = mi.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND t.id = mc.movie_id AND mc.n...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE 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 o_orderstatus = 'F' AND EXISTS ( SELECT * FROM lineit...
tpch
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 cc_call_center_id AS call_center, cc_manager AS manager, cc_name AS call_center_name, SUM(cr_net_loss) AS returns_loss FROM call_center INNER JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk INNER JOIN date_dim ON cr_returned_date_sk = d_date_sk INNER JOIN customer ON cr_returning_customer_sk = c_cu...
tpcds
SELECT cnt, ss_ticket_number, c_last_name, c_salutation, c_preferred_cust_flag, 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 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 MIN(t.title) AS northamerican_movie, MIN(mi_idx.info) AS rating 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 mi_idx.movie_id = mc.movie_id AND it2.id = mi.info_type_id AND mi.movi...
job
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 n.name LIKE '%Hemsworth%Chris%' AND t.id = mk.movie_id AND k.id = mk.keyword_id AND k.keyword = 'marvel-cinematic-u...
job
select i_item_id, 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, w_state, 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 ...
tpcds
Select l_year, cust_nation, supp_nation, 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 o_orderkey = l_orderkey AND l_ship...
tpch
SELECT AVG(ss_coupon_amt) AS agg3, AVG(ss_list_price) AS agg2, i_item_id, 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 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 mc.movie_id = mk.movie_id AND t.episode_nr >= 50 AND n.id = ci.perso...
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 (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND t.id = mc.movie_id AND it.id = mi_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 mk.movie_id = mi.movie_id And t.id = mi.movie_id And t.production_year > 2000 And k.keyword Like '%sequel%' And mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') ...
job
Select Count(*) From comments As c, posts As p, postHistory As ph, votes As v, users As u Where p.OwnerUserId = ph.UserId And u.Id = c.UserId And ph.UserId = v.UserId And c.UserId = p.OwnerUserId And p.AnswerCount >= 0 And p.Score <= 13 Limit 10;
stats
select count(*) from postHistory as ph, posts as p, votes as v, badges as b, users as u, comments as c where p.Id = c.PostId AND u.Id = p.OwnerUserId AND p.Score <= 192 AND u.Id = b.UserId AND p.Id = v.PostId AND p.Id = ph.PostId AND p.ViewCount >= 0
stats
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
WITH year_total AS ( SELECT c_first_name AS customer_first_name, c_birth_country AS customer_birth_country, c_last_name AS customer_last_name, c_customer_id AS customer_id, 's' AS sale_type, c_email_address AS customer_email_address, c_login AS customer_login, d_year AS dyear, c_preferred_cust_flag AS customer_preferre...
tpcds
SELECT promotions, total, CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100 FROM ( SELECT SUM(ss_ext_sales_price) AS promotions FROM store_sales JOIN store ON ss_store_sk = s_store_sk JOIN promotion ON ss_promo_sk = p_promo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN customer ON ss_custo...
tpcds
SELECT 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, l_shipmode FROM orders, lineitem WHERE l_receiptdate < DATE 1 + INTERVAL '1' YEAR 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 an.person_id = ci.person_id AND mk.keyword_id = k.id AND cn.country_code = '[us]' AND t.epi...
job
WITH _q AS ( 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 cn.id = mc.company_id AND t.production_year > 2005 AND t.id = mc.movie_id AND rt.role =...
job
SELECT i_manufact_id, i_manufact, i_brand AS brand, SUM(ss_ext_sales_price) AS ext_price, i_brand_id AS brand_id 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(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 k.id = mk.keyword_id and k.keyword = 'marvel-cinematic-universe' and n.name like '%Downey%Robert%' and n.id = ci.person_id and t.id = ci.mo...
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 pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Score <= 40 AND p.Id = ph.PostId AND b.UserId = u.Id AND c.UserId = u.Id AND p.Id = c.PostId AND p.Id = pl.RelatedPostId
stats
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 k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND n.id = ci.person_id AND t.id = mk.movie_id AND t.id = ci.movie_id AND t.production_y...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_nationkey = n_nationkey AND s_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 EXISTS ( SELECT * FROM l...
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 mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND cn.country_code ='[de]' AND t.id = mk.movie_id AND mc.movie_id = t.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 p_partkey = l_partkey...
tpch
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v where pl.LinkTypeId = 1 and p.Id = pl.PostId and p.FavoriteCount >= 0 and p.Id = ph.PostId and p.Id = c.PostId and p.Id = v.PostId and c.Score = 0
stats
SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, o_shippriority FROM customer, orders, lineitem WHERE l_shipdate > DATE 1 AND c_custkey = o_custkey AND o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_orderkey = o_orderkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
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 cn.country_code = '[jp]' AND n1.id = ci.person_id AND mc.company_id = cn.id AND n1.name NOT LIKE '%Yu%' AND an1...
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 i_brand_id AS brand_id, i_manufact_id, SUM(ss_ext_sales_price) AS ext_price, i_brand AS brand, i_manufact FROM date_dim INNER JOIN store_sales ON d_date_sk = ss_sold_date_sk INNER JOIN item ON ss_item_sk = i_item_sk INNER JOIN customer ON ss_customer_sk = c_customer_sk INNER JOIN customer_address ON c_current_ad...
tpcds
SELECT MAX(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 ct.id = mc.company_type_id AND mc.movie_id = mi.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND (mc.note LIKE '%(co-production)...
job
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 ct.id = mc.company_type_id AND rt.id = ci.role_id AND t.id = ci.movie_id AND cn.id = mc.company_id A...
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 t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND ct.kind = 'pr...
job
select s_name, s_address from supplier, nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like 1 ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= DATE 1 and l...
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.country_code ='[nl]' AND mk.keyword_id = k.id AND cn.id = mc.company_id AND t.id = mk.movie_id AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-IN-...
job
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.production_year > 2005 AND rt.role = 'actor' AND chn.id = ci.person_role_id...
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 ct.kind = 'production companies' And (mc.note Like '%(co-production)%' Or mc.note Like '%(presents)%') And it.id = mi.info_type_id And it.info = 'bottom 10 rank' And t.id = mc.movie_...
job
select cntrycode, COUNT(1) as numcust, sum(c_acctbal) as totacctbal from ( select SUBSTRING(c_phone from 1 FOR 2) as cntrycode, c_acctbal from customer where c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and SUBSTRING(c_phone from 1 FOR 2) in (1, 1, 1, 1, 1, 1, 1) ) and SUBSTRING(c_phone from...
tpch
select count(*) from comments as c, postHistory as ph, users as u where u.UpVotes <= 27 and c.UserId = ph.UserId and u.Id = c.UserId and u.Reputation >= 1 LIMIT 100;
stats
SELECT SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count, l_shipmode, SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count FROM orders, lineitem WHERE l_commitdate < l_receiptdate AND o_orderkey ...
tpch
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 k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_id AND t.id = mk.movie_...
job