text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
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 = ci.person_id AND k.keyword = 'character-name-in-title' AND mc.company_id = c... | job |
SELECT COUNT(*) FROM comments AS c, postHistory AS ph, badges AS b, votes AS v, users AS u WHERE ph.UserId = v.UserId AND v.UserId = c.UserId AND ph.PostHistoryTypeId = 12 AND u.Id = b.UserId AND u.UpVotes = 0 AND b.UserId = ph.UserId | stats |
SELECT AVG(l_quantity) AS avg_qty, AVG(l_discount) AS avg_disc, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice) AS sum_base_price, l_returnflag, l_linestatus, SUM(l_quantity) AS sum_qty, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_di... | tpch |
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where t.production_year > 2005 AND mi.info in ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND k.keyword like '%sequel%' AND t.id = mk.movie_id AND t... | 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 c_nationkey = n1.n_na... | 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 chn.id = ci.person_role_id AND cn.id = mc.company_id AND ct.id = mc.company_type_id AND t.production... | job |
Select Count(1) From comments As c, postHistory As ph, votes As v, users As u Where u.UpVotes <= 123 And u.Id = v.UserId And u.Views >= 0 And v.UserId = ph.UserId And ph.UserId = c.UserId And u.DownVotes >= 0 | stats |
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 v.UserId = ph.UserId AND u.Views >= 0 AND u.UpVotes <= 123 AND u.Id = v.UserId LIMIT 50; | stats |
SELECT AVG(ss_sales_price) AS agg4, AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, i_item_id, 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(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 cn.country_code = '[us]' And t.id = mk.movie_id And ci.movie_id = mk.movie_id And t.episode... | 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 p_size = 1 AND s_nationkey = n_nationkey AND s_suppkey = ps_suppkey AND r_name = 1 AND p_type LIKE 1 AND n_regionkey = r_regionkey AND ps_supplycost = ( SELEC... | 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 t.id = mc.movie_id AND t.production_year > 2000 AND t.id = mi.movie_id AN... | job |
SELECT SUM(l_extendedprice) AS sum_base_price, AVG(l_discount) AS avg_disc, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_extendedprice) AS avg_price, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, l_returnflag, AVG(l_quantity) AS avg_qty, SUM(l_quantity... | tpch |
SELECT i_item_id, AVG(ss_list_price) AS agg2, AVG(ss_sales_price) AS agg4, 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 Min(k.keyword) As movie_keyword, Min(n.name) As actor_name, Min(t.title) As marvel_movie From cast_info As ci, keyword As k, movie_keyword As mk, name As n, title As t Where t.id = ci.movie_id AND k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND t.id = mk.movie_id AND n.id = ci.person_id AND n.name Like '%... | 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 COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b, users AS u WHERE p.Id = v.PostId AND b.UserId = u.Id AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND c.UserId = u.Id AND p.Id = pl.RelatedPostId AND p.Id = c.PostId AND p.Score <= 40 | stats |
SELECT list_price, bought_city, ss_ticket_number, c_first_name, ca_city, extended_price, extended_tax, c_last_name 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 COUNT(*) FROM postHistory AS ph, posts AS p, users AS u, badges AS b WHERE ph.UserId = u.Id AND p.Score >= -7 AND ph.PostHistoryTypeId = 3 AND u.Id = b.UserId AND p.OwnerUserId = u.Id AND u.Reputation >= 1 LIMIT 500; | stats |
select count(1) 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 p.Score <= 13 and ph.UserId = v.UserId and u.Id = c.UserId and p.OwnerUserId = ph.UserId | stats |
SELECT p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_type, p_brand FROM partsupp, part WHERE p_brand <> 1 AND p_partkey = ps_partkey AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_type NOT LIKE 1 GROUP BY p_brand... | tpch |
Select Sum(l_extendedprice * (1 - l_discount)) As revenue, c_phone, c_name, c_custkey, c_address, c_acctbal, n_name, c_comment From customer, orders, lineitem, nation Where c_custkey = o_custkey And l_orderkey = o_orderkey And o_orderdate >= DATE 1 And o_orderdate < DATE 1 + INTERVAL '3' MONTH And l_returnflag = 'R' An... | tpch |
select min(t.title) as movie_title from company_name as cn, keyword as k, movie_companies as mc, movie_keyword as mk, title as t where mc.movie_id = t.id AND cn.country_code ='[nl]' AND t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-in-title' AND cn.id = mc.company_id AND mk.keyword_id ... | job |
SELECT c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price 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 p_brand, p_type, p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt FROM partsupp, part WHERE p_type NOT LIKE 1 AND p_brand <> 1 AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_partkey = ps_partkey AND p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) GROUP B... | tpch |
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 l_orderkey = o_orderkey AND l_returnflag = 'R' AND c_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '3' MONT... | tpch |
SELECT MIN(t.title) AS voiced_movie, MIN(n.name) AS voicing_actress FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE t.id = ci.movie_id AND ci.role_id = rt.id AND ci.movie_id = mc.movie_id A... | job |
SELECT MIN(k.keyword) AS movie_keyword, MIN(t.title) AS marvel_movie, MIN(n.name) AS actor_name 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 ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE ... | job |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b, users AS u WHERE p.Id = v.PostId AND p.Id = pl.RelatedPostId AND b.UserId = u.Id AND p.Id = ph.PostId AND c.UserId = u.Id AND pl.LinkTypeId = 1 AND p.Score <= 40 AND p.Id = c.PostId | stats |
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where cn.id = mc.company_id AND mc.movie_id = t.id AND k.keyword ='character-name-In-title' AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.country_code =... | job |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE o_orderdate < DATE 1 + INTERVAL '1' YEAR AND l_orderkey = o_orderkey AND c_nationkey = s_nationkey AND o_orderdate >= DATE 1 AND s_nationkey = n_nationkey AND c_custkey = o_custkey AND r_nam... | 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 p_size, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_type, p_brand FROM partsupp, part WHERE p_brand != 1 AND 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_partkey = ps_partkey GROUP BY p_brand... | tpch |
SELECT total_revenue, s_suppkey, s_phone, s_address, s_name FROM supplier, revenue0 WHERE s_suppkey = supplier_no AND total_revenue = ( SELECT MAX(total_revenue) FROM revenue0 ) ORDER BY s_suppkey | 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 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 mc.movie_id = mk.movie_id AND cn.country_code ='[sm]' AND cn.id = mc.comp... | 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 n.id = ci.person_id AND n.name LIKE '%Hemsworth%Chris%' AND k.id = mk.keyword_id AND t.id = mk.... | job |
SELECT i_brand AS brand, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price, i_manufact, i_manufact_id 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 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_receiptdate >= DATE 1 And l_shipmode In (1... | tpch |
SELECT COUNT(*) FROM badges AS b, posts AS p WHERE b.UserId = p.OwnerUserId AND b.Date <= '2014-09-11 08:55:52'::timestamp AND p.AnswerCount BETWEEN 0 AND 4; | stats |
SELECT s_store_id, i_item_id, MAX(sr_net_loss) AS store_returns_loss, MAX(ss_net_profit) AS store_sales_profit, i_item_desc, MAX(cs_net_profit) AS catalog_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 COUNT(*) FROM comments AS c, posts AS p, votes AS v, users AS u WHERE c.Score = 0 AND p.Score >= 0 AND p.ViewCount >= 0 AND u.Id = c.UserId AND u.Id = v.UserId AND u.Id = p.OwnerUserId LIMIT 20; | stats |
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_commitdate <... | tpch |
SELECT i_item_id, s_store_id, MAX(ss_net_profit) AS store_sales_profit, s_store_name, i_item_desc, MAX(cs_net_profit) AS catalog_sales_profit, MAX(sr_net_loss) AS store_returns_loss 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(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.production_year > 2010 AND k.id = mk.keyword_id AND n.id = ci.person_id AND n.name LIKE '%Hemsworth%Chris%' AND k.keyword = 'marvel-cinem... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.id = mi_idx.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi_idx.m... | 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 mk.movie_id = mc.movie_id AND ci.person_id = an.person_id AND... | job |
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German']) and k.id = mk.keyword_id and t.id = mi.movie_id and t.production_year > 2000 and k.keyword like '%seque... | job |
WITH _q AS ( SELECT SUM(cr_net_loss) AS returns_loss, cc_manager AS manager, cc_call_center_id AS call_center, cc_name AS call_center_name 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_custome... | tpcds |
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_custkey, c_comment, c_address, c_acctbal, n_name, c_name, c_phone FROM customer, orders, lineitem, nation WHERE l_returnflag = 'R' AND o_orderdate >= DATE 1 AND l_orderkey = o_orderkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND c_custkey = o_custkey AN... | tpch |
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE lt.link = 'features' AND ci.person_id = n.id AND pi.note = 'Volker Boehm' AND t.production_year BETWEEN 1980 AND 1995 ... | 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.production_year > 2010 AND k.id = mk.keyword_id AND n.name LIKE '%Downey%Robert%' AND k.keyword = 'marvel-cinematic-universe' AND t.id = ... | job |
SELECT AVG(l_extendedprice) AS avg_price, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice) AS sum_base_price, AVG(l_discount) AS avg_disc, SUM(l_quantity) AS sum_qty, l_linestatus, l_returnflag, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount) * ... | tpch |
SELECT SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice) AS sum_base_price, SUM(l_quantity) AS sum_qty, AVG(l_extendedprice) AS avg_price, COUNT(*) AS count_order, AVG(l_quantity) AS avg_qty, l_linestatus, AVG(l_discount) AS avg_disc, l_returnflag, SUM(l_extendedprice * (1 - l_discount) * ... | 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 kt.id = t.kind_id AND mi_idx.info < '3.5' AND it2.id = mi.info_type_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 k.id = mk.keyword_id AND n.gender = 'f' AND ci.note LIKE '%(v... | 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 mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') And mk.movie_id = mi.movie_id And k.keyword Like '%sequel%' And k.id = mk.keyword_id And ... | job |
select min(mc.note) as production_note, min(t.production_year) as movie_year, min(t.title) as movie_title from company_type as ct, info_type as it, movie_companies as mc, movie_info_idx as mi_idx, title as t where mc.note not like '%(as Metro-Goldwyn-Mayer Pictures)%' and it.id = mi_idx.info_type_id and ct.id = mc.comp... | job |
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE k.keyword ='character-name-IN-title' AND cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND cn.country_code ='[nl]' AND mc.movie_id = t.id AND t.id = mk.mo... | 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 ='[sm]' AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND mc.movie_id = t.id AND mk.keyword_id ... | 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.production_year > 2010 and mi.info in ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') and k.id = mk.keyword_id and k.keyword like '%sequel%' and t.id = mk.movie_id and t.... | job |
SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE t.id = mc.movie_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.id = mi.info_type_id AND it.info = 'bottom 10 rank' AND mc.movie_id = mi.movie_id AND ... | 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 l_orderkey = o_orderkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND s_nationkey = n_nationkey AND r_name = 1 AND n_regionkey = r_regionkey AND o_orderdate ... | tpch |
select min(n.name) as of_person, min(t.title) as biography_movie from aka_name as an, cast_info as ci, info_type as it, link_type as lt, movie_link as ml, name as n, person_info as pi, title as t where pi.note = 'Volker Boehm' AND an.person_id = ci.person_id AND t.production_year BETWEEN 1980 AND 1995 AND n.id = an.per... | job |
SELECT COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_brand, p_type, p_size FROM partsupp, part WHERE ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_brand <> 1 AND p_type NOT LIKE 1 AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_partkey = ps_partkey GROUP BY p_brand... | 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 mi.info Like 'USA:% 199%' And mc.no... | job |
SELECT c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price 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 i_current_price, i_item_id, i_item_desc FROM item JOIN inventory ON i_item_sk = inv_item_sk JOIN date_dim ON d_date_sk = inv_date_sk JOIN catalog_sales ON cs_item_sk = i_item_sk WHERE d_date BETWEEN CAST('2000-05-01' AS DATE) AND (CAST('2000-05-01' AS DATE) + INTERVAL '60 days') AND inv_quantity_on_hand BETWEEN ... | 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 n.id = pi.person_id AND an.person_id = ci.person_id AND t.id = ci.movie_id AND an.name LIKE '%a%' AND it.id = pi.info_... | job |
select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where r_name = 1 and c_nationkey = s_nationkey and l_suppkey = s_suppkey and o_orderdate >= DATE 1 and n_regionkey = r_regionkey and s_nationkey = n_nationkey and o_orderdate < DATE 1 + INTERVAL '... | tpch |
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 = c.PostId AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND p.Id = pl.RelatedPostId AND b.UserId = c.UserId LIMIT 200; | stats |
SELECT MIN(mc.note) AS production_note, MIN(t.production_year) AS movie_year, MIN(t.title) AS movie_title FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE t.id = mc.movie_id AND ct.id = mc.company_type_id AND t.id = mi_idx.movie_id AND ct.kind = 'production com... | 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 cn.id = mc.company_id AND ci.role_id = rt.id AND it.id = mi.info_type_id ... | job |
SELECT MIN(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE n1.name NOT LIKE '%Yu%' AND rt.role = 'actress' AND ci.role_id = rt.id AND an1.person_id = ci.person_id AND ci.... | job |
WITH year_total AS ( SELECT c_last_name AS customer_last_name, c_birth_country AS customer_birth_country, d_year AS dyear, c_login AS customer_login, c_preferred_cust_flag AS customer_preferred_cust_flag, 's' AS sale_type, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)... | tpcds |
WITH _q AS ( select count(*) from postHistory as ph, posts as p, users as u, badges as b where ph.UserId = u.Id and ph.PostHistoryTypeId = 3 and p.OwnerUserId = u.Id and u.Id = b.UserId and u.Reputation >= 1 and p.Score >= -7 ) SELECT * FROM _q; | stats |
select count(1) from postHistory as ph, posts as p, users as u, badges as b where u.Reputation >= 1 and u.Id = b.UserId and ph.PostHistoryTypeId = 3 and p.OwnerUserId = u.Id and p.Score >= -7 and ph.UserId = u.Id | stats |
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE p.Id = ph.PostId AND p.Id = c.PostId AND p.Id = v.PostId AND p.Id = pl.RelatedPostId AND pl.LinkTypeId = 1 AND c.Score = 0 AND b.UserId = c.UserId | stats |
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 pl.LinkTypeId = 1 AND p.Id = ph.PostId AND c.Score = 0 AND p.Id = v.PostId AND p.Id = pl.RelatedPostId AND b.UserId = c.UserId | stats |
SELECT i_brand_id AS brand_id, i_manufact, SUM(ss_ext_sales_price) AS ext_price, i_brand AS brand, i_manufact_id 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 |
with year_total as ( select 's' as sale_type, d_year as dyear, c_first_name as customer_first_name, c_last_name as customer_last_name, c_customer_id as customer_id, c_login as customer_login, c_birth_country as customer_birth_country, c_email_address as customer_email_address, c_preferred_cust_flag as customer_preferre... | tpcds |
SELECT o_orderdate, SUM(l_extendedprice * (1 - l_discount)) AS revenue, l_orderkey, o_shippriority FROM customer, orders, lineitem WHERE c_custkey = o_custkey AND o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_shipdate > DATE 1 AND l_orderkey = o_orderkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven... | tpch |
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.production_year > 2005 AND k.keyword LIKE '%sequel%' AND k.id = mk.keyword_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German'... | 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 n.name LIKE '%Downey%Robert%' AND t.id = mk.movie_id AND ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND t.pr... | job |
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 ci.movie_id = mc.movie_id AND t.production_year > 2005 AND ct.id = mc.company_type_id AND chn.id = c... | job |
SELECT c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(1) AS cnt FROM store_sales INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN store ON ss_store_sk = s_store_sk INNER JOIN household_demographics ON ss_hdemo_sk =... | tpcds |
SELECT AVG(ss_quantity) AS agg1, AVG(ss_list_price) AS agg2, i_item_id, 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 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 mi.info LIKE 'USA:% 199%' AND mc.no... | job |
Select o_orderdate, o_orderkey, o_totalprice, c_name, Sum(l_quantity), c_custkey From customer, orders, lineitem Where o_orderkey In ( Select l_orderkey From lineitem Group By l_orderkey Having Sum(l_quantity) > 1 ) And c_custkey = o_custkey And o_orderkey = l_orderkey Group By c_name, c_custkey, o_orderkey, o_orderdat... | tpch |
SELECT * FROM ( SELECT AVG(ss_list_price) AS b1_lp, COUNT(ss_list_price) AS b1_cnt, COUNT(DISTINCT ss_list_price) AS b1_cntd FROM store_sales WHERE ss_quantity <= 5 AND (ss_list_price BETWEEN 84 AND 84 + 10 OR ss_coupon_amt BETWEEN 1190 AND 1190 + 1000 OR ss_wholesale_cost BETWEEN 65 AND 65 + 20) ) AS b3 AND (ss_list_p... | tpcds |
SELECT MIN(miidx.info) AS rating, MIN(mi.info) AS release_date, 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 cn.country_code ... | job |
WITH year_total AS ( SELECT c_birth_country AS customer_birth_country, 's' AS sale_type, d_year AS dyear, c_last_name AS customer_last_name, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_preferred_cust_flag AS customer_preferred_cust_flag, c_email_add... | tpcds |
Select Min(an.name) As acress_pseudonym, Min(t.title) As japanese_anime_movie From aka_name As an, cast_info As ci, company_name As cn, company_type As ct, keyword As k, movie_companies As mc, movie_keyword As mk, name As n, role_type As rt, title As t Where ci.note Like '%(voice: English version)%' 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 mc.note LIKE '%(USA)%' AND n.gender = 'f' AND an.person_id = n.id AND it.... | 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 p.Id = ph.PostId AND b.UserId = c.UserId AND pl.LinkTypeId = 1 AND p.Id = pl.RelatedPostId AND p.Id = v.PostId AND c.Score = 0 | stats |
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderkey = l1.l_orderkey AND s_suppkey = l1.l_suppkey AND o_orderstatus = 'F' AND l1.l_receiptdate > l1.l_commitdate AND s_nationkey = n_nationkey AND n_name = 1 AND NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_or... | tpch |
Select Min(an1.name) As actress_pseudonym, Min(t.title) As japanese_movie_dubbed From aka_name As an1, cast_info As ci, company_name As cn, movie_companies As mc, name As n1, role_type As rt, title As t Where ci.note = '(voice: English version)' AND ci.movie_id = mc.movie_id AND n1.id = ci.person_id AND mc.note Like '%... | job |
Select Sum(ss_ext_wholesale_cost), Avg(ss_ext_wholesale_cost), Avg(ss_ext_sales_price), Avg(ss_quantity) 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(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.info = 'top 250 rank' AND ct.kind = 'production companies' AND mc.note NOT LIKE '%(as Metro-Goldwyn-May... | job |
Select o_orderdate, o_orderkey, Sum(l_quantity), c_custkey, c_name, o_totalprice From customer, orders, lineitem Where o_orderkey In ( Select l_orderkey From lineitem Group By l_orderkey Having Sum(l_quantity) > 1 ) And c_custkey = o_custkey And o_orderkey = l_orderkey Group By c_name, c_custkey, o_orderkey, o_orderdat... | tpch |
SELECT AVG(cs_quantity) AS catalog_sales_quantityave, STDDEV_SAMP(ss_quantity) AS store_sales_quantitystdev, AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, COUNT(sr_return_quantity) AS store_returns_quantitycount, i_item_id, COUNT(cs_quantity) AS cat... | tpcds |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.