text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
SELECT AVG(cs_list_price) AS agg2, i_item_id, AVG(cs_quantity) AS agg1, AVG(cs_sales_price) AS agg4, 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 l_orderkey, Sum(l_extendedprice * (1 - l_discount)) As revenue, o_orderdate, o_shippriority From customer, orders, lineitem Where l_orderkey = o_orderkey And o_orderdate < DATE 1 And l_shipdate > DATE 1 And c_mktsegment = 1 And c_custkey = o_custkey Group By l_orderkey, o_orderdate, o_shippriority Order By reven...
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(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 miidx.movie_id = mc.movi...
job
SELECT c_name, c_comment, c_phone, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_custkey, c_acctbal, c_address, 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 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 ='[de]' AND mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND cn.id = mc.company_id AND t.id = mk.movie_id AND mc.movie_id = t.id AND k.keyword ='character-name-in-...
job
SELECT l_year, SUM(volume) AS revenue, cust_nation, 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 s_suppkey = l_suppkey AND ( (n1.n_...
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 item.i_brand As brand, dt.d_year, 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 = 11 And dt.d_year = 2000 And item.i_manager_id = 69 Group By ...
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 ct.kind = 'production companies' AND mi.movie_i...
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 mk.keyword_id = k.id AND ci.movie_id = mc.movie_id AND mc.company_id = cn.id AND t.episode_...
job
WITH _q AS ( 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 =...
tpcds
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE t.production_year > 1990 AND n.gender = 'f' AND ct.id = mc.co...
job
with _q as ( 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 mi_idx.info > '8.0' AND it.id = mi_idx.info_type_id ) select * from _q and t.id = mi_idx.movie_id AND t.production_year BETWEEN 2000 AND 2005
job
Select Min(cn.name) As from_company, Min(lt.link) As link_type, Min(t.title) As western_sequel From company_name As cn, company_type As ct, info_type As it, keyword As k, link_type As lt, movie_companies As mc, movie_info As mi, movie_keyword As mk, movie_link As ml, title As t Where it.info = 'release dates' And mc.no...
job
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE ct.id = mc.company_type_id AND it.info = 'top 250 rank' AND ct.kind = 'production companies' AND mc.note N...
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 it.info = 'release dates' AND n.gender = 'f' AND t.production_year > 2000...
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 77 And 77 + 30 And i_manufact_id In (211, 362, 413, 88) And inv_quantity_on_hand Between 100 And 500 And ...
tpcds
Select l_orderkey, Sum(l_extendedprice * (1 - l_discount)) As revenue, o_shippriority, o_orderdate From customer, orders, lineitem Where c_custkey = o_custkey And o_orderdate < DATE 1 And l_shipdate > DATE 1 And c_mktsegment = 1 And l_orderkey = o_orderkey Group By l_orderkey, o_orderdate, o_shippriority Order By reven...
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 it.id = mi_idx.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi_idx.m...
job
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(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.id = mc.company_type_id AND it.in...
job
WITH _q AS ( 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 mi_idx.info > '7.0' AND it.info ='rating' AND it.id = mi_idx.info_type_id AND t.production_year BETWEEN 2000 AND 2010 ) SELECT * FROM _q;
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 NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct.kind = 'production companies' AND t.id = mi_...
job
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate >= DATE 1 AND c_nationkey = s_nationkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_custkey = o_custkey AND l_orderkey = o_orderkey AND n_regionkey = r_regionkey AND r_nam...
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 t.id = mk.movie_id AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND k.keyword ='character-name-in-title' AND cn.id = mc.comp...
job
SELECT COUNT(1) FROM badges AS b, posts AS p WHERE p.AnswerCount >= 0 AND p.AnswerCount <= 4 AND b.UserId = p.OwnerUserId AND b.Date <= '2014-09-11 08:55:52'::timestamp LIMIT 100;
stats
SELECT COUNT(*) FROM comments AS c, posts AS p, users AS u WHERE p.CommentCount >= 0 AND c.UserId = u.Id AND p.FavoriteCount >= 0 AND p.ViewCount >= 0 AND u.Id = p.OwnerUserId AND c.CreationDate >= '2010-08-05 00:36:02'::timestamp
stats
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 COUNT(1) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE p.Score <= 13 AND ph.UserId = v.UserId AND p.OwnerUserId = ph.UserId AND p.AnswerCount >= 0 AND c.UserId = p.OwnerUserId AND u.Id = c.UserId LIMIT 500;
stats
WITH _q AS ( 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 l_returnflag = 'R' AND c_custkey = o_custkey AND o_orderdate >= DATE 1 AND l_orderkey = o_orderkey AND c_nationkey = n_nationkey AND o...
tpch
WITH _q AS ( 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_suppke...
tpch
SELECT list_price, c_last_name, extended_tax, ca_city, bought_city, c_first_name, extended_price, 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 INN...
tpcds
SELECT STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, i_item_desc, COUNT(sr_return_quantity) AS store_returns_quantitycount, i_item_id, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, COUNT(cs_quantity) AS catalog_sales_quantitycount, STDDEV_SAMP(cs_quant...
tpcds
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 p_brand, p_type, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where ps_suppkey Not In ( Select s_suppkey From supplier Where s_comment Like '%Customer%Complaints%' ) And p_brand <> 1 And p_size In (1, 1, 1, 1, 1, 1, 1, 1) And p_partkey = ps_partkey And p_type Not Like 1 Group By p_brand...
tpch
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where t.production_year > 2010 AND mi.info In ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.id = mi.movie_id AND mk.movie_id = mi.movie_id AND t.id = mk.movie_id AND k.id...
job
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 t.id = mi_idx.movie_id AND at.movie_id = mi.movie_id AND cn.id = mc.co...
job
select count(*) from comments as c, posts as p, users as u where c.UserId = u.Id and u.Id = p.OwnerUserId and c.CreationDate >= '2010-08-05 00:36:02'::timestamp and p.ViewCount >= 0 and p.CommentCount >= 0 and p.FavoriteCount >= 0 limit 1000;
stats
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 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(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 t.production_year <= 2010 AND t.production_year >= 2000 AND mi_idx.info > '7.0' AND it.id = mi_idx.info_type_id LIMIT 100;
job
SELECT MIN(t.title) AS voiced_movie, MIN(n.name) AS voicing_actress 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 mc.note LIKE '%(USA)%' AND ci.note IN ('(voice)', '(voice: Japanese versi...
job
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE o_orderdate BETWEEN D...
tpch
SELECT SUM(l_extendedprice) / 7.0 AS avg_yearly FROM lineitem, part WHERE l_quantity < ( SELECT 0.2 * AVG(l_quantity) FROM lineitem WHERE l_partkey = p_partkey ) AND p_container = 1 AND p_partkey = l_partkey AND p_brand = 1 LIMIT 10;
tpch
SELECT COUNT(*) FROM comments AS c, postHistory AS ph, votes AS v, users AS u WHERE u.UpVotes <= 123 AND v.UserId = ph.UserId AND ph.UserId = c.UserId AND u.DownVotes >= 0 AND u.Views >= 0 AND u.Id = v.UserId LIMIT 200;
stats
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.role_id = rt.id AND n1.name NOT LIKE '%Yu%' AND cn.country_code = '[jp]' AND ci.note = '(voice: English vers...
job
SELECT c_salutation, cnt, c_last_name, ss_ticket_number, c_first_name, 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
WITH year_total AS ( SELECT c_email_address AS customer_email_address, c_last_name AS customer_last_name, d_year AS dyear, c_first_name AS customer_first_name, c_birth_country AS customer_birth_country, c_customer_id AS customer_id, c_login AS customer_login, 's' AS sale_type, SUM(((ss_ext_list_price - ss_ext_wholesale...
tpcds
SELECT l_shipmode, SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count FROM orders, lineitem WHERE l_commitdate < l_receiptdate AND l_receiptda...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, votes AS v WHERE p.Id = c.PostId AND p.Score >= -3 AND c.CreationDate >= '2010-08-02 23:52:10'::timestamp AND v.VoteTypeId = 2 AND c.PostId = pl.PostId AND pl.PostId = v.PostId LIMIT 100;
stats
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(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = ci.movie_id AND k.id = mk.keyword_id AND t.id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND ci.movie_id = mk.movie_id AND t.pr...
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 ps_suppkey = l_suppkey AND ps_partkey = l_partkey AND p_name ...
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 = t.id AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND mk.keyword_id = k.id AND t.id = mk.movie_id AND cn.id = mc.company_id AND k.keyword ='character-name-In-...
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 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(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 t.id = mk.movie_id AND k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish...
job
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue FROM ( SELECT n1.n_name AS supp_nation, n2.n_name AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, l_extendedprice * (1 - l_discount) AS volume FROM supplier, lineitem, orders, customer, nation n1, nation n2 WHERE s_nationkey = n1.n_nationkey AND c...
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.country_code = '[ru]' AND rt.role = 'actor' AND ci.movie_id = mc.movie_id AND rt.id = ci.role_id ...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, votes AS v, users AS u WHERE p.Score >= 0 AND p.ViewCount >= 0 AND u.Id = v.UserId AND u.Id = c.UserId AND c.Score = 0 AND u.Id = p.OwnerUserId LIMIT 50;
stats
SELECT i_manufact, i_brand AS brand, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price, i_manufact_id 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 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 t.id = mi.movie_id AND t.production_year > 2010 AND k.keyword LIKE '%sequel%' AND k.id = mk.keyword_id AND t.id = mk.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish...
job
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi.movie_id AND mi.info LIKE 'USA:%200%' AND it2.info = 'releas...
job
SELECT MIN(mi.info) AS release_date, MIN(t.title) AS german_movie, 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 it.id = miidx.info_type_id AND mi.movie_id = mc...
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 t.id = mk.movie_id AND t.id = ci.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_id AND k.id = mk.keyword_id AND ...
job
SELECT MAX(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 cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND mc.movie_id = t.id AND cn.country_code ='[de]' AND mk.keyword_id ...
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 mk.keyword_id = k.id AND cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.country_code ='[nl]' AND mc.movie_id ...
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 t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND n.name LIKE '%Dow...
job
SELECT COUNT(1) FROM comments AS c, postHistory AS ph, votes AS v, users AS u WHERE u.Id = v.UserId AND u.Views >= 0 AND ph.UserId = c.UserId AND u.DownVotes >= 0 AND v.UserId = ph.UserId AND u.UpVotes <= 123 LIMIT 100;
stats
SELECT c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT MIN(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 (mc.note LIKE '...
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 = ci.movie_id AND n.id = ci.person_id AND ci.role_id = r...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE l1.l_receiptdate > l1.l_commitdate AND s_nationkey = n_nationkey AND o_orderstatus = 'F' AND o_orderkey = l1.l_orderkey AND s_suppkey = l1.l_suppkey AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_sup...
tpch
Select n_name, Sum(l_extendedprice * (1 - l_discount)) As revenue From customer, orders, lineitem, supplier, nation, region Where o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND l_orderkey = o_orderkey AND r_name = 1 AND c_custkey = o_cu...
tpch
WITH _q AS ( 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 DA...
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 ci.movie_id = mc.movie_id AND n1.id = ci.person_id AND mc.note NOT LIKE '%(USA)%' AND cn.country_code = '[jp]' ...
job
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where mi.info In ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.id = mi.movie_id AND t.id = mk.movie_id AND k.keyword Like '%sequel%' AND mk.movie_id = mi.movie_id AND t.p...
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.production_year > 2005 AND rt.id = ci.role_id AND ci.movie_id = mc.movie_id AND t.id = mc.movie_id...
job
SELECT AVG(l_quantity) AS avg_qty, SUM(l_quantity) AS sum_qty, SUM(l_extendedprice) AS sum_base_price, l_returnflag, AVG(l_discount) AS avg_disc, l_linestatus, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_extendedprice) AS avg_pric...
tpch
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 dt.d_year = 2002 AND dt.d_moy = 12 AND item.i_manager_id = 57 GROUP BY ...
tpcds
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 b.UserId = c.UserId and p.Id = c.PostId and c.Score = 0 and p.Id = pl.RelatedPostId and p.Id = ph.PostId
stats
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 cn.id = mc.company_id AND mi.movie_id = t.id AN...
job
SELECT SUM(amount) AS sum_profit, nation, 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 p_partkey = l_partkey AND ps_su...
tpch
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 b.UserId = u.Id And pl.LinkTypeId = 1 And p.Score <= 40 And c.UserId = u.Id And p.Id = v.PostId And p.Id = ph.PostId And p.Id = c.PostId
stats
SELECT l_year, supp_nation, cust_nation, 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 o...
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.production_year > 2005 AND ci.movie_id = mc.movie_id AND rt.id = ci.role_id AND rt.role = 'actor' ...
job
SELECT SUM(sr_return_quantity) AS store_returns_quantity, s_store_id, i_item_id, s_store_name, i_item_desc, SUM(ss_quantity) AS store_sales_quantity, SUM(cs_quantity) AS catalog_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti...
tpcds
SELECT STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, s_state, AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, i_item_id, AVG(cs_quantity) AS catalog_sales_quantityave, AVG(sr_return_quantity) AS store_returns_...
tpcds
SELECT AVG(ss_ext_sales_price), AVG(ss_quantity), SUM(ss_ext_wholesale_cost), AVG(ss_ext_wholesale_cost) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr...
tpcds
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_comment, c_phone, c_address, c_name, n_name, c_acctbal, 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 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 mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.production_year > 2000 AND k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND m...
job
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 ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_partkey = ps_partkey AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) GROUP BY p_brand...
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.id = mi_idx.movie_id AND t.production_year BETWEEN 2000 AND 2010 AND it.info ='rating' AND mi_idx.info > '7.0' AND it.id = mi_idx.info_type_id limit 200;
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 it.info = 'rating' AND kt.kind = 'movie' AND kt...
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 r_name = 1 AND p_partkey = ps_partkey AND n_regionkey = r_regionkey AND s_nationkey = n_nationkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region...
tpch
SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE it.info = 'bottom 10 rank' AND t.id = mc.movie_id AND ct.id = mc.company_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND mc.movie_id = mi.movie_id AND ct.kind ...
job
SELECT ca_city, c_last_name, bought_city, extended_price, list_price, c_first_name, ss_ticket_number, extended_tax 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 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 k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND k.id = mk.keyword_id AND t.production_year > 20...
job
select COUNT(1) from comments as c, postHistory as ph, badges as b, votes as v, users as u where b.UserId = ph.UserId AND u.UpVotes = 0 AND v.UserId = c.UserId AND ph.UserId = v.UserId AND ph.PostHistoryTypeId = 12 AND u.Id = b.UserId
stats
SELECT SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_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, l_linestatus, AVG(l_discount) AS avg_disc, SUM(l_extendedprice) AS sum_base_price, AVG(l_extendedprice) AS avg_price, ...
tpch