text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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_nationkey = s_nationkey AND o_orderdate >= DATE 1 AND r_name = 1 AND c_custkey = o_custkey AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND l_order...
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(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.id = ci.person_id AND an1.person_id = ci.person_id AND mc.note NOT LIKE '%(USA)%' AND...
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 ci.person_id = an.person_id AND t.productio...
job
WITH year_total AS ( SELECT c_preferred_cust_flag AS customer_preferred_cust_flag, d_year AS dyear, c_login AS customer_login, 's' AS sale_type, c_email_address AS customer_email_address, c_last_name AS customer_last_name, c_first_name AS customer_first_name, c_birth_country AS customer_birth_country, c_customer_id AS ...
tpcds
select COUNT(1) from postHistory as ph, posts as p, users as u, badges as b where ph.UserId = u.Id AND p.OwnerUserId = u.Id AND u.Id = b.UserId AND u.Reputation >= 1 AND p.Score >= -7 AND ph.PostHistoryTypeId = 3
stats
WITH _q AS ( SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderkey = l1.l_orderkey AND n_name = 1 AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_o...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE c.Score = 0 AND p.Id = pl.PostId AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND p.FavoriteCount >= 0 AND p.Id = c.PostId
stats
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 an.person_id = ci.person_id AND mc.company_id = c...
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 ml.movie_id = mc.movie_id AND mi.in...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.AnswerCount >= 0 AND p.PostTypeId = 1 AND p.Id = ph.PostId AND p.Id = v.PostId AND p.Id = c.PostId AND u.Id = p.OwnerUserId AND p.Id = pl.PostId
stats
SELECT MIN(t.title) AS series_named_after_char, MIN(an.name) AS cool_actor_pseudonym 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 t.id = mk.movie_id AND k.keyword = 'character-name-in-title' AND t.episode_nr >= 50 AND cn....
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 ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_type NOT LIKE 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) GROUP BY p_brand...
tpch
Select COUNT(1) From postLinks As pl, posts As p Where pl.PostId = p.Id And pl.LinkTypeId = 1 Limit 1000;
stats
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND mc.movie_id = t.id AND cn.country_code ='[nl]' AND k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND cn.id = mc.company_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 it.info = 'rating' AND kt.kind = 'movie' AND it...
job
SELECT SUM(ss_ext_sales_price) AS ext_price, i_brand_id AS brand_id, i_manufact_id, i_manufact, i_brand AS brand 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 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_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND c_custkey = o_custkey AND c_nationkey = n_natio...
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 SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, l_orderkey, o_shippriority FROM customer, orders, lineitem WHERE l_orderkey = o_orderkey AND l_shipdate > DATE 1 AND o_orderdate < DATE 1 AND c_custkey = o_custkey AND c_mktsegment = 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven...
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 k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_id AND k.id = mk.keyword_id AND t.id = mk.movie_id AND t.id = ci.movie_id AND ...
job
SELECT c_count, COUNT(*) AS custdist FROM ( SELECT c_custkey, COUNT(o_orderkey) AS c_count FROM customer LEFT OUTER JOIN orders ON c_custkey = o_custkey AND o_comment NOT LIKE 1 GROUP BY c_custkey ) AS c_orders GROUP BY c_count ORDER BY custdist DESC, c_count DESC LIMIT 50;
tpch
SELECT COUNT(1) FROM store_sales JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk JOIN time_dim ON ss_sold_time_sk = t_time_sk JOIN store ON ss_store_sk = s_store_sk WHERE t_minute >= 43 AND hd_dep_count = 4 AND s_store_name = 'ought' AND t_hour = 16 ORDER BY COUNT(1) ASC;
tpcds
SELECT COUNT(1) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.ViewCount >= 0 AND u.Id = p.OwnerUserId AND u.Id = b.UserId AND p.Id = c.PostId AND p.Score <= 192 AND p.Id = ph.PostId AND p.Id = v.PostId
stats
Select Count(*) From postHistory As ph, posts As p, votes As v, badges As b, users As u, comments As c Where p.Id = ph.PostId And p.ViewCount >= 0 And p.Id = v.PostId And p.Score <= 192 And p.Id = c.PostId And u.Id = b.UserId And u.Id = p.OwnerUserId
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 mc.movie_id = mi_idx.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND it.id = mi_id...
job
WITH year_total AS ( SELECT c_customer_id AS customer_id, c_last_name AS customer_last_name, c_birth_country AS customer_birth_country, 's' AS sale_type, c_first_name AS customer_first_name, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_login AS custo...
tpcds
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_phone, c_comment, n_name, c_custkey, c_name, c_acctbal 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(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(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 NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures...
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 mi.info LIKE 'USA:%200%' AND it1.info = 'rating' AND t.id = mi_idx.mov...
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.info = 'bottom 10 rank' AND mc.note NOT LIKE '%(AS Metro-Goldwyn-Mayer Pictures)%' AND...
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_suppkey = l_suppkey AND p_par...
tpch
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 s_suppkey = l_suppkey AND s_nationkey = n_nationkey AND p_par...
tpch
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey AND n_regionkey...
tpch
SELECT 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 t.id = ci.movie_id AND an.name LIKE '%a%' AND an.person_id = ci.person_id AND lt.id = m...
job
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = mk.movie_id AND k.keyword ='character-name-IN-title' AND mk.keyword_id = k.id AND t.id = mk.movie_id AND cn.id = mc.company_id AND mc.movie_id = t.id AND cn.country_code =...
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 s_suppkey = ps_suppkey And ps_supplycost = ( Select Min(ps_supplycost) From partsupp, supplier, nation, region Where p_partkey = ps_partkey And s_suppkey = ps_suppkey And...
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 american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE ct.kind = 'production companies' AND it.id = mi.info_type_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND t.id = mi.movie_id AND it.info = 'bottom 10 ran...
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 mk.keyword_id = k.id And cn.id = mc.company_id And cn.country_code ='[nl]' And mc.movie_id = t.id And t.id = mk.movie_id And k.keyword ='character-name-In-title' And mc.movie_id = mk.mo...
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 t.id = mc.movie_id AND an.person_id = n.id AND mc.company_id = cn.id AND mk.keyword_id = k....
job
SELECT c_preferred_cust_flag, c_salutation, c_first_name, cnt, ss_ticket_number, c_last_name FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE ci.movie_id = mc.movie_id AND t.episode_nr >= 50 AND ci.movie_id = mk.movie_id AND n.id = c...
job
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, votes AS v WHERE p.Score >= -3 AND c.CreationDate >= '2010-08-02 23:52:10'::timestamp AND pl.PostId = v.PostId AND v.VoteTypeId = 2 AND p.Id = c.PostId AND c.PostId = pl.PostId LIMIT 500;
stats
select l_linestatus, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice) as sum_base_price, sum(l_quantity) as sum_qty, avg(l_extendedprice) as avg_price, count(*) as count_order, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, l_returnflag, a...
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 mk.movie_id = mc.movie_id AND ml.mo...
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 n.id = ci.person_id AND t.episode_nr >= 50 AND t.id = mc.movie_id AND an.person_id = ci.per...
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 t.episode_nr < 100 AND cn.country_code = '[us]' AND mc.movie_id = mk.movie_id AND k.keyword...
job
SELECT i_brand AS brand, i_brand_id AS brand_id, i_manufact, i_manufact_id, SUM(ss_ext_sales_price) AS ext_price FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO...
tpcds
SELECT 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 t.id = mi.movie_id AND cn.id = mc.company_id AND t.production_year > 2000...
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 o_orderkey = l_orderkey AND p_name LIKE 1 ) AS profit AND p_p...
tpch
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE k.id = mk.keyword_id AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND t.id = mi.movie_id AND t.production_year > 2005 AND t...
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.kind = 'production companies' AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND...
job
SELECT ca_zip, SUM(cs_sales_price) FROM catalog_sales INNER JOIN customer ON cs_bill_customer_sk = c_customer_sk INNER JOIN customer_address ON c_current_addr_sk = ca_address_sk INNER JOIN date_dim ON cs_sold_date_sk = d_date_sk WHERE (SUBSTR(ca_zip, 1, 5) IN ( '85669', '86197', '88274', '83405', '86475', '85392', '854...
tpcds
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderstatus = 'F' AND o_orderkey = l1.l_orderkey AND s_nationkey = n_nationkey AND s_suppkey = l1.l_suppkey AND n_name = 1 AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) A...
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 it2.info = 'release dates' AND cn.id = mc.compa...
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.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND lt.id = ml.link_type_id AND n.id = pi.person_id AND t.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.role_id = rt.id AND mc.note LIKE '%(Japan)%' AND an1.person_id = n1.id AND mc.note NOT LIKE '%(USA)%' AND ci...
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 <= 95 + 30 AND i_current_price >= 95 AND d_date BETWEEN CAST('2002-01-23' AS DATE) AND (CAST('2002-01-23' AS DATE...
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 ci.movie_id = mc.movie_id AND t.id = mk.movie_id AND mk.keyword_id = k.id AND cn.country_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 t.id = mc.movie_id AND ct.id = mc.company_type_id AND t.id = mi_idx.movie_id AND it.id = mi_idx.info_type_...
job
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND cn.country_code ='[de]' AND cn.id = mc.company_id AND k.keyword ='character-name-IN-title' AND mc.movie_id = mk.movie_id AND mc.movie_id = t.id AND mk.keyword_id ...
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.kind = 'production companies' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi_...
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 o_orderdate < DATE 1 + INTERVAL '1' YEAR AND s_nationkey = n_nationkey AND c_nationkey = s_nationkey AND c_custkey = o_custkey AND r_name = 1 AND o_orderdate >= D...
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 ct.kind = 'production companies' AND t.id = mi_idx.movie_id AND it.info = ...
job
SELECT l_linestatus, AVG(l_discount) AS avg_disc, SUM(l_quantity) AS sum_qty, AVG(l_extendedprice) AS avg_price, COUNT(*) AS count_order, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) A...
tpch
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE mc.company_id = cn.id AND t.id = mc.movie_id AND an.person_id = n.id AND t.id = mk.movie_id...
job
select count(*) from comments as c, posts as p, postHistory as ph, votes as v, users as u where p.AnswerCount >= 0 AND c.UserId = p.OwnerUserId AND u.Id = c.UserId AND p.OwnerUserId = ph.UserId AND ph.UserId = v.UserId AND p.Score <= 13
stats
Select Count(*) From comments As c, posts As p, postHistory As ph, votes As v, users As u Where u.Id = c.UserId And c.UserId = p.OwnerUserId And p.OwnerUserId = ph.UserId And ph.UserId = v.UserId And p.Score <= 13 And p.AnswerCount >= 0 LIMIT 200;
stats
SELECT c_first_name, c_last_name, extended_price, ss_ticket_number, ca_city, list_price, bought_city, 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 k.id = mk.keyword_id AND t.production_year > 2000 AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German']) AND k.keyword LIKE '%sequel%' AND t.id = mi.movie...
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 extended_price, list_price, extended_tax, bought_city, ca_city, c_first_name, c_last_name, 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 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 (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.movie_id = mi.movie_id AND ct.id = mc.company_type_id AND mc.note NOT LIKE '%(...
job
SELECT o_totalprice, SUM(l_quantity), c_custkey, o_orderdate, o_orderkey, c_name FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey HAVING SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey, o_orderkey, o_orderdat...
tpch
SELECT 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 s_nation...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, votes AS v, users AS u WHERE p.ViewCount >= 0 AND p.Score >= 0 AND c.Score = 0 AND u.Id = p.OwnerUserId AND u.Id = c.UserId AND u.Id = v.UserId LIMIT 10;
stats
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE k.id = mk.keyword_id AND t.production_year > 2000 AND t.id = mi.movie_id AND k.keyword LIKE '%sequel%' AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND t...
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 s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND p_partkey = ps_partkey AND p_size = 1 AND p_type LIKE 1 AND s_suppkey = ps_suppkey AND ps_supplycost = ( SELECT MIN(ps_supply...
tpch
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name FROM customer, orders, lineitem, supplier, nation, region WHERE s_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_custkey = o_custkey AND n_regionkey = r_regionkey AND l_orderkey = o_orderkey AND c_nationkey = s_nationkey AND l...
tpch
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 t.id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German']) AND k.id = mk.keyword_id AND mk.movie_id = mi.movie...
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(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 mc.movie_id = mi_idx.movie_id and ct...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderstatus = 'F' AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND o_orderkey = l1.l_orderkey AND s_nationkey = n_nationkey AND l1.l_receiptdate > l1.l_commitdate AND NO...
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 c_custkey = o_custkey AND c_nation...
tpch
SELECT MIN(t.title) AS japanese_anime_movie, MIN(an.name) AS acress_pseudonym 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 rt.role = 'actress' AND mc.note LIKE '%(Japan)%' AND ct.id = ...
job
Select l_orderkey, Sum(l_extendedprice * (1 - l_discount)) As revenue, o_orderdate, o_shippriority From customer, orders, lineitem Where o_orderdate < DATE 1 AND l_orderkey = o_orderkey AND c_mktsegment = 1 AND c_custkey = o_custkey AND l_shipdate > DATE 1 Group By l_orderkey, o_orderdate, o_shippriority Order By reven...
tpch
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 p_partkey = l_partkey AND s_sup...
tpch
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE l1.l_receiptdate > l1.l_commitdate AND s_suppkey = l1.l_suppkey AND n_name = 1 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 ...
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 s_nationkey = n2.n_na...
tpch
SELECT cc_manager AS manager, cc_name AS call_center_name, cc_call_center_id AS call_center, SUM(cr_net_loss) AS returns_loss 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(t.title) as movie_title, min(mi_idx.info) as rating from info_type as it, movie_info_idx as mi_idx, title as t where it.id = mi_idx.info_type_id and mi_idx.info > '7.0' and it.info ='rating' and t.id = mi_idx.movie_id and t.production_year between 2000 and 2010
job
SELECT c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales 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(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 t.production_year >= 2000 AND it.id = mi_idx.info_type_id AND mi_idx.info > '7.0' AND it.info ='rating' AND t.production_year <= 2010 AND t.id = mi_idx.movie_id
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 ct.id = mc.company_type_id AND chn.id = ci.person_role_id AND cn.country_code = '[ru]' AND t.id = ci...
job
WITH _q AS ( 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 custome...
tpcds
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 p.Score <= 40 and b.UserId = u.Id and c.UserId = u.Id and p.Id = ph.PostId and p.Id = c.PostId and pl.LinkTypeId = 1 and p.Id = v.PostId
stats