text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
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 t.id = ci.movie_id AND it.id = pi.info_type_id AND ci.movie_id = ml.linked_movie_id AND n... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE mc.movie_id = mi_idx.movie_id AND ct.id = mc.company_type_id AND it.id = mi_idx.info_type_id AND mc.note N... | job |
SELECT s_store_id, MAX(cs_net_profit) AS catalog_sales_profit, i_item_desc, MAX(sr_net_loss) AS store_returns_loss, i_item_id, s_store_name, MAX(ss_net_profit) AS store_sales_profit FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return... | tpcds |
select bought_city, c_first_name, ca_city, c_last_name, list_price, ss_ticket_number, extended_price, 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 cnt, ss_ticket_number, c_salutation, c_first_name, c_preferred_cust_flag, 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 avg(cs_list_price) as agg2, avg(cs_coupon_amt) as agg3, i_item_id, avg(cs_sales_price) as agg4, avg(cs_quantity) as agg1 from catalog_sales join customer_demographics on cs_bill_cdemo_sk = cd_demo_sk join date_dim on cs_sold_date_sk = d_date_sk join item on cs_item_sk = i_item_sk join promotion on cs_promo_sk = ... | tpcds |
SELECT 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(n.name) AS actor_name, MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = mk.movie_id AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND t.id = ci.movie_i... | job |
SELECT MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel, MIN(cn.name) AS from_company 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.id = mc.movie_id AND mc.note NOT ... | 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 n.name Like '%Downey%Robert%' And t.id = ci.movie_id And ci.movie_id = mk.movie_id And n.id = ci.person_id And t.production_year > 2010 And... | job |
SELECT SUM(amount) AS sum_profit, nation, o_year FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE p_partkey = l_partkey AND o_orderkey = l_orderkey AND ps_supp... | tpch |
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE t.id = ci.movie_id AND cn.country_code = '[jp]' AND an.person... | 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 ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND t.id = ci.movie_i... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.note NOT LIKE '%(AS Metro-Goldwyn... | job |
SELECT SUM(ss_ext_sales_price) AS sum_agg, item.i_brand AS brand, dt.d_year, item.i_brand_id AS brand_id FROM date_dim AS dt JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE item.i_manufact_id = 691 AND dt.d_moy = 12 GROUP BY dt.d_year, item.i_bra... | tpcds |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = v.PostId AND p.FavoriteCount >= 0 AND p.Id = ph.PostId AND c.Score = 0 AND p.Id = pl.PostId AND pl.LinkTypeId = 1 AND p.Id = c.PostId | stats |
SELECT dt.d_year, item.i_brand AS brand, SUM(ss_ext_sales_price) AS ext_price, item.i_brand_id AS brand_id FROM date_dim AS dt JOIN store_sales ON dt.d_date_sk = store_sales.ss_sold_date_sk JOIN item ON store_sales.ss_item_sk = item.i_item_sk WHERE item.i_manager_id = 95 AND dt.d_year = 1999 AND dt.d_moy = 12 GROUP BY ... | tpcds |
select c_count, COUNT(1) as custdist from ( select c_custkey, count(o_orderkey) as c_count from customer LEFT INNER 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 | tpch |
SELECT cc_manager AS manager, cc_call_center_id AS call_center, cc_name AS call_center_name, SUM(cr_net_loss) AS returns_loss FROM call_center INNER JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk INNER JOIN date_dim ON cr_returned_date_sk = d_date_sk INNER JOIN customer ON cr_returning_customer_sk = c_cu... | tpcds |
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND mk.keyword_id = k.id AND mc.movie_id = t.id AND k.keyword ='character-name-in-title' AND cn.country_code ='[de]' AND t.id = mk.mo... | job |
Select Avg(ss_coupon_amt) As agg3, i_item_id, Avg(ss_quantity) As agg1, Avg(ss_sales_price) As agg4, Avg(ss_list_price) As agg2 From store_sales Join customer_demographics On ss_cdemo_sk = cd_demo_sk Join date_dim On ss_sold_date_sk = d_date_sk Join item On ss_item_sk = i_item_sk Join promotion On ss_promo_sk = p_promo... | tpcds |
SELECT p_brand, p_type, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_size FROM partsupp, part WHERE p_type NOT LIKE 1 AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_partkey = ps_partkey AND p_brand <> 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) GROUP BY p_brand... | tpch |
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, badges as b where p.Id = c.PostId and p.Id = ph.PostId and c.Score = 0 and pl.LinkTypeId = 1 and p.Id = v.PostId and p.Id = pl.RelatedPostId and b.UserId = c.UserId | 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 t.id = mk.movie_id AND mk.movie_id ... | job |
SELECT MIN(t.title) AS western_sequel, MIN(lt.link) AS link_type, MIN(cn.name) AS from_company 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 k.id ... | job |
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, badges As b Where p.Id = c.PostId AND c.Score = 0 AND p.Id = pl.RelatedPostId AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND p.Id = v.PostId AND b.UserId = c.UserId | stats |
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(*) FROM comments AS c, postHistory AS ph, votes AS v, users AS u WHERE u.DownVotes >= 0 AND ph.UserId = c.UserId AND u.UpVotes <= 123 AND v.UserId = ph.UserId AND u.Id = v.UserId AND u.Views >= 0 | stats |
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 c_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AND l_orderkey = o_orderke... | tpch |
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 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 p_partkey, s_address, s_phone, s_acctbal, n_name, p_mfgr, s_name, s_comment FROM part, supplier, partsupp, nation, region WHERE s_suppkey = ps_suppkey AND p_partkey = ps_partkey AND r_name = 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND... | tpch |
with year_total as ( select 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_last_name as customer_last_name, c_customer_id as customer_id, 's' as sale_type, c_birth_country as customer_birth_country, c_preferred_cust... | 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 n.id = pi.person_id AND (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND ci.person... | job |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_nationkey = s_nationkey AND o_orderdate >= DATE 1 AND r_name = 1 AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND s_nationkey = n_nationkey AND l_orderkey = o_orderkey AND c_custkey = o_cu... | 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.id = mi.info_type_id AND it2.info = 'releas... | 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 it2.info = 'release dates' AND kt.kind = 'movie' AND cn.id = mc.compan... | job |
Select Min(n.name) As voicing_actress, Min(t.title) As voiced_movie From aka_name As an, char_name As chn, cast_info As ci, company_name As cn, info_type As it, movie_companies As mc, movie_info As mi, name As n, role_type As rt, title As t Where ci.movie_id = mc.movie_id AND rt.role = 'actress' AND t.production_year >... | job |
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 inner join store_returns on store_sales.ss_customer_sk = store_returns.sr_customer_sk and store_sales.ss_item_sk = store_... | tpcds |
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 l_orderkey = o_orderkey AND c_custkey = o_custkey AND c_nationkey = s_nationkey AND s_nationkey = n_nationkey AND o_orderdate >= D... | tpch |
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS movie_title FROM info_type AS it, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi_idx.movie_id AND mi_idx.info > '7.0' AND it.info ='rating' AND t.production_year >= 2000 AND it.id = mi_idx.info_type_id AND t.production_year <= 2010 | job |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE l_suppkey = s_suppkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND s_nationkey = n_nationkey AND c_nationkey = s_nationkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND r_nam... | tpch |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE r_name = 1 AND s_nationkey = n_nationkey AND o_orderdate >= DATE 1 AND l_suppkey = s_suppkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND n_regionkey = r_regionkey AND c_custkey = o_cust... | tpch |
SELECT cntrycode, COUNT(1) AS numcust, SUM(c_acctbal) AS totacctbal FROM ( SELECT SUBSTRING(c_phone FROM 1 FOR 2) AS cntrycode, c_acctbal FROM customer WHERE NOT EXISTS ( SELECT * FROM orders WHERE o_custkey = c_custkey ) ) AS custsale AND c_acctbal > ( SELECT AVG(c_acctbal) FROM customer WHERE c_acctbal > 0.00 AND SUB... | 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 rt.role = 'actor' AND t.production_year > 2005 AND cn.id = mc.company_id AND ct.id = mc.company_type... | 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 p.ViewCount >= 0 and p.Id = c.PostId and u.Id = b.UserId and p.Id = ph.PostId and u.Id = p.OwnerUserId and p.Id = v.PostId | stats |
SELECT MIN(t.title) AS biography_movie, MIN(n.name) AS of_person FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE ci.movie_id = ml.linked_movie_id AND n.name_pcode_cf BETWEEN 'A' AND 'F' AND pi.person_id = ci.person_id AND t.product... | job |
WITH year_total AS ( SELECT c_login AS customer_login, c_first_name AS customer_first_name, c_customer_id AS customer_id, c_email_address AS customer_email_address, c_last_name AS customer_last_name, c_preferred_cust_flag AS customer_preferred_cust_flag, d_year AS dyear, 's' AS sale_type, c_birth_country AS customer_bi... | 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 ct.id = mc.company_type_id AND rt.role = 'actor' AND cn.country_code = '[ru]' AND rt.id = ci.role_id... | job |
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE r_name = 1 AND c_nati... | 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 an.person_id = n.id AND t.episode_nr >= 50 AND k.keyword = 'character-name-in-title' AND t.... | 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.keyword = 'marvel-cinematic-universe' AND t.production_year > 2010 AND t.id = ci.movie_id AND ci.movie_id = mk.movie_id AND n.name LIKE '... | job |
SELECT COUNT(*) FROM votes AS v, posts AS p, badges AS b, users AS u WHERE p.Score <= 22 AND u.Id = p.OwnerUserId AND p.Id = v.PostId AND u.Reputation >= 1 AND u.Id = b.UserId LIMIT 1000; | stats |
SELECT i_item_desc, i_category, i_class, i_current_price, i_item_id, SUM(ss_ext_sales_price) AS itemrevenue, SUM(ss_ext_sales_price) * 100 / SUM(SUM(ss_ext_sales_price)) OVER (PARTITION BY i_class) AS revenueratio FROM store_sales JOIN item ON ss_item_sk = i_item_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk WHERE i_... | tpcds |
SELECT o_orderdate, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_shippriority, l_orderkey FROM customer, orders, lineitem WHERE l_shipdate > DATE 1 AND l_orderkey = o_orderkey AND c_custkey = o_custkey AND c_mktsegment = 1 AND o_orderdate < DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven... | 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 ci.movie_id = mc.movie_id AND t.production_year > 2005 AND t.id = ci.movie_id AND rt.id = ci.role_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 it.id = mi_idx.info_type_id AND t.production_year BETWEEN 2000 AND 2005 AND mi_idx.info > '8.0' AND t.id = mi_idx.movie_id | job |
SELECT SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_quantity) AS sum_qty, l_linestatus, l_returnflag, SUM(l_extendedprice) AS sum_base_price, AVG(l_discount) AS avg_disc, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_quantity) AS avg_qt... | tpch |
SELECT SUM(cs_quantity) AS catalog_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, i_item_id, s_store_id, i_item_desc, s_store_name, SUM(ss_quantity) AS store_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 |
WITH _q AS ( 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 ct.id = mc.company_type_id AND it.id = mi.info_type_id ) SELECT * FROM _q AND t.id = mi.movie_id AND mc.note NOT LIKE '%(AS Metro-Goldwyn-Mayer Pi... | job |
Select Count(*) From comments As c, posts As p, votes As v, users As u Where u.Id = c.UserId And p.ViewCount >= 0 And u.Id = v.UserId And c.Score = 0 And p.Score >= 0 And u.Id = p.OwnerUserId | stats |
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE cn.country_code = '[ru]' AND cn.id = mc.company_id AND ci.note LIKE '%(uncredited)%' AND rt.role = '... | job |
SELECT * FROM (SELECT o_orderdate, c_custkey, o_totalprice, o_orderkey, c_name, SUM(l_quantity) FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey) AS _agg WHERE SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey,... | tpch |
SELECT i_item_id, i_item_desc, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, STDDEV_SAMP(ss_quantity) AS store_sales_quantitystdev, COUNT(ss_quantity) AS store_sales_quantitycount, s_state, AVG(cs_quantity) AS catalog_sales_quanti... | 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 chn.id = ci.person_role_id AND rt.role = 'actor' AND ct.id = mc.company_type_id AND rt.id = ci.role_... | 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 = mk.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND n.id = ci.person_id AND ci.movie_id = mk.movie_id AND t.id = c... | 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 l... | tpch |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE u.Id = b.UserId AND p.Score <= 192 AND p.Id = v.PostId AND u.Id = p.OwnerUserId AND p.Id = c.PostId AND p.Id = ph.PostId AND p.ViewCount >= 0 | stats |
SELECT AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, COUNT(ss_quantity) AS store_sales_quantitycount, i_item_id, COUNT(cs_quantity) AS catalog_sales_quantitycount, i_item_desc, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quant... | tpcds |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.Id = c.PostId AND p.AnswerCount >= 0 AND p.Id = v.PostId AND p.PostTypeId = 1 AND p.Id = ph.PostId AND u.Id = p.OwnerUserId AND p.Id = pl.PostId | stats |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate >= DATE 1 AND s_nationkey = n_nationkey AND l_suppkey = s_suppkey AND c_nationkey = s_nationkey AND l_orderkey = o_orderkey AND r_name = 1 AND c_custkey = o_custkey AND n_regionk... | tpch |
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_shipmode IN (1, 1) AND o_orderkey = l_orde... | tpch |
Select Count(1) From store_sales Inner Join household_demographics On ss_hdemo_sk = hd_demo_sk Inner Join time_dim On ss_sold_time_sk = t_time_sk Inner Join store On ss_store_sk = s_store_sk Where t_hour = 14 And t_minute >= 30 And hd_dep_count = 4 And s_store_name = 'pri' Order By Count(1) Desc Limit 100; | 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 ='[nl]' AND mk.keyword_id = k.id AND cn.id = mc.company_id AND t.id = mk.movie_id AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.mo... | 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 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 n1.id = ci.person_id AND an1.person_id = n1.id AND t.id = mc.movie_id AND cn.country_code = '[jp]' AND mc.note ... | 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 cn.country_code = '[ru]' AND cn.id = mc.company_id AND t.id = ci.movie_id AND ct.id = mc.company_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 n.name Like '%Hemsworth%Chris%' AND t.id = ci.movie_id AND t.production_year > 2010 AND n.id = ci.person_id AND k.keyword = 'marvel-cinemat... | job |
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 = ph.PostId AND p.FavoriteCount >= 0 AND p.Id = pl.PostId AND p.Id = c.PostId AND pl.LinkTypeId = 1 AND p.Id = v.PostId | 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 = mc.movie_id AND an1.person_id = n1.id AND rt.role = 'actress' AND cn.country_code = '[jp]' AND n1... | 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 cn.country_code ='[sm]' and k.keyword ='character-name-in-title' and cn.id = mc.company_id and mc.movie_id = t.id and mk.keyword_id = k.id and mc.movie_id = mk.movie_id and t.id = mk.mo... | 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 sum(volume) as revenue, l_year, supp_nation, cust_nation from ( select n1.n_name as supp_nation, n2.n_name as cust_nation, EXTRACT(YEAR from l_shipdate) as l_year, l_extendedprice * (1 - l_discount) as volume from supplier, lineitem, orders, customer, nation n1, nation n2 where s_suppkey = l_suppkey and o_orderk... | 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.id = mc.company_type_id AND mc.movie_id = mi_idx.movie_id AND (mc.note LIKE ... | 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 chn.id = ci.person_role_id AND mi.movie_id = ci.movie_id AND cn.country_c... | 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 cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND t.id = mk.movie_id AND mc.movie_id = t.id AND cn.country_code ='[sm]' AND k.keyword ='character-name-IN-... | 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.id = mc.movie_id AND t.id = mi_idx.movie_i... | job |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, users AS u, badges AS b WHERE p.Score >= -7 AND p.OwnerUserId = u.Id AND u.Id = b.UserId AND ph.UserId = u.Id AND u.Reputation >= 1 AND ph.PostHistoryTypeId = 3 | stats |
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 s_nationkey = n_nationkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey =... | 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.info = 'top 250 rank' AND (mc.note LIKE '%(co-production)%' OR mc.... | job |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE u.Id = b.UserId AND p.Score <= 192 AND p.Id = v.PostId AND u.Id = p.OwnerUserId AND p.Id = ph.PostId AND p.Id = c.PostId AND p.ViewCount >= 0 | 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 cn.country_code =... | 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 k.keyword = 'marvel-cinematic-universe' and t.id = ci.movie_id and n.name like '%Hemsworth%Chris%' and k.id =... | 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 p_partkey = ps_partkey AND r_name = 1 AND p_type like 1 AND s_nationkey = n_nationkey AND p_size = 1 AND n_regionkey = r_regionkey AND s_suppkey = ps_suppkey AND ps_supplycost = ( selec... | tpch |
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE mc.movie_id = t.id AND k.keyword ='character-name-IN-title' AND cn.country_code ='[nl]' AND mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND t.id = mk.movie_id AND cn.id = mc.comp... | job |
SELECT 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_desc, s_store_name, s_store_id, i_item_id 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(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 |
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 k.keyword LIKE '%sequel%' AND t.id = mk.movie_id AND t.id = mi.movie_id AND k.id = mk.keyword_id AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'D... | job |
SELECT COUNT(*) FROM comments AS c, postHistory AS ph, votes AS v, users AS u WHERE ph.UserId = c.UserId AND u.DownVotes >= 0 AND u.Views >= 0 AND v.UserId = ph.UserId AND u.UpVotes <= 123 AND u.Id = v.UserId LIMIT 50; | stats |
SELECT s_store_name, SUM(ss_quantity) AS store_sales_quantity, SUM(cs_quantity) AS catalog_sales_quantity, s_store_id, SUM(sr_return_quantity) AS store_returns_quantity, i_item_desc, 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 |
WITH year_total AS ( SELECT d_year AS dyear, c_customer_id AS customer_id, c_last_name AS customer_last_name, c_first_name AS customer_first_name, '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,... | tpcds |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.