text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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 mi.info LIKE 'USA:% 199%' AND t.id ...
job
SELECT s_name, COUNT(1) AS numwait FROM supplier, lineitem l1, orders, nation WHERE EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptda...
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 t.production_year > 2010 AND n.id = ci.person_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Hem...
job
Select Max(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 k.id = mk.keyword_id And mk.movie_id = mi.movie_id And t.id = mi.movie_id And t.id = mk.movie_id And k.keywo...
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 mc.company_id = cn.id AND k.keyword = 'character-name-in-title' AND cn.country_code = '[us]...
job
WITH _q AS ( SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE p.AnswerCount >= 0 ) SELECT * FROM _q AND c.UserId = p.OwnerUserId AND ph.UserId = v.UserId AND u.Id = c.UserId AND p.OwnerUserId = ph.UserId AND p.Score <= 13
stats
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_birth_country AS customer_birth_country, c_first_name AS customer_first_name, 's' AS sale_type, c_customer_id AS customer_id, c_preferred_cust_flag AS customer_...
tpcds
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 b.UserId = c.UserId AND c.Score = 0 AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND p.Id = ph.PostId
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 t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND t.production_year > 2010 AND k.id = mk.key...
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 chn.id = ci.person_role_id AND ci.role_id = rt.id AND t.id = mc.movie_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 ci.movie_id = mc.movie_id AND t.id = mc.movie_id AND k.keywor...
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 MAX(n.name) AS voicing_actress, MAX(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 n.id = ci.person_id AND n.gender = 'f' AND...
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 kt.kind = 'movie' AND t.id = mc.movie_id AND it2.info = 'release dates...
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 p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND p.Score <= 40 AND c.UserId = u.Id AND b.UserId = u.Id AND p.Id = pl.RelatedPostId AND p.Id = ph.PostId
stats
SELECT s_store_id, MAX(cs_net_profit) AS catalog_sales_profit, i_item_id, s_store_name, MAX(sr_net_loss) AS store_returns_loss, MAX(ss_net_profit) AS store_sales_profit, i_item_desc 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 * 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_list_price BETWEEN 98 AND 98 + 10 OR ss_coupon_amt BETWEEN 2458 AND 2458 + 1000 OR ss_wholesale_cost BETWEEN 49 AND 49 + 20) ) AS b2, ( SELECT AVG(ss_list_price) AS b3_...
tpcds
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, badges as b where p.Id = c.PostId and pl.LinkTypeId = 1 and p.Id = v.PostId and c.Score = 0 and p.Id = pl.RelatedPostId and p.Id = ph.PostId and b.UserId = c.UserId
stats
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 ci.movie_id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND t.id = mk.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AN...
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 t.id = mi.movie_id AND at.movie_id = mc.movie_id AND at.movie_id = mi....
job
Select Count(*) From users As u, posts As p Where u.Id = p.OwnerUserId And u.Reputation >= 1 LIMIT 50;
stats
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 an1.person_id = ci.person_id AND n1.id = ci.person_id AND t.id = mc.movie_id AND mc.company_id = cn.id AND an1....
job
SELECT AVG(l_discount) AS avg_disc, AVG(l_extendedprice) AS avg_price, l_returnflag, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_quantity) AS avg_qty, l_linestatus, COUNT(*) AS count_order, SUM(l_quantity) AS sum_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extend...
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 cn.country_code = '[us]' AND mi.movie_id = ci.movie_id AND n.id = ci.pers...
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 AVG(l_discount) AS avg_disc, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_extendedprice) AS avg_price, SUM(l_quantity) AS sum_qty, l_returnflag, l_linestatus, COUNT(*) AS count_order, SUM(l_extend...
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.production_year > 2010 AND k.id = mk.keyword_id AND t.id = mk.movie_id AND ci.movie_id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AN...
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 = t.id and cn.country_code ='[sm]' and mc.movie_id = mk.movie_id and cn.id = mc.company_id and mk.keyword_id = k.id and t.id = mk.mo...
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 mk.keyword_id = k.id AND t.id = mk.movie_id AND mc.movie_id = t.id AND cn.id = mc.company_id AND cn.country_code =...
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.movie_id = mi.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi.movie_id AND ct.kind = 'production companies' AND it.info = 'bottom 10 rank' AND t....
job
Select Sum(l_extendedprice * (1 - l_discount)) As revenue, o_orderdate, l_orderkey, o_shippriority From customer, orders, lineitem Where l_orderkey = o_orderkey AND c_custkey = o_custkey AND o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_shipdate > DATE 1 Group By l_orderkey, o_orderdate, o_shippriority Order By reven...
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 mk.keyword_id = k.id AND k.keyword ='character-name-In-title' AND t.id = mk.movie_id AND cn.id = mc.company_id AND cn.country_code ='[sm]' AND mc.movie_id = mk.movie_id AND mc.movie_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_receiptdate < DATE 1 + INTERVAL '1' YEAR 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 k.keyword ='character-name-in-title' AND 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 cn.id = mc.comp...
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.movie_id = mi_idx.movie_id And it.id = mi_idx.info_type_id And ct.kind = 'production companies' And ct....
job
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 mk.movie_id = mi.movie_id AND k.keyword LIKE '%sequel%' AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND k.id = mk.keyword_id ) SELECT * FRO...
job
SELECT AVG(ss_ext_sales_price), SUM(ss_ext_wholesale_cost), 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(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 lt.id = ml.link_type_id AND (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND t.id = ci.movie_id AND an.pe...
job
WITH _q AS ( 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 ) SELECT * FROM _q AND mc.movie_id = t.id AND t.id = mk.movie_id AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND cn.country...
job
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_custkey = o_custkey AND o_orderdate >= DATE 1 AND c_nationkey = s_nationkey AND l_suppkey = s_suppkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND l_orderkey = o_orderkey AND s_nationk...
tpch
SELECT cc_manager AS manager, cc_call_center_id AS call_center, SUM(cr_net_loss) AS returns_loss, cc_name AS call_center_name 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 i_item_id, i_item_desc, i_current_price From item Join inventory On i_item_sk = inv_item_sk Join date_dim On d_date_sk = inv_date_sk Join catalog_sales On cs_item_sk = i_item_sk Where inv_quantity_on_hand BETWEEN 100 AND 500 AND i_current_price BETWEEN 77 AND 77 + 30 AND d_date BETWEEN CAST('2001-07-13' As DATE)...
tpcds
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderstatus = 'F' AND n_name = 1 AND s_nationkey = n_nationkey AND l1.l_receiptdate > l1.l_commitdate AND o_orderkey = l1.l_orderkey AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1...
tpch
SELECT dt.d_year, SUM(ss_ext_sales_price) AS ext_price, item.i_brand AS brand, item.i_brand_id AS brand_id FROM date_dim AS dt JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE dt.d_year = 1999 AND item.i_manager_id = 95 AND dt.d_moy = 12 GROUP BY ...
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(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 mi_idx.movie_id = mc.movie_id AND mi.mo...
job
SELECT i_brand AS brand, i_manufact_id, i_brand_id AS brand_id, i_manufact, 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
WITH year_total AS ( SELECT c_customer_id AS customer_id, c_preferred_cust_flag AS customer_preferred_cust_flag, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, d_year AS dyear, 's' AS sale_type, c_first_name AS customer_first_name, c_birth_country AS cus...
tpcds
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 an.name LIKE '%a%' AND (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND t...
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 cn.country_code = '[de]' AND ct.kind = 'product...
job
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(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 k.keyword ='character-name-in-title' and mk.keyword_id = k.id and mc.movie_id = t.id and cn.id = mc.comp...
job
WITH _q AS ( 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 t.id = at.movie_id AND mi.info LIKE 'USA:%200%' AND kt.ki...
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_type NOT LIKE 1 AND p_partkey = ps_partkey AND p_brand <> 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) GROUP BY p_brand...
tpch
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 ci.note LIKE '%(uncredited)%' AND t.production_year > 2005 AND ci.note LIKE '%(voice)%' AND ct.id = ...
job
SELECT c_last_name, c_first_name, ss_ticket_number, c_preferred_cust_flag, c_salutation, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN store ON ss_store_sk = s_store_sk INNER JOIN household_demographics ON ss_hdemo_sk =...
tpcds
WITH _q AS ( SELECT cntrycode, COUNT(*) AS numcust, SUM(c_acctbal) AS totacctbal FROM ( SELECT SUBSTRING(c_phone FROM 1 FOR 2) AS cntrycode, c_acctbal FROM customer WHERE SUBSTRING(c_phone FROM 1 FOR 2) IN (1, 1, 1, 1, 1, 1, 1) AND c_acctbal > ( SELECT AVG(c_acctbal) FROM customer WHERE c_acctbal > 0.00 AND SUBSTRING(c...
tpch
Select c_preferred_cust_flag, cnt, c_last_name, ss_ticket_number, 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 c_last_name, ss_ticket_number, cnt, c_preferred_cust_flag, c_first_name, c_salutation 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 movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE k.keyword LIKE '%sequel%' AND mk.movie_id = mi.movie_id AND t.production_year > 2005 AND t.id = mi.movie_id AND k.id = mk.keyword_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish'...
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 mi.movie_id = miidx.movie_id AND mi.movie_id = ...
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 = mi_idx.movie_id AND t.id = mc.movie_id AND mc.movie_id = mi_idx.movie_id AND mc.note NOT LIKE '%(as...
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 c_custkey = o_custkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND c_nationkey = n_nationkey AND l_orderkey = o_orderke...
tpch
Select s_store_id, i_item_id, Sum(ss_quantity) As store_sales_quantity, Sum(cs_quantity) As catalog_sales_quantity, s_store_name, i_item_desc, 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 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(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.production_year > 2000 AND mi.movie_id = ci.movie_id AND n.gender = 'f'...
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 s_suppkey = l_suppkey AND ps_suppkey = l_suppkey AND o_orderk...
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 t.id = mk.movie_id AND mc.movie_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.comp...
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 (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND pi.person_id = an.person_id AND it.info = 'mini biograph...
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.id = mk.movie_id AND mc.movie_id = mk.movie_id AND t.id = mc.movie_id AND cn.country_code...
job
select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no and total_revenue = ( select max(total_revenue) from revenue0 ) order by s_suppkey limit 20;
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 = ph.PostId And p.FavoriteCount >= 0 And p.Id = pl.PostId And p.Id = c.PostId And c.Score = 0 And p.Id = v.PostId
stats
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 = mk.movie_id AND t.episode_nr < 100 AND mc.company_id = cn.id AND t.id = mk.mo...
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 mi.movie_id = mc.movie_id AND rt.role = 'actress' AND ci.person_id = an.p...
job
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_nationkey = s_nationkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND s_nationkey = n_nationkey AND l_suppkey = s_suppkey AND n_reg...
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 mi.movie_id = ci.movie_id AND ci.note IN ('(voice)', '(voice: Japanese ve...
job
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 INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN store ON ss_store_sk = s_store_sk INNER JOIN household_demographics ON ss_hdemo_sk =...
tpcds
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 mi.movie_id = ci.movie_id AND t.id = mc.movie_id AND n.gender = 'f' AND c...
job
SELECT COUNT(ss_quantity) AS store_sales_quantitycount, AVG(sr_return_quantity) AS store_returns_quantityave, AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, s_sta...
tpcds
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_custkey, 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 o_orderpriority, Count(*) As order_count From orders Where o_orderdate < DATE 1 + INTERVAL '3' MONTH And o_orderdate >= DATE 1 And Exists ( Select * From lineitem Where l_orderkey = o_orderkey And l_commitdate < l_receiptdate ) Group By o_orderpriority Order By o_orderpriority Limit 10;
tpch
WITH year_total AS ( SELECT c_preferred_cust_flag AS customer_preferred_cust_flag, c_birth_country AS customer_birth_country, c_login AS customer_login, c_last_name AS customer_last_name, c_email_address AS customer_email_address, c_customer_id AS customer_id, 's' AS sale_type, d_year AS dyear, c_first_name AS customer...
tpcds
SELECT COUNT(*) AS count_order, AVG(l_discount) AS avg_disc, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice) AS sum_base_price, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_quantity) AS sum_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, ...
tpch
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 ci.note LIKE '%(voice: English version)%' AND ci.movie_id = m...
job
WITH _q AS ( 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 t.production_year > 2010 AND n.id = ci.person_id AND k.id = mk.keyword_id AND t.id = ci.movie_id AND n.name LIKE '%Hemsworth%C...
job
SELECT MIN(t.title) AS western_violent_movie, MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating 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 SUM(amount) AS sum_profit, o_year, nation 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_suppkey = l_suppkey AND s_nationkey = n_nationkey AND ps_su...
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 t.id = mk.movie_id AND n.id = ci.person_id AND k.keyword = 'marvel-cinematic-universe' AND t.production_year > 2010 AND t.id = ci.movie_id ...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.Id = c.PostId AND u.Id = p.OwnerUserId AND p.Id = v.PostId AND p.Id = pl.PostId AND p.PostTypeId = 1 AND p.Id = ph.PostId AND p.AnswerCount >= 0
stats
SELECT MIN(t.title) AS series_named_after_char, MIN(an.name) AS cool_actor_pseudonym 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 n.id = ci.person_id AND ci.movie_id = t.id AND ci.movie_id ...
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 ci.note LIKE '%(uncredited)%' AND cn.id = mc.company_id AND chn.id = ci.person_role_id AND t.product...
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 k.id = mk.keyword_id AND cn.country_code = '[jp]' AND an.pers...
job
Select Sum(l_extendedprice * l_discount) As revenue From lineitem Where l_discount Between 1 - 0.01 And 1 + 0.01 And l_shipdate < DATE 1 + INTERVAL '1' YEAR And l_shipdate >= DATE 1 And l_quantity < 1 Limit 50;
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 COUNT(*) FROM posts AS p, postLinks AS pl, users AS u WHERE p.CommentCount <= 17 AND p.OwnerUserId = u.Id AND p.Id = pl.PostId AND u.CreationDate <= '2014-09-12 07:12:16'::timestamp LIMIT 500;
stats
SELECT item.i_brand_id AS brand_id, dt.d_year, SUM(ss_ext_sales_price) AS sum_agg, item.i_brand AS brand 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 dt.d_moy = 12 AND item.i_manufact_id = 266 GROUP BY dt.d_year...
tpcds
SELECT AVG(cs_quantity) AS agg1, i_item_id, AVG(cs_sales_price) AS agg4, AVG(cs_coupon_amt) AS agg3, AVG(cs_list_price) AS agg2 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 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 ci.movie_id = mc.movie_id AND t.id = mk.movie_id AND an.person_id = ...
job
Select cntrycode, Count(*) As numcust, Sum(c_acctbal) As totacctbal From ( Select SUBSTRING(c_phone From 1 FOR 2) As cntrycode, c_acctbal From customer Where SUBSTRING(c_phone From 1 FOR 2) In (1, 1, 1, 1, 1, 1, 1) And c_acctbal > ( Select Avg(c_acctbal) From customer Where c_acctbal > 0.00 And SUBSTRING(c_phone From 1...
tpch
WITH year_total AS ( SELECT c_birth_country AS customer_birth_country, c_last_name AS customer_last_name, c_email_address AS customer_email_address, 's' AS sale_type, c_first_name AS customer_first_name, c_login AS customer_login, d_year AS dyear, c_preferred_cust_flag AS customer_preferred_cust_flag, SUM(((ss_ext_list...
tpcds