text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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 cn.id = mc.company_id AND chn.id = ci.person_role_id AND ct.id = mc.company_ty...
job
select sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, l_returnflag, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, l_linestatus, sum(l_quantity) as sum_qty, count(*) as count_order, avg(l_discount) as avg_disc, sum(l_extendedprice) as sum_base_price, avg(l_extendedprice) as avg_price, ...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, users AS u WHERE u.Id = p.OwnerUserId AND c.CreationDate >= '2010-08-05 00:36:02'::timestamp AND p.CommentCount >= 0 AND c.UserId = u.Id AND p.ViewCount >= 0 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 t.id = mk.movie_id AND cn.country_code ='[de]' AND cn.id = mc.company_id AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-In-title' AND mc.movie_id ...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderstatus = 'F' AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND s_nationkey = n_nationkey AND EXISTS ( SELECT * FROM lineit...
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 ct.kind = 'production companies' AND mi.movie_i...
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 it.id = mi.info_type_id AND ct.kind = 'production companies' AND t.id = mi.movie_id AND mc.movie_id = mi.movie_id AND it.info = 'bottom 10 rank' AND ct.id = mc.company_type_id AND mc...
job
SELECT MAX(an1.name) AS actress_pseudonym, MAX(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 mc.company_id = cn.id AND an1.person_id = ci.person_id AND mc.note LIKE '%(Japan)%' AND ci.movie_id = t.id AND ...
job
select min(an.name) as cool_actor_pseudonym, min(t.title) as series_named_after_char from aka_name as an, cast_info as ci, company_name as cn, keyword as k, movie_companies as mc, movie_keyword as mk, name as n, title as t where an.person_id = n.id and t.episode_nr >= 50 and k.keyword = 'character-name-in-title' and ci...
job
select count(*) from comments as c, votes as v, users as u where u.Id = c.UserId AND c.CreationDate >= '2010-08-10 17:55:45'::timestamp AND u.Id = v.UserId AND u.Reputation >= 1
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(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 lt.link = 'features' AND pi.person_id = an.person_id AND t.id = ci.movie_id AND an.person_id = ci.person_id AND pi.per...
job
WITH year_total AS ( SELECT c_customer_id AS customer_id, d_year AS dyear, c_preferred_cust_flag AS customer_preferred_cust_flag, c_email_address AS customer_email_address, 's' AS sale_type, c_last_name AS customer_last_name, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) /...
tpcds
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.movie_id = mc.movie_id AND t.id = mc.movie_id AND t.id = ci.movie_id AND rt.role = 'actor' AND ci...
job
SELECT SUM(cr_net_loss) AS returns_loss, cc_name AS call_center_name, cc_manager AS manager, cc_call_center_id AS call_center 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 s_store_name, SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, i_item_id, i_item_desc, 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 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 t.id = mc.movie_id AND it.id = mi_idx.info_type_id AND ct.id = mc.company_typ...
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 mk.movie_id = ci.movie_id AND mc.note NOT LIKE '%(USA)%' AND ...
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 o_orderkey = l_orderkey AND l_ship...
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.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND n.id = ci.person_id AND ci.movie_id = mk.movie_id AND n.name LIKE '%Do...
job
select COUNT(1) from badges as b, posts as p where b.UserId = p.OwnerUserId AND b.Date <= '2014-09-11 08:55:52'::timestamp AND p.AnswerCount >= 0 AND p.AnswerCount <= 4
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.production_year > 2010 AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND k.id = mk.key...
job
SELECT AVG(l_discount) AS avg_disc, AVG(l_extendedprice) AS avg_price, SUM(l_quantity) AS sum_qty, l_returnflag, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_linestatus, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charg...
tpch
SELECT SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, l_shipmode, 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 = ANY...
tpch
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 * from ( select avg(ss_list_price) as b1_lp, count(ss_list_price) as b1_cnt, count(distinct ss_list_price) as b1_cntd from store_sales where ss_quantity BETWEEN 0 AND 5 AND (ss_list_price BETWEEN 28 AND 28 + 10 or ss_coupon_amt BETWEEN 614 AND 614 + 1000 or ss_wholesale_cost BETWEEN 87 AND 87 + 20) ) as b1, ( se...
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 kt.kind = 'movie' AND it2.id = mi.info_type_id AND mi.info LIKE 'USA:%...
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_shipmode IN ...
tpch
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE o_orderkey = l_orderkey AND ps_suppkey = l_suppkey AND s_supp...
tpch
WITH year_total AS ( SELECT 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_birth_country AS customer_birth_country, c_preferred_cust_flag AS customer_preferred_cust_flag, c_last_name AS customer_last_name, c_customer_id AS customer_id...
tpcds
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE t.id = ci.movie_id AND ci.role_id = rt.id AND mk.movie_id = c...
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 k.id = mk.keyword_id And t.production_year > 2010 And t.id = mi.movie_id And mi.info In ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') And t.id = mk.movie_id ...
job
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM lineitem, part WHERE ( p_partkey = l_partkey AND p_brand = 1 AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') AND l_quantity >= 1 AND l_quantity <= 1 + 10 AND p_size >= 1 AND p_size <= 5 AND l_shipmode IN ('AIR', 'AIR REG') AND l_shipinstruct =...
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 n.id = ci.person_id AND k.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND n.name LIKE '%Hemsworth%Chris%' AND t.id = mk....
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 Count(*) From comments As c, posts As p, votes As v, users As u Where u.Id = c.UserId AND p.ViewCount >= 0 AND u.Id = p.OwnerUserId AND c.Score = 0 AND p.Score >= 0 AND u.Id = v.UserId
stats
SELECT SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice) AS sum_base_price, AVG(l_discount) AS avg_disc, l_linestatus, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, COUNT(*) AS count_order, l_returnflag, AVG(l_quantity) AS avg_qty, SUM(l_quantity) AS sum_qty, AVG(l_e...
tpch
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE cn.country_code = '[us]' AND mi.movie_id = mc.movie_id AND at.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 cn.country_code = '[us]' AND n.id = ci.person_id AND t.id = mc.movie_id A...
job
Select cc_call_center_id As call_center, cc_name As call_center_name, 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 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 lt.link = 'features' AND lt.id = ml.link_type_id AND ci.person_id = n.id AND an.person_id = ci.person_id AND an.name L...
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 mk.movie_id = mi.movie_id AND t.id = mi.movie_id AND t.id = mk.movie_id AND k.keyword LIKE '%sequel%' AND t.production_year > 2010 AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish...
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 cn.country_code = '[jp]' AND mk.movie_id = ci.movie_id AND mk...
job
SELECT o_shippriority, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, l_orderkey FROM customer, orders, lineitem WHERE l_shipdate > DATE 1 AND o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales INNER JOIN store ON s_store_sk = ss_store_sk INNER JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk INNER JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk INNER JOIN customer_address ON...
tpcds
SELECT n_name, c_custkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_acctbal, c_phone, c_comment, c_name, c_address FROM customer, orders, lineitem, nation WHERE o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND c_nationkey = n_nationkey AND o_orderdate >= DA...
tpch
SELECT o_orderkey, c_custkey, o_totalprice, SUM(l_quantity), o_orderdate, c_name FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey HAVING SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey, o_orderkey, o_orderdat...
tpch
select o_shippriority, l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate from customer, orders, lineitem where c_mktsegment = 1 and c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate < DATE 1 and l_shipdate > DATE 1 group by l_orderkey, o_orderdate, o_shippriority order by reven...
tpch
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 INNER JOIN store ON ss_store_sk = s_store_sk INNER JOIN promotion ON ss_promo_sk = p_promo_sk INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER J...
tpcds
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE mc.movie_id = mi_idx.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it...
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.movie_id = mc.movie_id And t.production_year > 2005 And cn.country_code = '[ru]' And t.id = ci.mo...
job
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE s_nationkey = n_nationkey AND p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND n_regionkey = r_regionkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, na...
tpch
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_nationkey = n_nationkey AND ps_suppkey = l_suppkey AND o_or...
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 cn.country_code ='[de]' AND mc.movie_id = t.id AND mk.keyword_id = k.id AND t.id = mk.movie_id AND k.keyword ='character-name-in-title' 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 ca_city, bought_city, extended_tax, c_first_name, c_last_name, list_price, extended_price, ss_ticket_number 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(mi_idx.info) As rating, Min(t.title) As movie_title From info_type As it, movie_info_idx As mi_idx, title As t Where mi_idx.info > '8.0' And it.id = mi_idx.info_type_id And it.info ='rating' And t.production_year Between 2000 And 2005 And t.id = mi_idx.movie_id Limit 20;
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.role_id = rt.id AND cn.country_code = '[jp]' AND n.id = ci...
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 cn.country_code ='[nl]' AND mc.movie_id = t.id AND cn.id = mc.company_id AND mk.keyword_id = k.id AND t.id = mk.movie_id AND k.keyword ='character-name-IN-...
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 NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi_idx.movie_id AND (mc.note LIKE '%(co-...
job
select sum(ss_ext_sales_price) as ext_price, item.i_brand as brand, dt.d_year, 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 item.i_manager_id = 67 and dt.d_moy = 11 and dt.d_year = 1999 group by ...
tpcds
SELECT o_totalprice, SUM(l_quantity), o_orderkey, c_custkey, c_name, o_orderdate FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey HAVING SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey, o_orderkey, o_orderdat...
tpch
SELECT MIN(t.title) AS movie_title FROM 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 mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND mc.movie_id = t.id AND k.keyword ='character-name-IN-title' AND t.id = mk.movie_id AND cn.country_code =...
job
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_mktsegment = 1 AND c_custkey = o_custkey AND o_orderdate < DATE 1 AND l_orderkey = o_orderkey Group By l_orderkey, o_orderdate, o_shippriority Order By reven...
tpch
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE mk.movie_id = mi.movie_id AND t.id = mk.movie_id AND k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.p...
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 AND l_shipdate < l_c...
tpch
SELECT c_first_name, c_salutation, c_last_name, 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 extended_tax, extended_price, ca_city, c_first_name, bought_city, ss_ticket_number, list_price, c_last_name FROM ( SELECT ss_ticket_number, ss_customer_sk, ca_city AS bought_city, SUM(ss_ext_sales_price) AS extended_price, SUM(ss_ext_list_price) AS list_price, SUM(ss_ext_tax) AS extended_tax FROM store_sales INN...
tpcds
WITH _q AS ( SELECT a.ca_state AS state, COUNT(1) AS cnt FROM customer_address AS a JOIN customer AS c ON a.ca_address_sk = c.c_current_addr_sk JOIN store_sales AS s ON c.c_customer_sk = s.ss_customer_sk JOIN date_dim AS d ON s.ss_sold_date_sk = d.d_date_sk JOIN item AS i ON s.ss_item_sk = i.i_item_sk WHERE d.d_month_s...
tpcds
SELECT l_linestatus, AVG(l_quantity) AS avg_qty, AVG(l_discount) AS avg_disc, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, l_returnflag, AVG(l_extendedprice) AS avg_price, COUNT(1) AS count_order, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, ...
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 ci.role_id = rt.id AND rt.role = 'actress' AND n1.id = ci.person_id AND t.id = mc.movie_id AND mc.note LIKE '%(...
job
select avg(ss_sales_price) as agg4, avg(ss_coupon_amt) as agg3, avg(ss_quantity) as agg1, i_item_id, avg(ss_list_price) as agg2 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 SUM(l_extendedprice * (1 - l_discount)) AS revenue, l_orderkey, o_shippriority, o_orderdate FROM customer, orders, lineitem WHERE c_mktsegment = 1 AND l_shipdate > DATE 1 AND o_orderdate < DATE 1 AND c_custkey = o_custkey AND l_orderkey = o_orderkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
SELECT p_partkey, s_comment, p_mfgr, s_phone, s_acctbal, s_name, n_name, s_address FROM part, supplier, partsupp, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 1 AND p_type LIKE 1 AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r_name = 1 AND ps_supplycost = ( SELEC...
tpch
SELECT MIN(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 ci.note LIKE '%(voice)%' AND cn.country_code = '[ru]' AND ci.movie...
job
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE it.id = mi.info_type_id AND n.gender = 'f' AND rt.role = 'actress' AND ci...
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 cn.id = mc.company_id AND mi.movie_id = miidx.m...
job
select count(*) from comments as c, posts as p, postLinks as pl where p.Id = pl.PostId and p.CommentCount <= 18 and p.CreationDate >= '2010-07-23 07:27:31'::timestamp and p.CreationDate <= '2014-09-09 01:43:00'::timestamp and c.UserId = p.OwnerUserId
stats
Select o_totalprice, c_custkey, c_name, o_orderkey, o_orderdate, Sum(l_quantity) From customer, orders, lineitem Where o_orderkey In ( Select l_orderkey From lineitem Group By l_orderkey Having Sum(l_quantity) > 1 ) And c_custkey = o_custkey And o_orderkey = l_orderkey Group By c_name, c_custkey, o_orderkey, o_orderdat...
tpch
SELECT 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 s_suppkey = l_suppkey...
tpch
Select Count(*) From postHistory As ph, posts As p, votes As v, badges As b, users As u, comments As c Where p.Score <= 192 And p.ViewCount >= 0 And p.Id = ph.PostId And u.Id = b.UserId And p.Id = c.PostId And p.Id = v.PostId And u.Id = p.OwnerUserId
stats
SELECT a.ca_state AS state, COUNT(1) AS cnt FROM customer_address AS a INNER JOIN customer AS c ON a.ca_address_sk = c.c_current_addr_sk INNER JOIN store_sales AS s ON c.c_customer_sk = s.ss_customer_sk INNER JOIN date_dim AS d ON s.ss_sold_date_sk = d.d_date_sk INNER JOIN item AS i ON s.ss_item_sk = i.i_item_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 ct.id = mc.company_type_id AND t.id = mi.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.movie_id = mi.movie_id AND mc.note NOT LIKE '%(as Metro...
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.keyword LIKE '%sequel%' AND k.id = mk.keyword_id AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND t.id = mi.movie_id AND t.production_year > 2005 AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmar...
job
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.Score <= 192 AND u.Id = b.UserId AND p.Id = ph.PostId AND p.Id = c.PostId AND p.Id = v.PostId AND p.ViewCount >= 0 AND u.Id = p.OwnerUserId
stats
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND k....
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 n1.name Like '%Yo%' AND ci.movie_id = t.id AND ci.role_id = rt.id AND n1.id = ci.person_id AND n1.name Not Like...
job
SELECT i_item_id, i_item_desc, s_store_id, s_store_name, SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti...
tpcds
SELECT MIN(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 n1.name NOT LIKE '%Yu%' AND ci.movie_id = mc.movie_id AND...
job
SELECT c_phone, c_acctbal, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, n_name, c_comment, c_custkey, c_name FROM customer, orders, lineitem, nation WHERE c_nationkey = n_nationkey AND l_returnflag = 'R' AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND o_orderdate >= DATE 1 AND l_orderkey = o_orderke...
tpch
SELECT SUM(ss_ext_wholesale_cost), AVG(ss_ext_wholesale_cost), AVG(ss_ext_sales_price), AVG(ss_quantity) 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 n_name, s_comment, s_name, p_partkey, s_acctbal, s_address, p_mfgr, 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
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 mk.keyword_id = k.id AND cn.country_code ='[nl]' AND k.keyword ='character-name-IN-title' AND cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND t.id = mk.mo...
job
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE mi.note LIKE '%internet%' AND mk.mo...
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_commitdate < l_receiptdate AND l_receiptda...
tpch
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_mktsegment = 1 And l_orderkey = o_orderkey And o_orderdate < DATE 1 And c_custkey = o_custkey Group By l_orderkey, o_orderdate, o_shippriority Order By reven...
tpch
SELECT p_brand, p_type, p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_partkey = ps_partkey AND p_brand <> 1 AND p_type NOT LIKE 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND NOT EXISTS (SELECT 1 FROM (SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%') AS _ne WHE...
tpch
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, users As u Where p.Id = ph.PostId AND p.AnswerCount >= 0 AND p.Id = pl.PostId AND p.PostTypeId = 1 AND p.Id = c.PostId AND u.Id = p.OwnerUserId AND p.Id = v.PostId
stats
SELECT o_shippriority, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, l_orderkey FROM customer, orders, lineitem WHERE c_mktsegment = 1 AND c_custkey = o_custkey AND l_orderkey = o_orderkey AND l_shipdate > DATE 1 AND o_orderdate < DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
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_type LIKE 1 AND r_name = 1 AND s_nationkey = n_nationkey AND p_size = 1 AND n_regionkey = r_regionkey AND ps_supplycost = ( SELEC...
tpch