text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
SELECT STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, COUNT(sr_return_quantity) AS store_returns_quantitycount, STDDEV_SAMP(ss_quantity) AS store_sales_quantitystdev, AVG(sr_return_quantity) AS store_returns_quantityave, i_item_desc, COUNT(ss_quantity) AS store_sales_quantitycount, COUNT(cs_q...
tpcds
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 t.id = mk.movie_id AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND t.production_y...
job
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND ct.kind = 'production companies' AND...
job
SELECT 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 COUNT(1) from comments as c, postHistory as ph, votes as v, users as u where u.Id = v.UserId AND v.UserId = ph.UserId AND u.Views >= 0 AND u.DownVotes >= 0 AND u.UpVotes <= 123 AND ph.UserId = c.UserId
stats
Select p_brand, p_type, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where p_type Not Like 1 And p_brand <> 1 And p_size In (1, 1, 1, 1, 1, 1, 1, 1) And ps_suppkey Not In ( Select s_suppkey From supplier Where s_comment Like '%Customer%Complaints%' ) And p_partkey = ps_partkey Group By p_brand...
tpch
SELECT s_store_name, i_item_id, s_store_id, MAX(sr_net_loss) AS store_returns_loss, MAX(cs_net_profit) AS catalog_sales_profit, i_item_desc, MAX(ss_net_profit) AS store_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 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 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 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 mk.keyword_id = k.id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND cn.id = mc.company_id AND t.id = mk.movie_id AND k.keyword ='character-name-in-...
job
SELECT c_last_name, ca_city, bought_city, extended_price, ss_ticket_number, extended_tax, c_first_name, 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 i_item_id, AVG(ss_quantity) AS agg1, AVG(ss_sales_price) AS agg4, 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 MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword 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 t.id = ci.movie_id AND n.id = ci.person_id AND ci.movie_id = mk.movie_id AND t.id = mk.movie_id AND t.production_y...
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.info = 'top 250 rank' AND ct.kind = 'production companies' AND (mc.note LIKE '%(co-production)%' OR mc....
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 r_name = 1 AND o_orderdate >= DATE 1 AND n_regionkey = r_regionkey AND l_orderkey = o_orderkey AND s_nationkey = n_nationkey AND c_nationk...
tpch
SELECT promotions, total, CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100 FROM ( SELECT SUM(ss_ext_sales_price) AS promotions FROM store_sales JOIN store ON ss_store_sk = s_store_sk JOIN promotion ON ss_promo_sk = p_promo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN customer ON ss_custo...
tpcds
SELECT c_first_name, c_last_name, cnt, c_salutation, ss_ticket_number, c_preferred_cust_flag 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 AVG(l_extendedprice) AS avg_price, COUNT(*) AS count_order, l_linestatus, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_quantity) AS sum_qty, l_returnflag, AVG(l_discount) AS avg_disc, SUM(l_extend...
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 miidx.movie_id = t.id AND kt.kind = 'movie' AND...
job
WITH year_total AS ( SELECT c_customer_id AS customer_id, c_preferred_cust_flag AS customer_preferred_cust_flag, c_email_address AS customer_email_address, c_last_name AS customer_last_name, c_birth_country AS customer_birth_country, c_login AS customer_login, d_year AS dyear, c_first_name AS customer_first_name, 's' A...
tpcds
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE it.info = 'mini biography' AND an.person_id = ci.person_id AND ml.linked_movie_id = t.id AND n.name_pcode_cf BETWEEN '...
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 t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.id = mi.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct...
job
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE cn.id = mc.company_id AND kt.id = t.kind_id AND...
job
WITH year_total AS ( SELECT c_birth_country AS customer_birth_country, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_customer_id AS customer_id, c_last_name AS customer_last_name, 's' AS sale_type, d_year AS dyear, c_preferred_cust_flag AS customer_pr...
tpcds
SELECT MIN(t.title) AS marvel_movie, MIN(n.name) AS actor_name, MIN(k.keyword) AS movie_keyword FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = mk.movie_id AND t.production_year > 2010 AND k.keyword = 'marvel-cinematic-universe' AND ci.movie_id = mk.movie_id AND n.id = ci.per...
job
Select Count(*) From comments As c, postHistory As ph, users As u Where u.Id = c.UserId And c.UserId = ph.UserId And u.UpVotes <= 27 And u.Reputation >= 1 Limit 50;
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 n.id = ci.person_id AND t.id = ci.movie_id AND k.id = mk.keyword_id AND k.keyword = 'marvel-cinematic-universe' AND t.id = mk.movie_id AND ...
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 SUM(ss_ext_sales_price) AS ext_price, item.i_brand_id AS brand_id, dt.d_year, item.i_brand AS brand FROM date_dim AS dt INNER JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk INNER JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE item.i_manager_id = 57 AND dt.d_moy = 12 AND dt.d_year = 20...
tpcds
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE ci.movie_id = ml.linked_movie_id AND t.production_year BETWEEN 1980 AND 1995 AND an.name LIKE '%a%' AND an.person_id =...
job
WITH year_total AS ( SELECT c_first_name AS customer_first_name, c_login AS customer_login, c_customer_id AS customer_id, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, 's' AS sale_type, c_email_address AS customer_email_address, d_year AS dyear, c_prefe...
tpcds
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.kind = 'production companies' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mc....
job
select dt.d_year, item.i_brand_id as brand_id, sum(ss_ext_sales_price) as ext_price, item.i_brand as brand 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 = 1999 group by ...
tpcds
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 mc.movie_id = mi_idx.movie_id AND t.id = mi_idx.movie_id AND ct.kind = 'production companies' AND mc.note ...
job
WITH year_total AS ( SELECT c_preferred_cust_flag AS customer_preferred_cust_flag, d_year AS dyear, 's' AS sale_type, c_birth_country AS customer_birth_country, c_customer_id AS customer_id, c_last_name AS customer_last_name, c_login AS customer_login, c_email_address AS customer_email_address, c_first_name AS customer...
tpcds
SELECT i_item_desc, i_item_id, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, AVG(sr_return_quantity) AS store_returns_quantityave, AVG(cs_qu...
tpcds
SELECT o_orderdate, o_shippriority, SUM(l_extendedprice * (1 - l_discount)) AS revenue, l_orderkey FROM customer, orders, lineitem WHERE c_custkey = o_custkey AND c_mktsegment = 1 AND l_shipdate > DATE 1 AND o_orderdate < DATE 1 AND l_orderkey = o_orderkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE mc.note LIKE '%(Japan)%' AND mc.note NOT LIKE '%(USA)%' AND r...
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 t.id = mi_idx.movie_id And it.id = mi_idx.info_type_id And mi_idx.info > '8.0' And t.production_year Between 2000 And 2005 And it.info ='rating'
job
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey AND n_regionkey...
tpch
SELECT MIN(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 ct.id = mc...
job
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE p_name LIKE 1 ) AS profit AND s_nationkey = n_nationkey AND s...
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_custkey = c_custkey...
tpch
Select list_price, ca_city, c_first_name, c_last_name, extended_tax, bought_city, ss_ticket_number, extended_price From ( Select ss_ticket_number, ss_customer_sk, ca_city As bought_city, Sum(ss_ext_sales_price) As extended_price, Sum(ss_ext_list_price) As list_price, Sum(ss_ext_tax) As extended_tax From store_sales Joi...
tpcds
SELECT 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 ( (n1.n_name = 1 AND n2.n_name = 1...
tpch
SELECT l_orderkey, o_orderdate, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_shippriority FROM customer, orders, lineitem WHERE o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_shipdate > DATE 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
tpch
WITH year_total AS ( SELECT d_year AS dyear, c_email_address AS customer_email_address, c_first_name AS customer_first_name, c_last_name AS customer_last_name, c_login AS customer_login, c_preferred_cust_flag AS customer_preferred_cust_flag, c_customer_id AS customer_id, SUM(((ss_ext_list_price - ss_ext_wholesale_cost ...
tpcds
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE k.keyword = 'character-name-in-title' AND t.id = mc.movie_id AND cn.country_code = '[us]' A...
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.id = mc.company_id AND mi_idx.info < '3.5' AND t.id = mi.movie_id A...
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 t.id = ci.movie_id AND pi.person_id = ci.person_id AND ci.person_id = n.id AND n.id = pi.person_id AND pi.note = 'Volk...
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 k.keyword = 'character-name-IN-title' AND mk.keyword_id = k.id AND t.episode_nr >= 50 AND c...
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.Id = c.PostId AND p.Id = pl.RelatedPostId AND p.Id = ph.PostId AND p.Score <= 40 AND c.UserId = u.Id AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND b.UserId = u.Id
stats
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE u.Id = p.OwnerUserId AND p.Id = v.PostId AND p.Id = ph.PostId AND p.ViewCount >= 0 AND p.Score <= 192 AND p.Id = c.PostId AND u.Id = b.UserId LIMIT 50;
stats
select min(mi_idx.info) as rating, min(t.title) as movie_title from info_type as it, movie_info_idx as mi_idx, title as t where mi_idx.info > '8.0' and it.id = mi_idx.info_type_id and it.info ='rating' and t.id = mi_idx.movie_id and t.production_year >= 2000 and t.production_year <= 2005
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 t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.id = mi_id...
job
WITH _q AS ( 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.person_id = an.person_id AND t.production_yea...
job
select i_current_price, i_item_desc, i_item_id 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 100 and 100 + 30 and i_manufact_id in (195, 412, 338, 267) and d_date between CAST('2000-05-01' as DATE) ...
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 t.id = mk.movie_id AND k.keyword ='character-name-in-title' AND cn.country_code ='[nl]' AND cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND mk.keyword_id ...
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 n.id = an.person_id AND ml.linked_movie_id = t.id AND n.id = pi.person_id AND it.info = 'mini biography' AND lt.link =...
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 dt.d_year, item.i_brand AS brand, SUM(ss_ext_sales_price) AS ext_price, item.i_brand_id AS brand_id FROM date_dim AS dt JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE dt.d_moy = 12 AND dt.d_year = 1999 AND item.i_manager_id = 95 GROUP BY ...
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 s_suppkey = ps_suppkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND...
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 o_orderkey = l_orderkey AND c_nati...
tpch
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.keyword Like '%sequel%' AND t.id = mi.movie_id AND t.production_year > 2000 AND mk.movie_id = mi.movie_id ...
job
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE ci.movie_id = mc.movie_id AND chn.id = ci.person_role_id AND it.info = 'r...
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_brand <> 1 and p_type not like 1 and p_size in (1, 1, 1, 1, 1, 1, 1, 1) and ps_suppkey not in ( select s_suppkey from supplier where s_comment like '%Customer%Complaints%' ) group by p_brand...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = c.PostId AND p.Id = pl.PostId AND p.Id = ph.PostId AND c.Score = 0 AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.FavoriteCount >= 0
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 ml.linked_movie_id = t.id AND pi.person_id = ci.person_id AND n.id = an.person_id AND an.name LIKE '%a%' AND ci.person...
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.id = pi.person_id AND ci.movie_id = ml.linked_movie_id AND t.id = ci.movie_id AND n.id = an...
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.id = mc.company_id AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-IN-title' AND mc.movie_id = t.id AND cn.country_code ='[nl]' AND mk.keyword_id ...
job
SELECT cc_name AS call_center_name, cc_manager AS manager, SUM(cr_net_loss) AS returns_loss, cc_call_center_id AS call_center FROM call_center JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk JOIN date_dim ON cr_returned_date_sk = d_date_sk JOIN customer ON cr_returning_customer_sk = c_customer_sk JOIN cus...
tpcds
Select Min(n.name) As voicing_actress, Min(t.title) As voiced_movie From aka_name As an, char_name As chn, cast_info As ci, company_name As cn, info_type As it, movie_companies As mc, movie_info As mi, name As n, role_type As rt, title As t Where cn.country_code = '[us]' AND it.id = mi.info_type_id AND t.id = ci.movie_...
job
SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales INNER JOIN store ON s_store_sk = ss_store_sk INNER JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk INNER JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk INNER JOIN customer_address ON...
tpcds
SELECT 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_receiptdate >= DATE 1 AND l_shipdate < l_c...
tpch
SELECT s_acctbal, n_name, s_name, s_phone, p_partkey, s_comment, p_mfgr, s_address FROM part, supplier, partsupp, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 1 AND p_type LIKE 1 AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r_name = 1 AND ps_supplycost = ( SELEC...
tpch
WITH _q AS ( SELECT 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, l_shipmode FROM orders, lineitem WHERE l_shipdate < l_commitdate AND l...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE c.UserId = p.OwnerUserId AND u.Id = c.UserId AND p.AnswerCount >= 0 AND ph.UserId = v.UserId AND p.OwnerUserId = ph.UserId AND p.Score <= 13 LIMIT 10;
stats
SELECT i_brand_id AS brand_id, i_manufact_id, i_manufact, SUM(ss_ext_sales_price) AS ext_price, i_brand AS brand 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 western_violent_movie, MIN(cn.name) AS movie_company, 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(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 t.id = mi.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND ct.id = mc.company_type_id AND t.id = mc.movie_id AND mc.no...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderstatus = 'F' 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 s_suppkey = l1.l_sup...
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 s_nationkey = n_nationkey AND l_suppkey = s_suppkey AND n_regionkey = r_regionkey AND c_nationkey = s_nationkey AND r_name = 1 AND l_orderkey = o_orderkey AND o_ord...
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 MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE k.id = mk.keyword_id AND ci.movie_id = mc.movie_id AND t.id =...
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 n.id = pi.person_id AND n.name_pcode_cf BETWEEN 'A' AND 'F' AND pi.person_id = an.person_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 p_partkey = l_partkey...
tpch
Select Count(*) From votes As v, users As u Where u.DownVotes = 0 And v.UserId = u.Id LIMIT 10;
stats
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE c.Score = 0 AND p.FavoriteCount >= 0 AND pl.LinkTypeId = 1 AND p.Id = pl.PostId AND p.Id = v.PostId AND p.Id = ph.PostId AND p.Id = c.PostId LIMIT 200;
stats
SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, o_shippriority FROM customer, orders, lineitem WHERE c_mktsegment = 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND o_orderdate < DATE 1 AND l_shipdate > DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
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 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 n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate < DATE 1 + INTERVAL '1' YEAR AND o_orderdate >= DATE 1 AND c_custkey = o_custkey AND c_nationkey = s_nationkey AND r_name = 1 AND l_suppkey = s_suppkey AND l_orderkey = o_orderke...
tpch
select count(*) from comments as c, postHistory as ph, votes as v, users as u where u.DownVotes >= 0 AND u.Views >= 0 AND u.Id = v.UserId AND ph.UserId = c.UserId AND v.UserId = ph.UserId AND u.UpVotes <= 123 LIMIT 1000;
stats
SELECT s_name, s_address FROM supplier, nation WHERE s_nationkey = n_nationkey AND s_suppkey IN ( SELECT ps_suppkey FROM partsupp WHERE ps_partkey IN ( SELECT p_partkey FROM part WHERE p_name LIKE 1 ) AND ps_availqty > ( SELECT 0.5 * SUM(l_quantity) FROM lineitem WHERE l_partkey = ps_partkey AND l_suppkey = ps_suppkey ...
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 k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND t.id = mk.movie_id AND mc.movie_id = t.id AND cn.country_code ='[de]' AND mc.movie_id = mk.movie_id AND cn.id = mc.comp...
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 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 = ph.PostId AND p.Id = c.PostId AND c.Score = 0 AND b.UserId = c.UserId AND p.Id = pl.RelatedPostId LIMIT 50;
stats
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 c_custkey = o_custkey AND o_orderk...
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_receiptdate < DATE 1 + INTERVAL '1' YEAR A...
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 k.keyword = 'marvel-cinematic-universe' AND t.id = mk.movie_id AND n.name LIKE '%Hemsworth%Chris%' AND n.id = ci.person_id AND t.production...
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