text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = mk.movie_id AND cn.country_code ='[nl]' AND t.id = mk.movie_id AND mc.movie_id = t.id AND k.keyword ='character-name-in-title' AND cn.id = mc.company_id AND mk.keyword_id ...
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 = t.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 t.id = mk.movie_id AND k.keyword ='chara...
job
SELECT c_preferred_cust_flag, ss_ticket_number, cnt, c_last_name, 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(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.info ='rating' AND it.id = mi_idx.info_type_id AND t.id = mi_idx.movie_id AND t.production_year BETWEEN 2000 AND 2005 LIMIT 50;
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 s_nationkey = n2.n_na...
tpch
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE cn.id = mc.company_id AND ml.movie_...
job
SELECT i_item_id, i_item_desc, i_current_price FROM item INNER JOIN inventory ON i_item_sk = inv_item_sk INNER JOIN date_dim ON d_date_sk = inv_date_sk INNER JOIN catalog_sales ON cs_item_sk = i_item_sk WHERE i_current_price BETWEEN 75 AND 75 + 30 AND d_date BETWEEN CAST('2000-05-01' AS DATE) AND (CAST('2000-05-01' AS ...
tpcds
SELECT ss_ticket_number, c_last_name, c_first_name, list_price, ca_city, extended_tax, bought_city, extended_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(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 k.keyword = 'character-name-In-title' And t.episode_nr >= 50 A...
job
SELECT SUM(l_quantity), o_orderdate, o_orderkey, c_name, c_custkey, o_totalprice FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey HAVING SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey, o_orderkey, o_orderdat...
tpch
Select 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, 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, i_item_id ...
tpcds
SELECT c_custkey, c_comment, SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name, c_acctbal, c_address, c_name, c_phone FROM customer, orders, lineitem, nation WHERE o_orderdate < DATE 1 + INTERVAL '3' MONTH AND o_orderdate >= DATE 1 AND l_returnflag = 'R' AND l_orderkey = o_orderkey AND c_custkey = o_custkey AN...
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 it1.info = 'rating' AND it2.id = mi.info_type_id AND at.movie_id = mi_...
job
select avg(ss_quantity), avg(ss_ext_sales_price), avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost) from store_sales join store on s_store_sk = ss_store_sk join customer_demographics on cd_demo_sk = ss_cdemo_sk join household_demographics on hd_demo_sk = ss_hdemo_sk join customer_address on ca_address_sk = ss_addr...
tpcds
SELECT MIN(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 ci.note LIKE '%(voice: English versi...
job
select count(*) from comments as c, posts as p, users as u where p.ViewCount >= 0 and u.Id = p.OwnerUserId and p.CommentCount >= 0 and c.CreationDate >= '2010-08-05 00:36:02'::timestamp and c.UserId = u.Id and p.FavoriteCount >= 0
stats
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE s_nationkey = n_nationkey AND c_nationkey = s_nationkey AND c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND n_regionkey = r_regionkey AND o...
tpch
select min(n.name) as voicing_actress, min(t.title) as voiced_movie from aka_name as an, char_name as chn, cast_info as ci, company_name as cn, info_type as it, movie_companies as mc, movie_info as mi, name as n, role_type as rt, title as t where chn.id = ci.person_role_id AND ci.note in ('(voice)', '(voice: Japanese v...
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 t.id = ci.movie_id AND rt.role = 'actor' AND t.production_year > 2005 AND t.id = mc.movie_id AND ci....
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 mi.movie_id = mc.movie_id AND cn.id = mc.company_id AND t.id = mc.movi...
job
SELECT s_suppkey, total_revenue, s_name, s_address, s_phone FROM supplier, revenue0 WHERE total_revenue = ( SELECT MIN(total_revenue) FROM revenue0 ) AND s_suppkey = supplier_no ORDER BY s_suppkey
tpch
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE an.person_id = ci.person_id AND pi.person_id = an.person_id AND pi.note = 'Volker Boehm' AND (n.gender = 'm' OR (n.gen...
job
SELECT s_suppkey, s_address, s_phone, s_name, total_revenue FROM supplier, revenue0 WHERE s_suppkey = supplier_no AND total_revenue = ( SELECT MAX(total_revenue) FROM revenue0 ) ORDER BY s_suppkey
tpch
SELECT SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity, i_item_desc, s_store_name, s_store_id, i_item_id, SUM(ss_quantity) AS store_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti...
tpcds
SELECT MIN(t.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 mc.movie_id = mk.movie_id AND k.keyword ='character-name-in-title' AND cn.country_code ='[sm]' AND t.id = mk.movie_id AND cn.id = mc.comp...
job
SELECT MIN(t.production_year) AS movie_year, MIN(mc.note) AS production_note, MIN(t.title) AS movie_title FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE ct.id = mc.company_type_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.no...
job
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 o_shippriority, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, l_orderkey FROM customer, orders, lineitem WHERE c_mktsegment = 1 AND l_shipdate > DATE 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
WITH _q AS ( SELECT o_orderpriority, COUNT(*) AS order_count FROM orders WHERE o_orderdate < DATE 1 + INTERVAL '3' MONTH AND EXISTS ( SELECT * FROM lineitem WHERE l_orderkey = o_orderkey AND l_commitdate < l_receiptdate ) AND o_orderdate >= DATE 1 GROUP BY o_orderpriority ORDER BY o_orderpriority LIMIT 1000 ) SELECT * ...
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 cn.id = mc.company_id AND n.id = ci.person_id AND t.id = mk.m...
job
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.production_year > 2000 AND k.keyword LIKE '%sequel%' AND k.id = mk.keyword_id AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German'...
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 ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and s_nationkey = n_nationkey and n_regionkey...
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 n.id = ci.person_id AND t.id = ci.movie_id AND t.production_year > 2000 A...
job
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, users AS u, badges AS b WHERE p.OwnerUserId = u.Id AND ph.UserId = u.Id AND ph.PostHistoryTypeId = 3 AND p.Score >= -7 AND u.Id = b.UserId AND u.Reputation >= 1 LIMIT 10;
stats
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 kt.id = t.kind_id AND mi.movie_id = t.id AND kt...
job
SELECT MIN(t.title) AS movie_title, MIN(mi_idx.info) AS rating FROM info_type AS it, movie_info_idx AS mi_idx, title AS t WHERE it.info ='rating' AND t.production_year <= 2005 AND t.id = mi_idx.movie_id AND mi_idx.info > '8.0' AND it.id = mi_idx.info_type_id AND t.production_year >= 2000
job
Select s_phone, p_partkey, s_acctbal, n_name, s_comment, p_mfgr, s_name, s_address From part, supplier, partsupp, nation, region Where s_suppkey = ps_suppkey And n_regionkey = r_regionkey And s_nationkey = n_nationkey And p_type Like 1 And p_size = 1 And r_name = 1 And ps_supplycost = ( Select Min(ps_supplycost) From p...
tpch
SELECT c_phone, c_comment, c_name, c_address, c_acctbal, SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name, c_custkey FROM customer, orders, lineitem, nation WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AN...
tpch
SELECT 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 n.name LIKE '%Downey%Robert%' AND t.id = mk.movie_id AND t.production_year > 2010 AND k.keyword = 'marvel-cinematic...
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 = pl.PostId AND p.PostTypeId = 1 AND p.AnswerCount >= 0 AND p.Id = v.PostId AND u.Id = p.OwnerUserId AND p.Id = ph.PostId AND p.Id = c.PostId
stats
SELECT p_mfgr, s_name, s_acctbal, n_name, s_phone, s_address, p_partkey, s_comment FROM part, supplier, partsupp, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 1 AND p_type LIKE 1 AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r_name = 1 AND ps_supplycost = ( SELEC...
tpch
SELECT AVG(cs_quantity) AS catalog_sales_quantityave, AVG(sr_return_quantity) AS store_returns_quantityave, COUNT(ss_quantity) AS store_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, s_state, i_item_desc, AVG(ss_quantity) AS store_sales_quantityave, COUNT(sr...
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 t.id = ci.movie_id AND t.production_year > 2005 AND ci.note LIKE '%(voice)%' AND chn.id = ci.person_...
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.id = ci.person_id AND ci.movie_id = mc.movie_id AND cn.country_code = '[jp]' AND mc.company_id = cn.id AND r...
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(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 l_shipmode, Sum( Case When o_orderpriority = '1-URGENT' Or o_orderpriority = '2-HIGH' Then 1 Else 0 End ) As high_line_count, Sum( Case When o_orderpriority != '1-URGENT' And o_orderpriority != '2-HIGH' Then 1 Else 0 End ) As low_line_count From orders, lineitem Where o_orderkey = l_orderkey And l_shipdate < l_c...
tpch
SELECT 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.id = t.kind_id AND at.movie_id = mc.movie_id AND it1.id = mi_idx.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 LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND ct.kind = 'production companies' AND...
job
SELECT MIN(lt.link) AS link_type, MIN(cn.name) AS from_company, 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 t.id = ml.movie_id AND cn.id = mc.c...
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 miidx.movie_id = mc.movie_id AND mc.movie_id = ...
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 it.id = mi.info_type_id AND chn.id = ci.person_role_id AND n.id = ci.pers...
job
SELECT COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_type, p_size, p_brand FROM partsupp, part WHERE p_type NOT LIKE 1 AND 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_brand <> 1 AND p_partkey = ps_partkey GROUP BY p_brand...
tpch
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND mk.movie_id = mi.movie_id AND t.production_year > 2010 AND k.keyword LIKE '%sequel%'...
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_type = 1 ) AS all_n...
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 t.id = at.movie_id AND at.movie_id = mi.movie_id AND mi.movie_id = mi_...
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 = t.id And k.keyword ='character-name-In-title' And cn.country_code ='[sm]' And mk.keyword_id = k.id And cn.id = mc.company_id And t.id = mk.movie_id And mc.movie_id = mk.mo...
job
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND k.keyword = 'marvel-cinematic-universe' AND t.production_yea...
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.production_year > 2000 AND mi.movie_id = mc.movie_id AND mi.info LIK...
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 kt.id = t.kind_id AND mc.movie_id = t.id AND it...
job
SELECT a.ca_state AS state, COUNT(DISTINCT a.ca_state) 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_mo...
tpcds
WITH _q AS ( SELECT COUNT(*) FROM comments AS c, postHistory AS ph, badges AS b, votes AS v, users AS u WHERE ph.PostHistoryTypeId = 12 AND v.UserId = c.UserId AND ph.UserId = v.UserId AND u.Id = b.UserId AND b.UserId = ph.UserId AND u.UpVotes = 0 ) SELECT * FROM _q
stats
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 it1.id = mi_idx.info_type_id AND t.id = mi.movie_id AND it2.id = mi.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 t.id = mc.movie_id and rt.id = ci.role_id and ci.note like '%(uncredited)%' and t.production_year > ...
job
SELECT cnt, ss_ticket_number, c_salutation, c_first_name, c_preferred_cust_flag, c_last_name 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 c_last_name, ss_ticket_number, bought_city, c_first_name, extended_price, extended_tax, ca_city, 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(cn.name) as from_company, min(lt.link) as link_type, min(t.title) as western_sequel from company_name as cn, company_type as ct, info_type as it, keyword as k, link_type as lt, movie_companies as mc, movie_info as mi, movie_keyword as mk, movie_link as ml, title as t where lt.id = ml.link_type_id and t.produ...
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 ct.id = mc.company_type_id AND ci.movie_id = mc.movie_id AND ...
job
Select i_manufact, i_manufact_id, i_brand_id As brand_id, i_brand As brand, Sum(ss_ext_sales_price) As ext_price 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
WITH _q AS ( Select l_orderkey, Sum(l_extendedprice * (1 - l_discount)) As revenue, o_orderdate, o_shippriority From customer, orders, lineitem Where o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND l_shipdate > DATE 1 Group By l_orderkey, o_orderdate, o_shippriority O...
tpch
SELECT i_item_id, AVG(cs_list_price) AS agg2, AVG(cs_sales_price) AS agg4, AVG(cs_coupon_amt) AS agg3, AVG(cs_quantity) AS agg1 FROM catalog_sales JOIN customer_demographics ON cs_bill_cdemo_sk = cd_demo_sk JOIN date_dim ON cs_sold_date_sk = d_date_sk JOIN item ON cs_item_sk = i_item_sk JOIN promotion ON cs_promo_sk = ...
tpcds
Select p_brand, p_type, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where p_partkey = ps_partkey And ps_suppkey Not In ( Select s_suppkey From supplier Where s_comment Like '%Customer%Complaints%' ) And p_brand <> 1 And p_size In (1, 1, 1, 1, 1, 1, 1, 1) And p_type Not Like 1 Group By p_brand...
tpch
SELECT COUNT(1) FROM comments AS c, votes AS v, badges AS b, users AS u WHERE u.Id = v.UserId AND u.Id = c.UserId AND u.CreationDate >= '2010-07-20 01:27:29'::timestamp AND u.Id = b.UserId AND c.Score = 1 LIMIT 200;
stats
SELECT p_size, p_brand, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_type 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 ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) GROUP BY p_brand...
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 ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey AND n_regionkey...
tpch
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE it.info = 'release dates' AND it.id = mi.info_type_id AND an.person_id = ...
job
SELECT c_first_name, list_price, extended_tax, extended_price, ss_ticket_number, ca_city, bought_city, 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
SELECT MAX(cs_net_profit) AS catalog_sales_profit, s_store_id, s_store_name, i_item_id, MAX(ss_net_profit) AS store_sales_profit, i_item_desc, MAX(sr_net_loss) AS store_returns_loss FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return...
tpcds
Select Count(*) From comments As c, postHistory As ph, badges As b, votes As v, users As u Where u.Id = b.UserId AND v.UserId = c.UserId AND b.UserId = ph.UserId AND ph.PostHistoryTypeId = 12 AND u.UpVotes = 0 AND ph.UserId = v.UserId
stats
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE u.Id = c.UserId AND ph.UserId = v.UserId AND p.AnswerCount >= 0 AND c.UserId = p.OwnerUserId AND p.Score <= 13 AND p.OwnerUserId = ph.UserId LIMIT 100;
stats
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where mi.info in ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') and t.production_year > 2005 and k.keyword like '%sequel%' and t.id = mi.movie_id and mk.movie_id = mi.movie_id ...
job
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE n1.n_regionkey = r_re...
tpch
SELECT MIN(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 n.id = ci.person_id AND t.episode_nr < 100 AND mk.keyword_id = k.id AND t.id = mk.movie_id ...
job
SELECT AVG(ss_quantity) AS agg1, AVG(ss_sales_price) AS agg4, AVG(ss_list_price) AS agg2, i_item_id, AVG(ss_coupon_amt) AS agg3 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(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie, MIN(cn.name) AS movie_company FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
SELECT MIN(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 it.id = mi.info_type_id AND mi.note...
job
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 = ph.PostId AND p.Id = pl.PostId AND c.Score = 0 AND p.Id = c.PostId AND p.Id = v.PostId AND pl.LinkTypeId = 1
stats
SELECT COUNT(1) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.Id = v.PostId AND p.ViewCount >= 0 AND p.Id = c.PostId AND u.Id = p.OwnerUserId AND u.Id = b.UserId AND p.Id = ph.PostId AND p.Score <= 192 LIMIT 500;
stats
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.FavoriteCount >= 0 AND p.Id = c.PostId AND p.Id = ph.PostId AND p.Id = pl.PostId AND c.Score = 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 mk.keyword_id = k.id AND mc.movie_id = t.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.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
WITH _q AS ( SELECT i_brand_id AS brand_id, i_brand AS brand, i_manufact_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_...
tpcds
SELECT o_year, nation, 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_partkey = l_partkey AND o_or...
tpch
SELECT i_manufact_id, i_brand AS brand, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price, 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 SUM(ss_ext_wholesale_cost), AVG(ss_quantity), AVG(ss_ext_sales_price), 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 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
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 an1.person_id = n1.id AND ci.movie_id = mc.movie_id AND mc.company_id = cn.id AND ...
job
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue FROM ( SELECT n1.n_name AS supp_nation, n2.n_name AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, l_extendedprice * (1 - l_discount) AS volume FROM supplier, lineitem, orders, customer, nation n1, nation n2 WHERE s_nationkey = n1.n_nationkey AND s...
tpch
SELECT p_brand, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_type, p_size FROM partsupp, part WHERE 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 AND p_brand <> 1 GROUP BY p_brand...
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 t.id = mk.movie_id AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND cn.country_code ='[nl]' AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND mk.keyword_id ...
job