text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
SELECT c_address, c_acctbal, c_custkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_name, c_phone, c_comment, n_name 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(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(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where k.keyword ='character-name-In-title' And t.id = mk.movie_id And mk.keyword_id = k.id And mc.movie_id = t.id And mc.movie_id = mk.movie_id And cn.country_code ='[sm]' 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 n.id = ci.person_id AND n.name LIKE '%Downey%Robert%' AND k.keyword = 'marvel-cinematic-universe' AND t.id = mk.movie_id AND t.production_y...
job
SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE mc.movie_id = mi.movie_id AND ct.kind = 'production companies' AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.info = 'bottom 10 rank' AND ct.id = mc.com...
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 r_name = 1 AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_nationkey = s_nationkey AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND n_regionkey = r_regi...
tpch
SELECT c_comment, c_address, SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name, c_phone, c_acctbal, c_custkey, c_name 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 l_shipmode, Sum( Case When o_orderpriority = '1-URGENT' Or o_orderpriority = '2-HIGH' Then 1 Else 0 End ) As high_line_count, Sum( Case When o_orderpriority <> '1-URGENT' And o_orderpriority <> '2-HIGH' Then 1 Else 0 End ) As low_line_count From orders, lineitem Where l_commitdate < l_receiptdate AND o_orderkey ...
tpch
SELECT l_shipmode, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count, SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count FROM orders, lineitem WHERE l_shipmode IN (1, 1) AND l_shipdate < l_comm...
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 n.id = pi.person_id AND pi.person_id = an.person_id AND ci.movie_id = ml.linked_movie_id AND t.id = ci.movie_id AND lt...
job
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 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 cnt, c_preferred_cust_flag, c_last_name, c_salutation, ss_ticket_number, 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 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.id = mc.company_id AND mk.keyword_id = k.id AND k.keyword ='character-name-In-title' AND cn.country_code ='[sm]' AND t.id = mk.movie_id AND mc.movie_id = mk.mo...
job
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE mi.movie_id = t.id AND ct.kind = 'production co...
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 it.id = mi_idx.info_type_id AND t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '...
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 ci.movie_id = t.id AND n1.name NOT LIKE '%Yu%' AND cn.country_code = '[jp]' AND an1.person_id = n1.id AND mc.co...
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 mc.note NOT LIKE '%(USA)%' AND mc.note LIKE '%(Japan)%' AND an1.person_id = ci.person_id AND t.id = mc.movie_id...
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.kind = 'movie' AND mi.movie_id = mc.movie_id...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderkey = l1.l_orderkey AND l1.l_receiptdate > l1.l_commitdate AND n_name = 1 AND 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....
tpch
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where cn.country_code ='[sm]' AND mk.keyword_id = k.id AND k.keyword ='character-name-In-title' AND mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND mc.movie_id = t.id AND t.id = mk.mo...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_suppkey = l1.l_suppkey AND l1.l_receiptdate > l1.l_commitdate 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 o_orderkey = l1...
tpch
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_suppkey = l_suppkey and l_shipda...
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 rt.role = 'actress' AND n.id = ci.person_i...
job
SELECT STDDEV_SAMP(ss_quantity) AS store_sales_quantitystdev, AVG(sr_return_quantity) AS store_returns_quantityave, s_state, COUNT(sr_return_quantity) AS store_returns_quantitycount, COUNT(cs_quantity) AS catalog_sales_quantitycount, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, STDDEV_SAMP(...
tpcds
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 chn.id = ci.person_role_id AND rt.id = ci.role_id AND t.id = mc.movie_id AND ci.note Like '%(uncredi...
job
Select Count(*) From comments As c, posts As p, users As u Where p.CommentCount >= 0 And c.CreationDate >= '2010-08-05 00:36:02'::timestamp And p.ViewCount >= 0 And c.UserId = u.Id And u.Id = p.OwnerUserId And p.FavoriteCount >= 0
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 it2.id = mi.info_type_id AND cn.id = mc.company_id AND it1.info = 'rat...
job
WITH year_total AS ( SELECT c_login AS customer_login, c_customer_id AS customer_id, d_year AS dyear, c_first_name AS customer_first_name, c_birth_country AS customer_birth_country, c_last_name AS customer_last_name, c_email_address AS customer_email_address, c_preferred_cust_flag AS customer_preferred_cust_flag, 's' A...
tpcds
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 MIN(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE ci.movie_id = mc.movie_id AND an1.person_id = ci.person_id AND mc.company_id = cn.id AND t.id = mc.movie_id AND...
job
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE l_suppkey = s_suppkey AND c_custkey = o_custkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_nationkey = s_nationkey AND o_orderdate >= DATE 1 AND l_orderkey = o_orderkey AND s_nationk...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE p.Score <= 13 AND p.AnswerCount >= 0 AND u.Id = c.UserId AND p.OwnerUserId = ph.UserId AND ph.UserId = v.UserId AND c.UserId = p.OwnerUserId LIMIT 10;
stats
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.id = mi_idx.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mc.movie...
job
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE mk.movie_id = mi.movie_id AND k.id = mk.keyword_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.keyword LIKE '%sequel%' AND t.production_year > 200...
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_suppkey = l_suppkey AND l_shipda...
tpch
SELECT o_shippriority, o_orderdate, l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem WHERE o_orderdate < DATE 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND l_shipdate > DATE 1 AND c_mktsegment = 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
Select Count(*) From badges As b, posts As p Where b.Date <= '2014-09-11 08:55:52'::timestamp AND b.UserId = p.OwnerUserId AND p.AnswerCount >= 0 AND p.AnswerCount <= 4 Limit 200;
stats
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.production_year > 2010 AND t.id = mk.movie_id AND n.id = ci.person_id AND t.id = ci.movie_id AND n.name LIKE '%Downey%Robert%' AND k.id =...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b, users AS u WHERE p.Score <= 40 AND p.Id = pl.RelatedPostId AND c.UserId = u.Id AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND p.Id = ph.PostId AND b.UserId = u.Id AND p.Id = v.PostId
stats
SELECT COUNT(cs_quantity) AS catalog_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, AVG(cs_quantity) AS catalog_sales_quantityave, AVG(sr_return_quantity) AS store_returns_quantityave, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, i_item_desc, s_state, S...
tpcds
SELECT AVG(l_extendedprice) AS avg_price, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_quantity) AS sum_qty, l_linestatus, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_discount) AS avg_disc, l_returnflag, SUM(l_extendedprice) AS sum_base_price, ...
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 t.id = ci.movie_id AND ci.note LIKE '%(voice)%' AND rt.id = ci.role_id AND ci.movie_id = mc.movie_id...
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 ci.movie_id = mc.movie_id And rt.role = 'actress' And ci.role_id = rt.id And n1.name Like '%Yo%' And mc.note Li...
job
SELECT cust_nation, l_year, SUM(volume) AS revenue, supp_nation 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 c_nationkey = n2.n_nationkey AND s...
tpch
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, l_orderkey, o_shippriority, o_orderdate FROM customer, orders, lineitem WHERE l_shipdate > DATE 1 AND c_custkey = o_custkey AND l_orderkey = o_orderkey AND c_mktsegment = 1 AND o_orderdate < DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE p.Id = pl.RelatedPostId AND b.UserId = c.UserId AND p.Id = v.PostId AND p.Id = ph.PostId AND p.Id = c.PostId AND pl.LinkTypeId = 1 AND c.Score = 0
stats
SELECT SUM(volume) AS revenue, cust_nation, l_year, supp_nation 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 c_custkey = o_custkey AND o_orderk...
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 ml.linked_movie_id = t.id AND ci.movie_id = ml.linked_movie_id AND pi.note = 'Volker Boehm' AND it.id = pi.info_type_i...
job
SELECT MAX(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 mc.movie_id = mi.movie_id AND ct.id = mc.company_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi.movie_id AND (mc.note...
job
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 it.id = mi_idx.info_type_id AND t.production_year <= 2005 AND mi_idx.info > '8.0' AND t.production_year >= 2000 AND t.id = mi_idx.movie_id AND it.info ='rating'
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.production_year > 1990 AND t.id = mk.movie_id AND ci.role_i...
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 AVG(ss_list_price) AS agg2, AVG(ss_quantity) AS agg1, AVG(ss_coupon_amt) AS agg3, AVG(ss_sales_price) AS agg4, i_item_id 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...
tpcds
Select c_last_name, c_first_name, ca_city, extended_price, list_price, bought_city, extended_tax, ss_ticket_number From ( Select ss_ticket_number, ss_customer_sk, ca_city As bought_city, Sum(ss_ext_sales_price) As extended_price, Sum(ss_ext_list_price) As list_price, Sum(ss_ext_tax) As extended_tax From store_sales Joi...
tpcds
select avg(cs_list_price) as agg2, avg(cs_coupon_amt) as agg3, i_item_id, avg(cs_sales_price) as agg4, 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 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 ='[sm]' and mk.keyword_id = k.id and cn.id = mc.company_id and k.keyword ='character-name-in-title' and t.id = mk.movie_id and mc.movie_id ...
job
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_nationkey = s_nationkey AND l_orderkey = o_orderkey AND s_nationkey = n_nationkey AND r_name = 1 AND c_custkey = o_custkey AND o_orderdate >= DATE 1 AND n_regionkey = r_regionkey AND l_sup...
tpch
SELECT MAX(mc.note) AS production_note, MAX(t.title) AS movie_title, MAX(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 mc.movie_id = mi_idx.movie_id AND ct...
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 it.id = mi_idx.info_type_id AND mc.movie_id = mi_idx.movie_id AND t.id = mi_idx.movie_id AND it.info = 'to...
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 n.id = ci.person_id AND ci.note IN ('(voice)', '(voice: Japanese version)...
job
select i_item_id, avg(cs_coupon_amt) as agg3, avg(cs_list_price) as agg2, avg(cs_quantity) as agg1, 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 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.production_year > 2005 AND ci.note LIKE '%(uncredited)%' AND rt.role = 'actor' AND ci.movie_id = m...
job
SELECT MIN(miidx.info) AS rating, MIN(mi.info) AS release_date, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE cn.id = mc.company_id AND miidx.movie_id = mc.m...
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 o_orderdate >= DATE 1 AND l_orderkey = o_orderkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AND c_nationkey = n_nationke...
tpch
SELECT SUM(ss_quantity) AS store_sales_quantity, s_store_name, s_store_id, SUM(sr_return_quantity) AS store_returns_quantity, i_item_id, i_item_desc, 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 s_name, Count(*) As numwait From supplier, lineitem l1, orders, nation Where s_suppkey = l1.l_suppkey AND Not Exists ( Select * From lineitem l3 Where l3.l_orderkey = l1.l_orderkey And l3.l_suppkey <> l1.l_suppkey And l3.l_receiptdate > l3.l_commitdate ) AND o_orderkey = l1.l_orderkey AND o_orderstatus = 'F' AND...
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 mi.note LIKE '%internet%' AND t.id ...
job
SELECT o_orderkey, o_totalprice, c_name, c_custkey, o_orderdate, SUM(l_quantity) FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey HAVING SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey, o_orderkey, o_orderdat...
tpch
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_custkey = o_custkey AND n_regionkey = r_regionkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND l_orderkey = o_orderkey AND l_suppkey = s_suppkey AND r_name = 1 AND s_nationkey = n_nati...
tpch
SELECT l_shipmode, SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count FROM orders, lineitem WHERE l_shipdate < l_commitdate AND l_shipmode IN ...
tpch
SELECT SUM(l_quantity) AS sum_qty, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_discount) AS avg_disc, l_returnflag, AVG(l_quantity) AS avg_qty, l_linestatus, SUM(l_extend...
tpch
select c_last_name, cnt, c_first_name, c_preferred_cust_flag, c_salutation, ss_ticket_number 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, cnt, ss_ticket_number, c_preferred_cust_flag FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN store ON ss_store_sk = s_store_sk INNER JOIN household_demographics ON ss_hdemo_sk =...
tpcds
SELECT MIN(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 it.info ='rating' AND t.id = mi_idx.movie_id AND mi_idx.info > '7.0' AND t.production_year <= 2010 AND it.id = mi_idx.info_type_id AND t.production_year >= 2000
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 c_nationkey = n1.n_na...
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 k.keyword ='character-name-in-title' AND mc.movie_id = t.id AND t.id = mk.movie_id AND cn.country_code ='[de]' AND cn.id = mc.company_id AND mk.keyword_id ...
job
WITH _q AS ( SELECT p_size, p_brand, p_type, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_type NOT LIKE 1 AND p_partkey = ps_partkey AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_brand <> 1 GRO...
tpch
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE o_orderdate BETWEEN D...
tpch
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE l_orderkey = o_orderkey AND s_nationkey = n_nationkey AND r_name = 1 AND o_orderdate >= DATE 1 AND l_suppkey = s_suppkey AND c_custkey = o_custkey AND n_regionkey = r_regionkey AND c_nationk...
tpch
select c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt from ( select ss_ticket_number, ss_customer_sk, count(*) as cnt from store_sales 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 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE p_partkey = ps_partkey AND p_size = 1 AND r_name = 1 AND p_type LIKE 1 AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM p...
tpch
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where mk.keyword_id = k.id And k.keyword ='character-name-In-title' And cn.id = mc.company_id And t.id = mk.movie_id And cn.country_code ='[nl]' And mc.movie_id = t.id And mc.movie_id = mk.mo...
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 ct.kind = 'production companies' AND kt.kind = ...
job
select s_suppkey, s_name, s_address, s_phone, total_revenue from supplier, revenue0 where s_suppkey = supplier_no and total_revenue = ( select max(total_revenue) from revenue0 ) order by s_suppkey LIMIT 500;
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 = pl.PostId And p.AnswerCount >= 0 And u.Id = p.OwnerUserId And p.Id = v.PostId And p.PostTypeId = 1 And p.Id = c.PostId
stats
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 c_nationkey = n1.n_na...
tpch
SELECT i_brand AS brand, i_brand_id AS brand_id, 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_address_sk JO...
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', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') And k.id = mk.keyword_id And t.id = mi.movie_id And t.production_year > 2000 And m...
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 pl.LinkTypeId = 1 AND p.Id = ph.PostId AND c.UserId = u.Id AND p.Id = c.PostId AND p.Score <= 40 AND b.UserId = u.Id AND p.Id = v.PostId AND p.Id = pl.RelatedPostId
stats
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 it.info = 'top 250 rank' And mc.note Not Like '%(As Metro-Goldwyn-May...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.FavoriteCount >= 0 AND c.Score = 0 AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Id = pl.PostId AND p.Id = ph.PostId AND p.Id = c.PostId
stats
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b, users AS u WHERE p.Id = pl.RelatedPostId AND c.UserId = u.Id AND p.Id = v.PostId AND p.Score <= 40 AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND p.Id = c.PostId AND b.UserId = u.Id
stats
SELECT l_linestatus, AVG(l_extendedprice) AS avg_price, AVG(l_discount) AS avg_disc, COUNT(*) AS count_order, SUM(l_quantity) AS sum_qty, l_returnflag, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extend...
tpch
SELECT bought_city, c_last_name, c_first_name, ss_ticket_number, extended_tax, ca_city, extended_price, list_price FROM ( SELECT ss_ticket_number, ss_customer_sk, ca_city AS bought_city, SUM(ss_ext_sales_price) AS extended_price, SUM(ss_ext_list_price) AS list_price, SUM(ss_ext_tax) AS extended_tax FROM store_sales JOI...
tpcds
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where t.id = mk.movie_id AND mk.keyword_id = k.id AND k.keyword ='character-name-In-title' AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND cn.id = mc.comp...
job
SELECT COUNT(*) FROM comments AS c, postHistory AS ph, votes AS v, users AS u WHERE u.Views >= 0 AND u.Id = v.UserId AND u.DownVotes >= 0 AND u.UpVotes <= 123 AND v.UserId = ph.UserId AND ph.UserId = c.UserId LIMIT 500;
stats
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where t.id = mk.movie_id AND t.id = mi.movie_id AND mi.info in ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.keyword like '%sequel%' AND k.id = mk.keyword_id AND t.produ...
job
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE l_orderkey = o_orderkey AND r_name = 1 AND l_suppkey = s_suppkey AND s_nationkey = n_nationkey AND o_orderdate >= DATE 1 AND c_nationkey = s_nationkey AND c_custkey = o_custkey AND n_regionk...
tpch
SELECT AVG(cs_sales_price) AS agg4, AVG(cs_list_price) AS agg2, AVG(cs_quantity) AS agg1, i_item_id, AVG(cs_coupon_amt) AS agg3 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(ss_sales_price) AS agg4, i_item_id, AVG(ss_quantity) AS agg1, AVG(ss_coupon_amt) AS agg3, AVG(ss_list_price) AS agg2 FROM store_sales INNER JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN item ON ss_item_sk = i_item_sk INNER JOIN promotion ...
tpcds