text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
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 mc.movie_id = t.id and t.id = mk.movie_id and cn.id = mc.company_id and cn.country_code ='[nl]' and k.keyword ='character-name-in-title' and mk.keyword_id ...
job
select i_brand_id as brand_id, i_brand as brand, i_manufact_id, i_manufact, sum(ss_ext_sales_price) as ext_price from date_dim INNER JOIN store_sales on d_date_sk = ss_sold_date_sk INNER JOIN item on ss_item_sk = i_item_sk INNER JOIN customer on ss_customer_sk = c_customer_sk INNER JOIN customer_address on c_current_ad...
tpcds
select count(*) from posts as p, postLinks as pl, users as u where p.CommentCount <= 17 and p.OwnerUserId = u.Id and u.CreationDate <= '2014-09-12 07:12:16'::timestamp and p.Id = pl.PostId limit 500;
stats
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 ps_suppkey = l_suppkey AND s_su...
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 rt.role = 'actress' AND mc.company_id = cn.id AND an1.person_id = ci.person_id AND mc.note not like '%(USA)%' A...
job
SELECT i_item_id, i_item_desc, AVG(sr_return_quantity) AS store_returns_quantityave, s_state, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, COUNT(cs_quantity) AS catalog_sales_quantitycount, COUNT(sr_return_quantity) AS store_returns_quantitycount, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalo...
tpcds
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_custkey, c_comment, c_acctbal, c_phone, c_name, 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(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 = mi_idx.movie_id AND ct.kind = 'production companies' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer...
job
SELECT AVG(ss_sales_price) AS agg4, AVG(ss_list_price) AS agg2, i_item_id, AVG(ss_coupon_amt) AS agg3, AVG(ss_quantity) AS agg1 FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo...
tpcds
select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate < DATE 1 + INTERVAL '1' YEAR AND l_shipdate >= DATE 1 AND l_discount BETWEEN 1 - 0.01 AND 1 + 0.01 AND l_quantity < 1 limit 1000;
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 t.id = mi.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND mc.movie_id = mi.movie_id AND ct.id = mc.company_type_id AND ct.kind = 'production companies' AND it...
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_suppkey = ps_suppkey AND r_name = 1 AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND p_type LIKE 1 AND p_size = 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM p...
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = v.PostId AND c.Score = 0 AND p.Id = c.PostId AND p.Id = pl.PostId AND p.Id = ph.PostId AND pl.LinkTypeId = 1 AND p.FavoriteCount >= 0 LIMIT 10;
stats
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 cn.country_code = '[us]' AND t.id =...
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 = mc.movie_id AND k.keyword = 'anime' AND cn.country_cod...
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 at.movie_id = mi_idx.movie_id AND at.title Like '%Champion%' AND t.id ...
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 mi_idx.info > '7.0' AND it.info ='rating' AND t.production_year BETWEEN 2000 AND 2010 AND it.id = mi_idx.info_type_id AND t.id = mi_idx.movie_id LIMIT 100;
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 ='[nl]' And mc.movie_id = mk.movie_id And k.keyword ='character-name-In-title' And mc.movie_id = t.id And cn.id = mc.company_id And mk.keyword_id ...
job
SELECT MIN(n.name) AS actor_name, MIN(k.keyword) AS movie_keyword, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = ci.movie_id AND k.keyword = 'marvel-cinematic-universe' AND t.id = mk.movie_id AND n.name LIKE '%Hemsworth%Chris%' AND ci.movie_id =...
job
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE...
job
SELECT SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_extendedprice) AS avg_price, SUM(l_quantity) AS sum_qty, l_linestatus, AVG(l_quantity) AS avg_qty, AVG(l_discount) AS avg_disc, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_returnflag, SUM(l_extend...
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 p.AnswerCount >= 0 AND u.Id = c.UserId AND p.Score <= 13 AND p.OwnerUserId = ph.UserId AND ph.UserId = v.UserId
stats
SELECT MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year, MIN(mc.note) AS production_note FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE ct.id = mc.company_type_id AND ct.kind = 'production companies' AND mc.movie_id = mi_idx.movie_id AND t.id...
job
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.Score <= 192 AND u.Id = p.OwnerUserId AND p.Id = c.PostId AND p.Id = v.PostId AND p.ViewCount >= 0 AND p.Id = ph.PostId AND u.Id = b.UserId LIMIT 100;
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.keyword LIKE '%sequel%' AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND t.production_year > 2010...
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(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.id = mk.movie_id AND t.production_year > 2005 AND mk.movie_id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German...
job
WITH _q AS ( SELECT i_item_id, i_item_desc, s_store_id, s_store_name, SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_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_n...
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_shipdate < l_commitdate AND l_shipmode in ...
tpch
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE ct.kind = 'production companies' AND it.id = mi_idx.info_type_id AND (mc.note LIKE '%(co-production)%' OR ...
job
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND s_suppkey = l1.l_suppkey AND n_name = 1 AND o_orderstatus = 'F' AND o_orderkey = l1...
tpch
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where 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 mc.movie_id = mk.movie_id AND cn.country_code ='[nl]' AND cn.id = mc.comp...
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 lt.link = 'features' AND ml.linked_movie_id = t.id AND lt.id = ml.link_type_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 (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND lt.link = 'features' AND an.person_id = ci.person_id 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 mc.note LIKE '%(USA)%' AND mi.movie_id = mc.movie_id AND t.id = mc.movie_...
job
SELECT SUM(ss_ext_sales_price) AS ext_price, i_manufact_id, i_manufact, i_brand_id AS brand_id, 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 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_type LIKE 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey ...
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 c_nationkey = s_nationkey AND r_name = 1 AND l_suppkey = s_suppkey AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND o_orderdate < DATE 1 + INTERVAL '...
tpch
SELECT SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, COUNT(*) AS count_order, AVG(l_discount) AS avg_disc, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_returnflag, l_linestatus, SUM(l_quantity) AS sum_qty, AVG(l_extendedprice) AS avg_price, SUM(l_extend...
tpch
SELECT STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, s_state, AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, i_item_id, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, AVG(sr_return_quantity) AS store_retur...
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 n1.n_regionkey = r_re...
tpch
Select i_item_id, Avg(ss_quantity) As agg1, Avg(ss_list_price) As agg2, Avg(ss_coupon_amt) As agg3, Avg(ss_sales_price) As agg4 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 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 p_partkey = l_partkey AND s_nation...
tpch
Select Count(1) From comments As c, posts As p, postLinks As pl, votes As v Where c.PostId = pl.PostId And v.VoteTypeId = 2 And p.Score >= -3 And p.Id = c.PostId And pl.PostId = v.PostId And c.CreationDate >= '2010-08-02 23:52:10'::timestamp
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 k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_id AND t.id = ci.movie_id AND n.name LIKE '%Downey%Robert%' AND k.id = mk.keyw...
job
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_commitdate < l_receiptdate AND l_shipdate ...
tpch
with year_total as ( select sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) as year_total, c_birth_country as customer_birth_country, c_customer_id as customer_id, c_email_address as customer_email_address, 's' as sale_type, d_year as dyear, c_last_name as customer_last...
tpcds
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, badges as b where c.Score = 0 AND p.Id = ph.PostId AND p.Id = pl.RelatedPostId AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND b.UserId = c.UserId
stats
SELECT c_preferred_cust_flag, cnt, c_last_name, ss_ticket_number, c_first_name, c_salutation 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 l_returnflag, AVG(l_quantity) AS avg_qty, COUNT(*) AS count_order, AVG(l_discount) AS avg_disc, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice) AS sum_base_price, SUM(l_quantity) AS sum_qty, AVG(l_extendedprice) AS avg_price, l_linestatus, SUM(l_extendedprice * (1 - l_di...
tpch
SELECT list_price, c_last_name, c_first_name, extended_price, ca_city, bought_city, extended_tax, ss_ticket_number FROM ( SELECT ss_ticket_number, ss_customer_sk, ca_city AS bought_city, SUM(ss_ext_sales_price) AS extended_price, SUM(ss_ext_list_price) AS list_price, SUM(ss_ext_tax) AS extended_tax FROM store_sales JOI...
tpcds
SELECT 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.id = mc.company_type_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)%...
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 an.person_id = n.id AND mk.keyword_id = k.id AND an.person_id = ci.person_id AND t.id = mk....
job
WITH _q AS ( SELECT supp_nation, cust_nation, SUM(volume) AS revenue, l_year 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...
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 cn.id = mc.company_id AND t.id = ml...
job
SELECT COUNT(ss_quantity) AS store_sales_quantitycount, AVG(cs_quantity) AS catalog_sales_quantityave, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, s_state, i_item_id, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, STDDEV_SAMP(cs_quantity) / AVG(cs_qua...
tpcds
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v where p.Id = pl.PostId and p.FavoriteCount >= 0 and p.Id = ph.PostId and p.Id = v.PostId and c.Score = 0 and p.Id = c.PostId and pl.LinkTypeId = 1
stats
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE t.production_year > 2000 AND it1.id = mi_idx.info_type_id AND t.id = a...
job
select i_brand_id as brand_id, i_brand as brand, 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 where d_year = 2000 and i_manager_id = 97 and d_moy = 11 group by i_brand, i_brand_id order by ext_price desc, brand_id;
tpcds
SELECT AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost), AVG(ss_ext_sales_price), AVG(ss_quantity) 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 min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where k.keyword like '%sequel%' and mi.info in ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') and t.id = mi.movie_id and mk.movie_id = mi.movie_id and t.id = mk.movie_id and k....
job
SELECT COUNT(1) FROM comments AS c, postHistory AS ph, badges AS b, votes AS v, users AS u WHERE ph.PostHistoryTypeId = 12 AND ph.UserId = v.UserId AND b.UserId = ph.UserId AND v.UserId = c.UserId AND u.UpVotes = 0 AND u.Id = b.UserId
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.movie_id = t.id AND n1.name LIKE '%Yo%' AND ci.note = '(voice: English version)' AND rt.role = 'actress' AND...
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 t.production_year BETWEEN 1980 AND 1995 AND ci.person_id = n.id AND pi.person_id = an.person_...
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 t.production_year > 2000 AND mi_idx.info < '...
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 MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE t.production_year > 1950 AND mi.mov...
job
select cc_call_center_id as call_center, cc_name as call_center_name, cc_manager as manager, 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 Sum(l_extendedprice * l_discount) As revenue From lineitem Where l_shipdate >= DATE 1 And l_quantity < 1 And l_discount Between 1 - 0.01 And 1 + 0.01 And l_shipdate < DATE 1 + INTERVAL '1' YEAR Limit 500;
tpch
select COUNT(1) 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 200;
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 t.id = mc.movie_id AND mc.movie_id = mi_idx.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictur...
job
WITH year_total AS ( SELECT c_login AS customer_login, c_preferred_cust_flag AS customer_preferred_cust_flag, 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_first_name AS customer_first_name, 's' AS sale_type,...
tpcds
SELECT c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT MAX(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE ct.id = mc.company_type_id AND t.id = mi.movie_id AND ct.kind = 'production companies' AND it.id = mi.info_type_id AND it.info = 'bottom 10 rank' AND t.id = mc.movie_id AND (mc.note ...
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 ci.movie_id = mk.movie_id AND t.id = mk.movie_id AND t.production_year > 2010 AND n.id = ci.person_id AND t.id = ci.movie_id AND k.id = mk....
job
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mi.movie_id AND t.id = mk.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.production_year > 2000 AND mk.movie_id = mi.movie_id AND k.k...
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 it.info = 'rating' AN...
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 t.id = ci.movie_id AND it.info = 'mini biography' AND an.name LIKE '%a%' AND n.name_pcode_cf ...
job
SELECT s_store_id, i_item_desc, MAX(sr_net_loss) AS store_returns_loss, MAX(ss_net_profit) AS store_sales_profit, MAX(cs_net_profit) AS catalog_sales_profit, i_item_id, s_store_name 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 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 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.person_id = an.person_id AND n.gender = 'f' AND n.id = ci.person_id AN...
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 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 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 at.movie_id = mc.movie_id AND it2.id = mi.info_type_id AND mi_idx.movi...
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 s_nationkey = n_nationkey and o_orderkey = l_orderkey and s_s...
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 ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND t.id = ci.movie_id AND t.id = mk.movie_id AND t.production_year > 2010 AND n.name LI...
job
select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where r_name = 1 and o_orderdate < DATE 1 + INTERVAL '1' YEAR and n_regionkey = r_regionkey and c_nationkey = s_nationkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and o_orderdate >= D...
tpch
SELECT COUNT(*) AS count_order, SUM(l_extendedprice) AS sum_base_price, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_discount) AS avg_disc, AVG(l_quantity) AS avg_qty, AVG(l_extendedprice) AS avg_price, l_linestatus, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, l_returnflag, ...
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 mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND mk.keyword_id = k.id AND cn.id = mc.company_id AND t.id = mk.mo...
job
SELECT p_brand, p_type, p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_type NOT LIKE 1 AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_brand <> 1 AND p_partkey = ps_partkey GROUP BY p_brand...
tpch
SELECT s_store_name, i_item_id, MAX(sr_net_loss) AS store_returns_loss, s_store_id, MAX(cs_net_profit) AS catalog_sales_profit, MAX(ss_net_profit) AS store_sales_profit, i_item_desc 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 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.id = mk.keyword_id AND t.id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND t.produ...
job
SELECT i_item_id, i_item_desc, i_current_price FROM item INNER JOIN inventory ON i_item_sk = inv_item_sk INNER JOIN date_dim ON d_date_sk = inv_date_sk INNER JOIN catalog_sales ON cs_item_sk = i_item_sk WHERE d_date BETWEEN CAST('2001-07-13' AS DATE) AND (CAST('2001-07-13' AS DATE) + INTERVAL '60 days') AND i_manufact_...
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 mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.production_year > 2010 AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND t....
job
SELECT p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_brand, p_type FROM partsupp, part WHERE p_brand <> 1 AND p_type NOT LIKE 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_partkey = ps_partkey AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) GROUP BY p_brand...
tpch
WITH _q AS ( SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, o_shippriority FROM customer, orders, lineitem WHERE o_orderdate < DATE 1 AND l_shipdate > DATE 1 AND c_custkey = o_custkey AND c_mktsegment = 1 AND l_orderkey = o_orderkey GROUP BY l_orderkey, o_orderdate, o_shippriority O...
tpch
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 at.movie_id = mi_idx.movie_id AND mi_idx.movie_id = mc.movie_id AND it...
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 cn.country_code = '[us]' AND mi.inf...
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 at.title LIKE '%Champion%' AND it1.info = 'rating' AND mi_idx.movie_id...
job