text
stringlengths
84
1.49k
benchmark
stringclasses
4 values
SELECT SUM(amount) AS sum_profit, o_year, nation 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 s_suppkey = l_suppkey AND p_nam...
tpch
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND l_suppkey = s_suppkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND n_regionkey = r_regionkey AND c_nationkey = s_nationkey AND r_nam...
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(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 = ci.movie_id AND k.id = mk.keyword_id AND t.id = mk.movie_id AND n.id = ci.person_id AND k.keyword = 'm...
job
SELECT p_type, p_brand, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_size FROM partsupp, part WHERE p_partkey = ps_partkey AND p_brand <> 1 AND p_type NOT LIKE 1 AND p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) GROUP B...
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 it.info ='rating' AND t.production_year >= 2000 AND mi_idx.info > '8.0' AND it.id = mi_idx.info_type_id AND t.id = mi_idx.movie_id AND t.production_year <= 2005
job
select avg(ss_quantity), avg(ss_ext_sales_price), avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost) from store_sales join store on s_store_sk = ss_store_sk join customer_demographics on cd_demo_sk = ss_cdemo_sk join household_demographics on hd_demo_sk = ss_hdemo_sk join customer_address on ca_address_sk = ss_addr...
tpcds
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') And k.id = mk.keyword_id And k.keyword Like '%sequel%' And t.id = mk.movie_id And mk.movie_id = mi.movie_id And ...
job
Select Count(*) From comments As c, posts As p, users As u Where p.FavoriteCount >= 0 And c.CreationDate >= '2010-08-05 00:36:02'::timestamp And u.Id = p.OwnerUserId And p.ViewCount >= 0 And c.UserId = u.Id And p.CommentCount >= 0
stats
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, users as u where p.Id = v.PostId AND u.Id = p.OwnerUserId AND p.PostTypeId = 1 AND p.Id = c.PostId AND p.AnswerCount >= 0 AND p.Id = pl.PostId AND p.Id = ph.PostId
stats
SELECT s_store_id, MAX(sr_net_loss) AS store_returns_loss, MAX(cs_net_profit) AS catalog_sales_profit, i_item_desc, i_item_id, MAX(ss_net_profit) AS store_sales_profit, s_store_name FROM store_sales INNER JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_...
tpcds
select min(t.title) as russian_movie, min(chn.name) as uncredited_voiced_character from char_name as chn, cast_info as ci, company_name as cn, company_type as ct, movie_companies as mc, role_type as rt, title as t where t.id = ci.movie_id AND ci.note like '%(uncredited)%' AND ct.id = mc.company_type_id AND chn.id = ci....
job
SELECT c_preferred_cust_flag, cnt, c_last_name, c_salutation, c_first_name, ss_ticket_number FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(1) 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 SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, COUNT(*) AS count_order, SUM(l_extendedprice) AS sum_base_price, l_returnflag, AVG(l_extendedprice) AS avg_price, AVG(l_quantity) AS avg_qty, SUM(l_quantity) AS sum_qty, AVG(l_discount) AS avg_disc, l_linestatus, SUM(l_extendedprice * (1 - l_discount) * ...
tpch
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE t.id = ci.movie_id AND t.id = mc.movie_id AND t.production_year > 2005 AND rt.role = 'actor' AND chn...
job
SELECT MIN(t.title) AS western_sequel, MIN(cn.name) AS from_company, MIN(lt.link) AS link_type 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 lt.link LIKE '%follow%' AND t.id = ...
job
Select Min(mi.info) As release_date, Min(miidx.info) As rating, Min(t.title) As german_movie From company_name As cn, company_type As ct, info_type As it, info_type As it2, kind_type As kt, movie_companies As mc, movie_info As mi, movie_info_idx As miidx, title As t Where it.id = miidx.info_type_id And miidx.movie_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 it.info ='rating' AND mi_idx.info > '7.0' AND it.id = mi_idx.info_type_id AND t.id = mi_idx.movie_id AND t.production_year >= 2000 AND t.production_year <= 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 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 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 s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_suppkey = l1.l_suppkey AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND s_nationkey = n_nationkey AND o_orderkey = l1.l_orderk...
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 n.id = ci.person_id AND mk.keyword_id = k.id AND ci.movie_id = mk.movie_id AND k.keyword = ...
job
SELECT s_store_name, i_item_desc, SUM(cs_quantity) AS catalog_sales_quantity, SUM(ss_quantity) AS store_sales_quantity, s_store_id, SUM(sr_return_quantity) AS store_returns_quantity, i_item_id 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 SUM(l_extendedprice) AS sum_base_price, l_returnflag, l_linestatus, AVG(l_extendedprice) AS avg_price, AVG(l_discount) AS avg_disc, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_quantity) AS sum_qt...
tpch
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 at.title LIKE '%Champion%' AND mi_idx.movie_id = mc.movie_id AND t.id ...
job
WITH _q AS ( 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 > 2005 AND k.id = mk.keyword_id AND t.id = mi.movie_id AND k.keyword LIKE '%sequel%' AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'G...
job
SELECT MAX(mi_idx.info) AS rating, MAX(t.title) AS movie_title FROM info_type AS it, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi_idx.movie_id AND it.info ='rating' AND mi_idx.info > '7.0' AND t.production_year BETWEEN 2000 AND 2010 AND it.id = mi_idx.info_type_id
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 c_nationkey = n2.n_nationkey AND (...
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.keyword LIKE '%sequel%' AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND t.id = mi.movie_id AND k.id = mk.keyword_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danis...
job
SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales INNER JOIN store ON s_store_sk = ss_store_sk INNER JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk INNER JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk INNER JOIN customer_address ON...
tpcds
SELECT s_store_id, i_item_id, SUM(cs_quantity) AS catalog_sales_quantity, SUM(ss_quantity) AS store_sales_quantity, s_store_name, SUM(sr_return_quantity) AS store_returns_quantity, i_item_desc 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 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 an.name LIKE '%a%' AND it.id = pi.info_type_id AND ci.person_id = n.id AND n.id = pi.person_id AND lt.id = ml.link_typ...
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 k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND t.id = ci.movie_id AND n.name LIKE '%Hem...
job
SELECT i_item_id, i_current_price, i_item_desc 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 inv_quantity_on_hand BETWEEN 100 AND 500 AND d_date BETWEEN CAST('2000-05-01' AS DATE) AND (CAST('2000-05-01' A...
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 it.id = mi.info_type_id AND ci.note IN ('(voice)', '(voice: Japanese vers...
job
SELECT item.i_brand AS brand, SUM(ss_ext_sales_price) AS ext_price, item.i_brand_id AS brand_id, dt.d_year FROM date_dim AS dt JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE item.i_manager_id = 11 AND dt.d_moy = 12 AND dt.d_year = 2001 GROUP BY ...
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 n.gender = 'f' AND mc.note LIKE '%(USA)%' AND t.id = ci.movie_id AND an.p...
job
Select c_custkey, c_name, Sum(l_extendedprice * (1 - l_discount)) As revenue, c_acctbal, n_name, c_address, c_phone, c_comment From customer, orders, lineitem, nation Where o_orderdate >= DATE 1 And o_orderdate < DATE 1 + INTERVAL '3' MONTH And c_custkey = o_custkey And c_nationkey = n_nationkey And l_orderkey = o_orde...
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.id = mc.company_id AND t.id = mk.movie_id AND k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND mc.movie_id = t.id AND cn.country_code ='[de]' AND mc.movie_id = mk.mo...
job
SELECT MIN(t.title) AS japanese_movie_dubbed, MIN(an1.name) AS actress_pseudonym 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 an1.person_id = ci.person_id AND ci.note = '(voice: English version)' AND ci.movie_id = t.id AND rt.role = 'act...
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 = ci.movie_id AND k.id = mk.keyword_id AND n.name LIKE '%Downey%Robert%' AND t.production_year > 2010 AN...
job
SELECT ss_ticket_number, c_last_name, c_preferred_cust_flag, cnt, 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 MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE kt.id = t.kind_id AND mi.movie_id = miidx.movie...
job
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(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 n.id = ci.person_id AND mc.movie_id = mk.movie_id AND k.keyword = 'c...
job
SELECT MAX(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND k.keyword LIKE '%sequel%' AND mk.movie_id = mi.movie_id AND t.id = mk.movie_id AND t.id = mi.movie_id AND k....
job
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE mk.movie_id = mi.movie_id AND t.id = mk.movie_id AND k.keyword LIKE '%sequel%' AND t.production_year > 2010 AND k.id = mk.keyword_id AND t.id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany',...
job
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 k.id = mk.keyword_id AND t.production_year > 2005 AND mk.movie_id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', ...
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 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.movie_id = mk.movie_id AND an.person_id = ci.person_id AND t.id = mc.movie_id AND ci.mov...
job
SELECT MAX(an.name) AS acress_pseudonym, MAX(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 cn.country_code = '[jp]' AND an....
job
select min(t.title) as movie_title from company_name as cn, keyword as k, movie_companies as mc, movie_keyword as mk, title as t where mc.movie_id = t.id AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND t.id = mk.movie_id AND mk.keyword_id = k.id AND cn.id = mc.comp...
job
Select Avg(ss_quantity) As agg1, Avg(ss_coupon_amt) As agg3, Avg(ss_sales_price) As agg4, i_item_id, Avg(ss_list_price) As agg2 From store_sales Inner Join customer_demographics On ss_cdemo_sk = cd_demo_sk Inner Join date_dim On ss_sold_date_sk = d_date_sk Inner Join item On ss_item_sk = i_item_sk Inner Join promotion ...
tpcds
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 ci.note LIKE '%(voice)%' AND ci.note LIKE '%(uncredited)%' AND chn.id = ci.person_role_id AND rt.rol...
job
SELECT c_custkey, c_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_acctbal, n_name, c_address, c_phone, c_comment FROM customer, orders, lineitem, nation WHERE l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND c_custkey = o_custkey AND c_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '3' M...
tpch
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_nationkey = n_nationkey AND o_orderstatus = 'F' AND s_suppkey = l1.l_suppkey 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 WHER...
tpch
Select i_item_id, i_item_desc, s_store_id, s_store_name, Max(ss_net_profit) As store_sales_profit, Max(sr_net_loss) As store_returns_loss, Max(cs_net_profit) As catalog_sales_profit From store_sales Join store_returns On store_sales.ss_customer_sk = store_returns.sr_customer_sk And store_sales.ss_item_sk = store_return...
tpcds
Select 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 ps_suppkey = l_suppkey AND s_su...
tpch
SELECT p_brand, p_size, p_type, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_partkey = ps_partkey AND p_brand <> 1 AND p_type NOT LIKE 1 AND p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) GROUP B...
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 t.production_year > 2010 AND k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND t.id = mk.m...
job
WITH _q AS ( 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.id = mk.keyword_id AND t.production_year > 2010 AND ci.movie_id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND k.keywor...
job
WITH year_total AS ( SELECT c_preferred_cust_flag AS customer_preferred_cust_flag, c_birth_country AS customer_birth_country, 's' AS sale_type, c_email_address AS customer_email_address, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, d_year AS dyear, c_f...
tpcds
SELECT ss_ticket_number, c_salutation, c_last_name, c_preferred_cust_flag, c_first_name, 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 cnt, ss_ticket_number, c_preferred_cust_flag, c_salutation, c_first_name, 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(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 pi.note = 'Volker Boehm' AND ci.movie_id = ml.linked_movie_id AND n.id = an.person_id AND pi.person_id = an.person_id ...
job
SELECT s_phone, total_revenue, s_name, s_address, s_suppkey FROM supplier, revenue0 WHERE s_suppkey = supplier_no AND total_revenue = ( SELECT MAX(total_revenue) FROM revenue0 ) ORDER BY s_suppkey LIMIT 20;
tpch
SELECT COUNT(*) FROM comments AS c, posts AS p, users AS u WHERE c.UserId = u.Id AND c.CreationDate >= '2010-08-05 00:36:02'::timestamp AND p.CommentCount >= 0 AND p.ViewCount >= 0 AND u.Id = p.OwnerUserId AND p.FavoriteCount >= 0 LIMIT 1000;
stats
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 mi.movie_id = ci.movie_id AND t.production_year > 2000 AND t.id = mi.movi...
job
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.OwnerUserId = ph.UserId AND u.Id = c.UserId AND p.AnswerCount >= 0 AND ph.UserId = v.UserId AND p.Score <= 13
stats
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue FROM ( SELECT n1.n_name AS supp_nation, n2.n_name AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, l_extendedprice * (1 - l_discount) AS volume FROM supplier, lineitem, orders, customer, nation n1, nation n2 WHERE o_orderkey = l_orderkey AND c_nati...
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 (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.movie_id = mi.movie_id AND it.id = mi.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'...
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 JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT MIN(t.title) AS 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 LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.id = mi.info_type_id AND mc.movie_id = mi.movie_id AND ct.kind = 'production companies...
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 Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, users As u Where p.PostTypeId = 1 And p.AnswerCount >= 0 And p.Id = pl.PostId And p.Id = c.PostId And u.Id = p.OwnerUserId And p.Id = v.PostId And p.Id = ph.PostId
stats
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND n.name LIKE '%Hemsworth%Chris%' AND ci.movie_id = mk.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 = mk.movie_id AND k.id = mk.keyword_id AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe...
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.id = mi_idx.info_type_id AND t.id = mc.movie_id AND it.info = 'top 250 r...
job
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_number = sr_ti...
tpcds
SELECT i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price, i_manufact_id, i_manufact, i_brand AS brand FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO...
tpcds
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.production_year > 2010 AND k.keyword LIKE '%sequel%' AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND mk.movie_id = mi.movie_id AND t.id = mi.movie_id A...
job
WITH year_total AS ( SELECT c_login AS customer_login, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, 's' AS sale_type, c_email_address AS customer_email_address, c_last_name AS customer_last_name, c_preferred_cust_flag AS customer_preferred_cust_flag, c...
tpcds
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, users as u where p.PostTypeId = 1 and p.AnswerCount >= 0 and u.Id = p.OwnerUserId and p.Id = ph.PostId and p.Id = v.PostId and p.Id = c.PostId and p.Id = pl.PostId
stats
SELECT SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, l_shipmode, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count FROM orders, lineitem WHERE l_commitdate < l_receiptdate AND l_shipmode ...
tpch
SELECT c_last_name, cnt, c_first_name, c_preferred_cust_flag, c_salutation, ss_ticket_number FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = t.id AND cn.country_code ='[de]' AND k.keyword ='character-name-in-title' AND t.id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id 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 n.name_pcode_cf BETWEEN 'A' AND 'F' AND pi.person_id = ci.person_id AND it.id = pi.info_type_id AND pi.person_id = an....
job
SELECT AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, i_item_id, AVG(ss_sales_price) AS agg4, 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 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 it.info = 'top 250 rank' AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%'...
job
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE ct.kind = 'production companies' AND cn.id = mc...
job
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.Score <= 13 and ph.UserId = v.UserId and p.AnswerCount >= 0 and p.OwnerUserId = ph.UserId
stats
SELECT 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, l_shipmode FROM orders, lineitem WHERE l_shipmode IN (1, 1) AND l_shipdate < l_comm...
tpch
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 NOT EXISTS (SELECT 1 FROM (SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%') AS _ne WHERE _ne.ps_suppkey = ps_suppkey) AND p_type NOT LIKE 1 AND p_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 k.id = mk.keyword_id AND n.id = ci.person_id AND k.keyword = 'marvel-cinematic-universe' AND t.id = ci.movie_id AND n.name LIKE '%Hemsworth...
job
SELECT cnt, c_last_name, c_salutation, c_preferred_cust_flag, c_first_name, ss_ticket_number FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ...
tpcds
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = c.PostId AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND p.Id = pl.PostId AND p.Id = v.PostId AND c.Score = 0 AND p.FavoriteCount >= 0 LIMIT 100;
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 ci.movie_id = mk.movie_id AND t.production_year > 2010 AND n.name LIKE '%Hemsworth%Chris%' AND n.id = ci.person_id AND t.id = ci.movie_id A...
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 t.production_year > 2010 AND k.id = mk.keyword_id AND t.id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe'...
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.id = ml.link_type_id AND lt.link = 'features' AND ci.movie_id = ml.linked_movie_id AND t.id = ci.movie_id AND pi.pe...
job
SELECT MIN(lt.link) AS link_type, MIN(cn.name) AS from_company, 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 k.keyword IN ('sequel', 'revenge', ...
job