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 it.info = 'release dates' And ml.mo...
job
SELECT i_item_desc, i_item_id, 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 i_current_price BETWEEN 75 AND 75 + 30 AND d_date BETWEEN CAST('2000-05-01' AS DATE) AND (CAST('2000-05-01' AS DATE) + INTERVAL '...
tpcds
SELECT i_manufact_id, i_brand_id AS brand_id, i_manufact, i_brand AS brand, 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
SELECT o_orderkey, o_orderdate, SUM(l_quantity), 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 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.Id = c.PostId And p.Id = v.PostId And p.PostTypeId = 1 And p.AnswerCount >= 0 And u.Id = p.OwnerUserId And p.Id = pl.PostId
stats
SELECT i_item_id, s_store_name, i_item_desc, SUM(sr_return_quantity) AS store_returns_quantity, s_store_id, SUM(ss_quantity) AS store_sales_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 AVG(ss_quantity), SUM(ss_ext_wholesale_cost), AVG(ss_ext_wholesale_cost), AVG(ss_ext_sales_price) 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
WITH _q AS ( SELECT SUM(l_extendedprice) / 7.0 AS avg_yearly FROM lineitem, part WHERE p_partkey = l_partkey AND p_brand = 1 AND p_container = 1 AND l_quantity < ( SELECT 0.2 * AVG(l_quantity) FROM lineitem WHERE l_partkey = p_partkey ) ) SELECT * FROM _q LIMIT 1000;
tpch
SELECT p_brand, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_size, p_type FROM partsupp, part WHERE p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_partkey = ps_partkey AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_type NOT LIKE 1 AND p_brand <> 1 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 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 u.Id = p.OwnerUserId And p.PostTypeId = 1 And p.AnswerCount >= 0 And p.Id = pl.PostId And p.Id = v.PostId And p.Id = c.PostId
stats
Select COUNT(1) From comments As c, postHistory As ph, votes As v, users As u Where u.UpVotes <= 123 AND u.DownVotes >= 0 AND u.Id = v.UserId AND v.UserId = ph.UserId AND u.Views >= 0 AND ph.UserId = c.UserId
stats
Select Count(*) From votes As v, posts As p Where v.PostId = p.Id And v.VoteTypeId = 2 Limit 10;
stats
select i_brand_id as brand_id, i_brand as brand, i_manufact, i_manufact_id, 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
select c_count, count(*) as custdist from ( select c_custkey, count(o_orderkey) as c_count from customer left outer join orders on c_custkey = o_custkey and o_comment not like 1 group by c_custkey ) as c_orders group by c_count order by custdist desc, c_count desc limit 10;
tpch
SELECT extended_price, list_price, ca_city, c_first_name, bought_city, extended_tax, ss_ticket_number, 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 JOI...
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 mc.note LIKE '%(Japan)%' AND cn.country_code = '[jp]' AND n1.name LIKE '%Yo%' AND mc.company_id = cn.id AND n1....
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 ='[de]' AND t.id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND cn.id = mc.comp...
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 k.keyword Like '%sequel%' And mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') And ...
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 JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
Select Min(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 mk.keyword_id = k.id AND t.id = mk.movie_id AND k.keyword ='character-name-In-title' AND cn.country_code ='[sm]' AND mc.movie_id = t.id AND mc.movie_id = mk.mo...
job
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate >= DATE 1 AND s_nationkey = n_nationkey AND l_suppkey = s_suppkey AND c_nationkey = s_nationkey AND r_name = 1 AND c_custkey = o_custkey AND n_regionkey = r_regionkey AND l_order...
tpch
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.country_code ='[sm]' AND mc.movie_id = t.id AND mk.keyword_id = k.id AND cn.id = mc.company_id AND k.keyword ='character-name-IN-...
job
WITH year_total AS ( SELECT c_login AS customer_login, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_first_name AS customer_first_name, 's' AS sale_type, c_birth_country AS customer_birth_country, c_customer_id AS customer_id, c_email_address AS custo...
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 cn.country_code ='[de]' AND t.id = mk.movie_id AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND mk.keyword_id ...
job
SELECT i_item_id, i_item_desc, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, AVG(sr_return_quantity) AS store_returns_quantityave, COUNT(cs_quantity) AS catalog_sales_quantitycount, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, STDDEV_SAMP(sr_return_quantity) AS sto...
tpcds
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE p.OwnerUserId = ph.UserId AND c.UserId = p.OwnerUserId AND ph.UserId = v.UserId AND u.Id = c.UserId AND p.Score <= 13 AND p.AnswerCount >= 0 LIMIT 10;
stats
SELECT SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count, l_shipmode FROM orders, lineitem WHERE l_receiptdate >= DATE 1 AND l_shipdate < l_c...
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.gender = 'f' AND ci.role_id = rt.id AND mi.movie_id = ci.movie_id AND c...
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 o_orderdate BETWEEN D...
tpch
SELECT MIN(t.title) AS russian_movie, MIN(chn.name) AS uncredited_voiced_character FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE rt.role = 'actor' AND chn.id = ci.person_role_id AND ci.movie_id = mc.movie_id AND cn.country_code =...
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 it.info = 'top 250 rank' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pic...
job
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
Select Min(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.keyword Like '%sequel%' And mk.movie_id = mi.movie_id And t.id = mi.movie_id And k.id = mk.keyword_id And ...
job
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where k.id = mk.keyword_id And t.id = mk.movie_id And mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') And t.production_year > 2005 And mk.movie_id = mi.movie_id And t...
job
WITH year_total AS ( SELECT c_first_name AS customer_first_name, c_email_address AS customer_email_address, c_birth_country AS customer_birth_country, c_customer_id AS customer_id, 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_preferr...
tpcds
WITH _q AS ( SELECT COUNT(*) FROM postHistory AS ph, posts AS p, users AS u WHERE ph.PostHistoryTypeId = 5 AND ph.PostId = p.Id AND p.OwnerUserId = u.Id AND p.Score >= -1 ) SELECT * FROM _q;
stats
SELECT COUNT(*) FROM comments AS c, posts AS p, votes AS v, users AS u WHERE c.Score = 0 AND u.Id = c.UserId AND p.Score >= 0 AND p.ViewCount >= 0 AND u.Id = p.OwnerUserId AND u.Id = v.UserId
stats
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 ci.movie_id = ml.linked_movie_id AND pi.note = 'Volker Boehm' AND ci.person_id = n.id AND n.name_pcode_cf BETWEEN 'A' ...
job
SELECT MAX(mi.info) AS release_date, MAX(miidx.info) AS rating, MAX(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.kind = 'movie' AND it.info = 'rating' AND mc...
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 t.id = mc.movie_id AND cn.country_code = '[jp]' AND mc.note Like '%(Japan)%' AND mc.note Not Like '%(USA)%' AND...
job
select min(t.title) as western_violent_movie, min(mi_idx.info) as rating, 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(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 NOT LIKE '%Yu%' AND n1.name LIKE '%Yo%' AND ci.role_id = rt.id AND mc.note NOT LIKE '%(USA)%' AND an1.p...
job
SELECT AVG(ss_sales_price) AS agg4, AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, i_item_id, AVG(ss_quantity) AS agg1 FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo...
tpcds
SELECT MIN(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 mc.movie_id = mi_idx.movie_id AND (mc.note LIKE...
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 chn.id = ci.person_role_id AND rt.id = ci.role_id AND ci.note LIKE '%(uncredited)%' AND t.id = mc.mo...
job
SELECT p_brand, p_type, p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_partkey = ps_partkey AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_brand <> 1 AND p_type NOT LIKE 1 AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) GROUP BY p_brand...
tpch
SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE it.info = 'bottom 10 rank' AND t.id = mc.movie_id AND ct.kind = 'production companies' AND it.id = mi.info_type_id AND ct.id = mc.company_type_id AND mc.note NOT LIKE '%(as Metro-Gol...
job
SELECT MIN(n.name) AS actor_name, MIN(k.keyword) AS movie_keyword, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.production_year > 2010 AND t.id = ci.movie_id AND k.id = mk.keyword_id AND t.id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe'...
job
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE rt.role = 'actor' AND ct.id = mc.company_type_id AND cn.id = mc.company_id AND ci.movie_id = mc.movi...
job
SELECT c_phone, c_custkey, c_comment, c_acctbal, n_name, c_address, c_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, nation WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AN...
tpch
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE n_regionkey = r_regionkey AND l_orderkey = o_orderkey AND s_nationkey = n_nationkey AND o_orderdate >= DATE 1 AND r_name = 1 AND l_suppkey = s_suppkey AND c_custkey = o_custkey AND o_orderda...
tpch
SELECT AVG(l_discount) AS avg_disc, AVG(l_quantity) AS avg_qty, l_returnflag, COUNT(*) AS count_order, AVG(l_extendedprice) AS avg_price, l_linestatus, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice) AS sum_base_price, SUM(l_quantity) AS sum_qty, SUM(l_extendedprice * (1 - l_discount) * ...
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 it.id = pi.info_type_id AND n.name_pcode_cf BETWEEN 'A' AND 'F' AND lt.id = ml.link_type_id AND ci.movie_id = ml.linke...
job
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 store_sales ON ss_item_sk = i_item_sk WHERE i_manufact_id IN (427, 128, 154, 9) AND d_date BETWEEN CAST('2002-01-23' AS DATE) AND (CAST('2002-01-23' AS DATE) + INTERVAL '60 da...
tpcds
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderkey = l1.l_orderkey AND s_nationkey = n_nationkey AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND EXISTS ( SELECT * FROM...
tpch
Select Min(t.title) As american_movie From company_type As ct, info_type As it, movie_companies As mc, movie_info As mi, title As t Where (mc.note Like '%(co-production)%' Or mc.note Like '%(presents)%') AND t.id = mi.movie_id AND mc.movie_id = mi.movie_id AND ct.id = mc.company_type_id AND it.id = mi.info_type_id AND ...
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 t.id = mk.movie_id AND cn.country_code ='[de]' AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_id = t.id AND cn.id = mc.comp...
job
Select s_name, Count(*) As numwait From supplier, lineitem l1, orders, nation Where s_nationkey = n_nationkey AND o_orderkey = l1.l_orderkey AND Exists ( Select * From lineitem l2 Where l2.l_orderkey = l1.l_orderkey And l2.l_suppkey <> l1.l_suppkey ) AND n_name = 1 AND l1.l_receiptdate > l1.l_commitdate AND Not Exists ...
tpch
SELECT i_item_id, AVG(cs_list_price) AS agg2, AVG(cs_quantity) AS agg1, AVG(cs_coupon_amt) AS agg3, AVG(cs_sales_price) AS agg4 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 l_shipmode, sum( case when o_orderpriority = '1-URGENT' or o_orderpriority = '2-HIGH' then 1 else 0 end ) as high_line_count, sum( case when o_orderpriority <> '1-URGENT' and o_orderpriority <> '2-HIGH' then 1 else 0 end ) as low_line_count from orders, lineitem where l_shipmode in (1, 1) AND l_commitdate < l_re...
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 cn.id = mc.company_id AND cn.country_code ='[de]' AND k.keyword ='character-name-in-title' AND mc.movie_id = t.id AND t.id = mk.movie_id AND mc.movie_id = mk.mo...
job
SELECT i_item_id, COUNT(ss_quantity) AS store_sales_quantitycount, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, COUNT(sr_return_quantity) AS store_returns_quantitycount, AVG(sr_return_...
tpcds
SELECT MIN(cn.name) AS movie_company, MIN(t.title) AS western_violent_movie, 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 MIN(mc.note) AS production_note, MIN(t.production_year) AS movie_year, 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 mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND (mc.note LIKE '%(co-production)%' OR mc.note LI...
job
SELECT MIN(t.title) AS western_sequel, MIN(lt.link) AS link_type, MIN(cn.name) AS from_company 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 it.id = mi.i...
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_idx.movie_id AND mi_idx.info < '3.5' AND it2.id = mi.info_ty...
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 cn.country_code = '[us]' AND it1.id = mi_idx.info_type_id AND mi_idx.i...
job
SELECT MIN(t.title) AS russian_movie, MIN(chn.name) AS uncredited_voiced_character FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE t.id = mc.movie_id AND t.production_year > 2005 AND chn.id = ci.person_role_id AND rt.id = ci.role_i...
job
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where mi.info In ('Sweden', 'Norway', 'Germany', '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 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 k.keyword = 'anime' AND n.gender = 'f'...
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 < 100 AND ci.movie_id = mc.movie_id AND mc.movie_id = ...
job
SELECT SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share, o_year FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE l_orderkey = 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 t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND cn.id = mc.company_id AND cn.country_code ='[sm]' AND mc.movie_id ...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE ph.UserId = v.UserId AND c.UserId = p.OwnerUserId AND u.Id = c.UserId AND p.OwnerUserId = ph.UserId AND p.AnswerCount >= 0 AND p.Score <= 13 LIMIT 200;
stats
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(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 ct.id = mc.company_type_id AND t.id = ci.movie_id AND ci.note LIKE '%(voice)%'...
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 l_shipdate BETWEEN DATE '1995-01-0...
tpch
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie, MIN(cn.name) AS movie_company FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
SELECT 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 MAX(cn.name) AS from_company, MAX(lt.link) AS link_type, MAX(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.production_year > 1950 AND cn.cou...
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 (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND an.person_id = ci.person_id AND...
job
Select ps_partkey, Sum(ps_supplycost * ps_availqty) As VALUE From partsupp, supplier, nation Where n_name = 1 AND s_nationkey = n_nationkey AND ps_suppkey = s_suppkey Group By ps_partkey Having Sum(ps_supplycost * ps_availqty) > ( Select Sum(ps_supplycost * ps_availqty) * 1 From partsupp, supplier, nation Where ps_supp...
tpch
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE p_size = 1 AND p_type LIKE 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nation...
tpch
SELECT s_acctbal, s_phone, s_address, p_mfgr, s_name, n_name, s_comment, p_partkey 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 COUNT(*) FROM comments AS c, posts AS p, users AS u WHERE p.CommentCount >= 0 AND p.ViewCount >= 0 AND c.CreationDate >= '2010-08-05 00:36:02'::timestamp AND c.UserId = u.Id AND p.FavoriteCount >= 0 AND u.Id = p.OwnerUserId LIMIT 20;
stats
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 o_orderdate < DATE 1 AND l_shipdate > DATE 1 AND c_custkey = o_custkey AND c_mktsegment = 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
SELECT i_brand AS brand, SUM(ss_ext_sales_price) AS ext_price, i_manufact_id, i_brand_id AS brand_id, i_manufact FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO...
tpcds
SELECT MIN(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 = mc.movi...
job
select sum(sr_return_quantity) as store_returns_quantity, i_item_id, s_store_name, sum(cs_quantity) as catalog_sales_quantity, i_item_desc, sum(ss_quantity) as store_sales_quantity, s_store_id 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(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 kt.kind = 'movie' AND mi.movie_id = mi_idx.movie...
job
SELECT COUNT(cs_quantity) AS catalog_sales_quantitycount, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, i_item_id, AVG(cs_quantity) ...
tpcds
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 In (1...
tpch
SELECT s_address, s_phone, total_revenue, s_suppkey, s_name FROM supplier, revenue0 WHERE s_suppkey = supplier_no AND total_revenue = ( SELECT MAX(total_revenue) FROM revenue0 ) ORDER BY s_suppkey LIMIT 200;
tpch
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = ci.movie_id AND n.name LIKE '%Hemsworth%Chris%' AND ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND t.id = mk.movie_id AND n....
job
Select o_orderkey, o_totalprice, Sum(l_quantity), o_orderdate, c_custkey, 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 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.id = pi.person_id AND ci.person_id = n.id AND it.id = pi.info_type_id AND an.name like '%a%' AND an.person_id = ci.p...
job
SELECT AVG(l_discount) AS avg_disc, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_extendedprice) AS avg_price, l_returnflag, l_linestatus, SUM(l_quantity) AS sum_qty, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount) * ...
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 '%(voice)%' AND cn.country_code = '[ru]' AND t.id = ci.movie_id AND cn.id = mc.company_...
job