text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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 ct.kind = 'production companies' AND t.id = mi_idx.movie_id AND mc.note ...
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 t.id = mk.movie_id AND it.info = 'r...
job
SELECT STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, i_item_desc, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, i_item_id, s_state, AVG(cs_quantity) AS catalog_sales_quantityave, COUNT(sr_return_quantity) AS store_returns_quantitycount, COUNT(cs_quantity) AS catalog...
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 ct.id = mc.company_type_id AND t.id = mc.movie_id AND ct.kind = 'production companies' AND t.id = mi_idx.m...
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 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(1) 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 SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, i_item_id, i_item_desc, SUM(cs_quantity) AS catalog_sales_quantity, s_store_name, 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 cnt, c_preferred_cust_flag, ss_ticket_number, c_salutation, c_last_name, c_first_name FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
select 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 mi.info in ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') and t.production_year > 2010 and mk.movie_id = mi.movie_id and k.id = mk.keyword_id...
job
Select c_address, Sum(l_extendedprice * (1 - l_discount)) As revenue, c_phone, c_name, c_custkey, c_acctbal, n_name, c_comment From customer, orders, lineitem, nation Where c_custkey = o_custkey And l_orderkey = o_orderkey And o_orderdate >= DATE 1 And o_orderdate < DATE 1 + INTERVAL '3' MONTH And l_returnflag = 'R' An...
tpch
SELECT MIN(t.title) AS biography_movie, MIN(n.name) AS of_person FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE an.person_id = ci.person_id AND lt.id = ml.link_type_id AND pi.person_id = an.person_id AND lt.link = 'features' AND t...
job
SELECT MAX(t.title) AS northamerican_movie, MAX(mi_idx.info) AS rating FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi.movie_id AND it1.info = 'rating' AND mi_idx.movie_id = mc.mo...
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.id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND mk.movie_id = mi.movie_id AND t.production_year > 2000 AND k.keyword LIKE '%sequel%' ...
job
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE k.keyword ='character-name-in-title' AND mc.movie_id = t.id AND cn.country_code ='[sm]' AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.id = mc.comp...
job
with _q as ( 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 t.id = mi.movie_id and mc.note not like '%(as Metro-Goldwyn-Mayer Pictures)%' and mc.movie_id = mi.movie_id and it.id = mi.info_type_id and ct.id = mc.company_type_id an...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE 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 s_suppkey = l1.l_suppkey AND o_orderkey = l1.l_orderk...
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 ci.movie_id = mc.movie_id AND an.person_id = n.id AND cn.country_code = '[us]' AND k.keywor...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b, users AS u WHERE c.UserId = u.Id AND p.Id = c.PostId AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Score <= 40 AND p.Id = ph.PostId AND b.UserId = u.Id AND p.Id = pl.RelatedPostId
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 cn.id = mc.company_id AND k.keyword ='character-name-In-title' AND t.id = mk.movie_id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND mk.keyword_id = k.id AND mc.movie_id = mk.mo...
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 it.id = pi.info_type_id AND pi.person_id = ci.person_id AND pi.note = 'Volker Boehm' AND lt.id = ml.link_type_id AND c...
job
SELECT AVG(ss_quantity) AS agg1, AVG(ss_sales_price) AS agg4, i_item_id, AVG(ss_coupon_amt) AS agg3, 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 s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND s_nationkey = n_nationkey AND s_suppkey = l1.l_suppkey AND l1.l_receiptdate > l1.l_commitdate AND n_name = 1 AND o_orderkey = ...
tpch
WITH _q AS ( SELECT i_item_desc, i_category, i_class, i_current_price, i_item_id, SUM(ss_ext_sales_price) AS itemrevenue, SUM(ss_ext_sales_price) * 100 / SUM(SUM(ss_ext_sales_price)) OVER (PARTITION BY i_class) AS revenueratio FROM store_sales JOIN item ON ss_item_sk = i_item_sk JOIN date_dim ON ss_sold_date_sk = d_dat...
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 l_shipdate < l_commitdate AND o_orderkey = l...
tpch
SELECT s_store_name, i_item_id, i_item_desc, s_store_id, MAX(ss_net_profit) AS store_sales_profit, MAX(cs_net_profit) AS catalog_sales_profit, 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 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 c...
tpch
SELECT MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Hemsworth%Chris%' AND t.id = mk.movie_id AND ci.movie_id ...
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 p.ViewCount >= 0 and p.Id = v.PostId and p.Id = ph.PostId and p.Id = c.PostId and u.Id = b.UserId and u.Id = p.OwnerUserId
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 k.keyword ='character-name-In-title' AND mk.keyword_id = k.id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.id = mc.comp...
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 k.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND t.id = mk.movie_id AND ci.movie_id = mk.movie_id AND n.id = ci.person_...
job
SELECT ss_ticket_number, c_preferred_cust_flag, c_last_name, c_first_name, c_salutation, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN store ON ss_store_sk = s_store_sk INNER JOIN household_demographics ON ss_hdemo_sk =...
tpcds
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 p_type, p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_brand FROM partsupp, part WHERE p_brand <> 1 AND p_type NOT LIKE 1 AND p_partkey = ps_partkey 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
with _q as ( select dt.d_year, item.i_brand_id as brand_id, item.i_brand as brand, sum(ss_ext_sales_price) as ext_price 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 = 95 AND dt.d_moy = 12 AND dt.d_year = 1...
tpcds
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 = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German']) AND mk.movie_id = mi.movie_id AND t.id = mk.movie_id AND k.id = mk.keyword_id AND t.production_year > 20...
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 catalog_sales ON cs_item_sk = i_item_sk WHERE i_current_price BETWEEN 83 AND 83 + 30 AND d_date BETWEEN CAST('2002-01-23' AS DATE) AND (CAST('2002-01-23' AS DATE) + INTERVAL '...
tpcds
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_suppkey = l1.l_suppkey AND 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 ...
tpch
SELECT MIN(t.production_year) AS movie_year, MIN(t.title) AS movie_title, MIN(mc.note) AS production_note FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.info = 'top 250 rank' AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND t.id = ...
job
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
SELECT i_item_id, AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1 FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo...
tpcds
SELECT 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 o_orderkey = l_orderkey AND ( (n1....
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 cn.id = mc.company_id AND cn.country_code = '[d...
job
SELECT o_orderdate, o_totalprice, c_name, SUM(l_quantity), o_orderkey, c_custkey 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 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 SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_acctbal, c_comment, c_name, n_name, c_custkey, c_address, c_phone 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(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 cn.country_code = '[jp]' AND t.id = mc.movie_id AND rt.role...
job
SELECT nation, SUM(amount) AS sum_profit, o_year 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 p_name LIKE 1 ) AS profit AND s_nationkey = n_nationkey AND o...
tpch
SELECT COUNT(sr_return_quantity) AS store_returns_quantitycount, AVG(cs_quantity) AS catalog_sales_quantityave, COUNT(ss_quantity) AS store_sales_quantitycount, COUNT(cs_quantity) AS catalog_sales_quantitycount, i_item_id, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, i_item_desc, AVG(sr_ret...
tpcds
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 l_orderkey = o_orderkey AND c_custkey = o_custkey AND c_mktsegment = 1 AND o_orderdate < DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
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 cn.id = mc.company_id AND t.id = ci.movie_id AND t.production_year > 2005 AND rt.id = ci.role_id AND...
job
SELECT MAX(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 k.keyword LIKE '%sequel%' AND t.production_year > 2010 AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.id = mi.movie_id AND t....
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 ct.id = mc.company_type_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.no...
job
Select c_custkey, c_name, Sum(l_extendedprice * (1 - l_discount)) As revenue, c_acctbal, n_name, c_address, c_phone, c_comment From customer, orders, lineitem, nation Where c_nationkey = n_nationkey AND c_custkey = o_custkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AND l_orderkey = o_orderke...
tpch
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 JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return...
tpcds
SELECT i_manufact_id, i_brand_id AS brand_id, i_brand AS brand, i_manufact, SUM(ss_ext_sales_price) AS ext_price FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO...
tpcds
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 ct.kind = 'production companies' AND t.id = mc....
job
SELECT STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, STDDEV_SAMP(ss_quantity) AS store_sales_quantitystdev, COUNT(ss_quantity) AS store_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, AVG(sr_return_quantity) AS store_returns_quantity...
tpcds
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
SELECT MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year, MIN(mc.note) AS production_note FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.id = mi_idx.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct.id = mc.comp...
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 t.id = mk.movie_id AND rt.role = 'actress' AND t.id = ci.movi...
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 mc.note NOT LIKE '%(as Metro-Goldwy...
job
Select Min(n.name) As voicing_actress, Min(t.title) As voiced_movie From aka_name As an, char_name As chn, cast_info As ci, company_name As cn, info_type As it, movie_companies As mc, movie_info As mi, name As n, role_type As rt, title As t Where ci.note In ('(voice)', '(voice: Japanese version)', '(voice) (uncredited)...
job
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, badges As b Where pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Id = pl.RelatedPostId AND p.Id = ph.PostId AND b.UserId = c.UserId AND c.Score = 0 AND p.Id = c.PostId
stats
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND s_suppkey = l1.l_suppkey AND o_orderstatus = 'F' AND n_name = 1 AND l1.l_receiptdat...
tpch
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND ct.kind = 'pr...
job
SELECT 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(1) 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_address, c_acctbal, n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_name, c_comment, c_phone, 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 AVG(l_discount) AS avg_disc, AVG(l_extendedprice) AS avg_price, l_returnflag, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, COUNT(*) AS count_order, SUM(l_quantity) AS sum_qty, AVG(l_quantity) AS avg_qty, l_linestatus, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extend...
tpch
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 t.production_year <= 2005 AND mi_idx.info > '8.0' AND it.id = mi_idx.info_type_id AND t.production_year >= 2000 AND t.id = mi_idx.movie_id AND it.info ='rating'
job
SELECT CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100, promotions, total 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_orderpriority, COUNT(1) as order_count from orders where exists ( select * from lineitem where l_orderkey = o_orderkey and l_commitdate < l_receiptdate ) and o_orderdate >= DATE 1 and o_orderdate < DATE 1 + INTERVAL '3' MONTH group by o_orderpriority order by o_orderpriority
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 mk.keyword_id = k.id AND t.episode_nr < 100 AND t.id = mc.movie_id AND ci.movie_id = mc.mov...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, votes AS v WHERE p.Score >= -3 AND v.VoteTypeId = 2 AND pl.PostId = v.PostId AND c.CreationDate >= '2010-08-02 23:52:10'::timestamp AND p.Id = c.PostId AND c.PostId = pl.PostId LIMIT 500;
stats
SELECT MIN(t.title) AS northamerican_movie, MIN(mi_idx.info) AS rating FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE kt.id = t.kind_id AND at.movie_id = mc.movie_id AND it1.id = mi_idx.in...
job
Select s_name, Count(*) As numwait From supplier, lineitem l1, orders, nation Where s_suppkey = l1.l_suppkey And o_orderkey = l1.l_orderkey And o_orderstatus = 'F' And l1.l_receiptdate > l1.l_commitdate And Exists ( Select * From lineitem l2 Where l2.l_orderkey = l1.l_orderkey And l2.l_suppkey <> l1.l_suppkey ) And Not...
tpch
select c_custkey, c_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone, c_comment from customer, orders, lineitem, nation where c_nationkey = n_nationkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND c_custkey = o_cus...
tpch
SELECT i_item_id, AVG(ss_sales_price) AS agg4, AVG(ss_coupon_amt) AS agg3, AVG(ss_quantity) AS agg1, 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 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 t.id = mc.movie_id AND ct.kind = 'production companies' AND mc.note NOT LIK...
job
SELECT c_salutation, cnt, c_preferred_cust_flag, c_first_name, ss_ticket_number, c_last_name FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT 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 k.id = mk.keyword_id AND n.name LIKE '%Downey%Robert%' AND ci.movie_id = mk.movie_id AND n.id = ci.person_id AND t.production_year > 2010 A...
job
SELECT s_name, COUNT(1) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_suppkey = l1.l_suppkey AND o_orderkey = l1.l_orderkey AND l1.l_receiptdate > l1.l_commitdate AND n_name = 1 AND s_nationkey = n_nationkey AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey ...
tpch
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
Select cc_name As call_center_name, cc_call_center_id As call_center, Sum(cr_net_loss) As returns_loss, cc_manager As manager 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
WITH _q AS ( 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.name LIKE '%Hemsworth%Chris%' AND t.production_year > 2...
job
WITH _q AS ( SELECT l_orderkey, o_shippriority, 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 O...
tpch
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.kind = 'production companies' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND mc.movie_i...
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 Max(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 k.keyword Like '%sequel%' And t.production_year > 2005 And mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') And t.id = mi.movie_id And mk....
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 ci.movie_id = mc.movie_id AND t.production_year > 2005 ...
job
SELECT p_size, p_type, p_brand, 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(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND t.production_year BETWEEN 1980 AND 1995 AND ci.movie_id ...
job
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 l_shipdate > DATE 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND c_mktsegment = 1 GROUP BY l_orderkey, o_orderdate, o_shippriority O...
tpch
Select i_item_id, Avg(cs_quantity) As agg1, Avg(cs_list_price) As agg2, Avg(cs_coupon_amt) As agg3, Avg(cs_sales_price) As agg4 From catalog_sales INNER JOIN customer_demographics On cs_bill_cdemo_sk = cd_demo_sk INNER JOIN date_dim On cs_sold_date_sk = d_date_sk INNER JOIN item On cs_item_sk = i_item_sk INNER JOIN pro...
tpcds
SELECT AVG(cs_coupon_amt) AS agg3, AVG(cs_quantity) AS agg1, AVG(cs_list_price) AS agg2, i_item_id, 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 s_store_name, SUM(sr_return_quantity) AS store_returns_quantity, i_item_desc, SUM(cs_quantity) AS catalog_sales_quantity, i_item_id, 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.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 = t.id AND cn.country_code = '[d...
job
select c_salutation, c_first_name, ss_ticket_number, c_preferred_cust_flag, c_last_name, 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 i_item_id, AVG(cs_coupon_amt) AS agg3, AVG(cs_list_price) AS agg2, AVG(cs_sales_price) AS agg4, AVG(cs_quantity) AS agg1 FROM catalog_sales INNER JOIN customer_demographics ON cs_bill_cdemo_sk = cd_demo_sk INNER JOIN date_dim ON cs_sold_date_sk = d_date_sk INNER JOIN item ON cs_item_sk = i_item_sk INNER JOIN pro...
tpcds
SELECT MIN(t.title) AS german_movie, MIN(mi.info) AS release_date, MIN(miidx.info) AS rating 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 cn.country_code = '[de]' ...
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 mc.movie_id = mk.movie_id And cn.country_code ='[nl]' And mk.keyword_id = k.id And mc.movie_id = t.id And k.keyword ='character-name-In-title' And cn.id = mc.comp...
job