text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
SELECT MAX(k.keyword) AS movie_keyword, MAX(n.name) AS actor_name, MAX(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.keyword = 'marvel-cinematic-universe' AND k.id = mk.keyword_id AND n.name LIKE '%Downey%Robert%' AND t.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 = ci.movie_id AND k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND t.production_year > 2010 AND n.name LIKE '%Hemsworth%Chris%' ... | 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 ml.movie_id = mc.movie_id AND mk.mo... | 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 n.id = ci.person_id AND t.id = mc.movie_id AND mk.movie_id = ... | 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 mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND mc.movie_id = mi.movie_id AND ct.id = mc.company_type... | 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 miidx.movie_id = mc.movie_id AND kt.kind = 'mov... | 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 t.id = mk.movie_id AND cn.country_code ='[de]' AND cn.id = mc.company_id AND k.keyword ='character-name-In-title' AND mc.movie_id = mk.movie_id AND mk.keyword_id ... | 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 it.id = mi.info_type_id AND mc.movie_id = mi.movie_id AND mc.note NOT LIKE '%(AS Metro-Goldwyn-Mayer Pictures)%' AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%')... | job |
Select s_name, Count(1) As numwait From supplier, lineitem l1, orders, nation Where Not Exists ( Select * From lineitem l3 Where l3.l_orderkey = l1.l_orderkey And l3.l_suppkey <> l1.l_suppkey And l3.l_receiptdate > l3.l_commitdate ) And o_orderstatus = 'F' And o_orderkey = l1.l_orderkey And l1.l_receiptdate > l1.l_comm... | tpch |
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE k.keyword LIKE '%sequel%' AND mk.movie_id = mi.movie_id AND t.production_year > 2005 AND t.id = mi.movie_id AND k.id = mk.keyword_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish'... | job |
SELECT c_address, c_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_acctbal, c_phone, c_comment, n_name, c_custkey FROM customer, orders, lineitem, nation WHERE o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AND o_orderdate >= DATE 1 AND c_custkey = o_custkey AND l_orderkey = o_orderkey AN... | tpch |
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 it.id = mi_idx.info_type_id AND t.id = mi_idx.movie_id AND it.info ='rating' AND t.production_year BETWEEN 2000 AND 2005 AND mi_idx.info > '8.0' | job |
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_shipmode in (1, 1) and l_receiptdate >= DA... | 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 p_type = 1 ) AS all_n... | 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 mc.movie_id = t.id AND cn.country_code ='[nl]' AND k.keyword ='character-name-IN-title' AND t.id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_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 cn.country_code ='[nl]' AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND mc.movie_id = t.id AND t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND mk.keyword_id ... | job |
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 mi.movie_id = t.id AND it.id = miidx.info_type_... | job |
select c_custkey, c_address, c_acctbal, n_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_name, c_comment, c_phone from customer, orders, lineitem, nation where c_nationkey = n_nationkey AND c_custkey = o_custkey AND o_orderdate >= DATE 1 AND l_orderkey = o_orderkey AND o_orderdate < DATE 1 + INTERVAL '3' M... | tpch |
SELECT SUM(sr_return_quantity) AS store_returns_quantity, s_store_name, i_item_id, SUM(ss_quantity) AS store_sales_quantity, SUM(cs_quantity) AS catalog_sales_quantity, i_item_desc, s_store_id FROM store_sales INNER JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number =... | tpcds |
SELECT MAX(cs_net_profit) AS catalog_sales_profit, i_item_id, MAX(sr_net_loss) AS store_returns_loss, s_store_name, MAX(ss_net_profit) AS store_sales_profit, i_item_desc, s_store_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(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE ct.kind = 'production companies' AND t.id = mc.movie_id AND it.id = mi.info_type_id AND it.info = 'bottom 10 rank' AND ct.id = mc.company_type_id AND mc.note NOT LIKE '%(as Metro-Gol... | job |
SELECT MIN(an.name) AS acress_pseudonym, MIN(t.title) AS japanese_anime_movie FROM aka_name AS an, cast_info AS ci, company_name AS cn, company_type AS ct, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, role_type AS rt, title AS t WHERE t.production_year > 1990 AND mk.movie_id = mc.movie_id AND rt... | job |
SELECT l_linestatus, AVG(l_discount) AS avg_disc, COUNT(*) AS count_order, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_quantity) AS avg_qty, SUM(l_quantity) AS sum_qty, SUM(l_extendedprice) AS sum_base_price, l_returnflag, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice * (1 - l_di... | tpch |
SELECT SUM(sr_return_quantity) AS store_returns_quantity, s_store_id, SUM(ss_quantity) AS store_sales_quantity, SUM(cs_quantity) AS catalog_sales_quantity, s_store_name, i_item_id, 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 nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE ps_partkey = l_partkey AND o_orderkey = l_orderkey AND p_name... | 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 it.id = mi.info_type_id AND ct.kind = 'production companies' AND mc.movie_id = mi.movie_id AND ct.id = mc.company_type_id AND it.info = 'bottom 10 rank' AND t.id = mi.movie_id AND (m... | 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 rt.role = 'actress' AND n1.id = ci.person_id AND n1.name LIKE '%Yo%' AND mc.company_id = cn.id AND mc.note LIKE... | job |
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 o_orderkey = l... | tpch |
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue FROM ( SELECT n1.n_name AS supp_nation, n2.n_name AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, l_extendedprice * (1 - l_discount) AS volume FROM supplier, lineitem, orders, customer, nation n1, nation n2 WHERE c_nationkey = n2.n_nationkey AND c... | tpch |
WITH year_total AS ( SELECT c_email_address AS customer_email_address, d_year AS dyear, c_birth_country AS customer_birth_country, c_customer_id AS customer_id, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_login AS customer_login, c_preferred_cust_fl... | tpcds |
SELECT c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ... | tpcds |
WITH _q AS ( SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl WHERE p.CreationDate >= '2010-07-23 07:27:31'::timestamp AND p.Id = pl.PostId AND p.CreationDate <= '2014-09-09 01:43:00'::timestamp ) SELECT * FROM _q AND c.UserId = p.OwnerUserId AND p.CommentCount <= 18 | 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 mk.keyword_id = k.id And t.id = mk.movie_id And cn.country_code ='[nl]' And mc.movie_id = mk.movie_id And k.keyword ='character-name-In-title' And cn.id = mc.company_id And mc.movie_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 an1.person_id = n1.id AND n1.id = ci.person_id AND t.id = mc.movie_id AND an1.person_id = ci.person_id AND mc.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 mc.movie_id = t.id AND t.id = mk.movie_id AND 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 =... | job |
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE mk.keyword_id = k.id AND ci.movie_id = t.id AND mc.movie_id = mk.movie_id AND ci.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 n.id = ci.person_id AND ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND n.name LIKE '%Hemsworth%Chris%' AND t.production_year > 2010... | 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 s_nationkey = n1.n_nationkey AND s... | tpch |
SELECT AVG(ss_ext_sales_price), SUM(ss_ext_wholesale_cost), AVG(ss_quantity), AVG(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 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 k.id = mk.keyword_id AND t.id = mc.... | job |
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where mk.keyword_id = k.id AND k.keyword ='character-name-In-title' AND cn.id = mc.company_id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND cn.country_code ='[sm]' AND mc.movie_id ... | 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 = pl.PostId AND p.FavoriteCount >= 0 AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Id = c.PostId AND p.Id = ph.PostId LIMIT 200; | stats |
Select Avg(ss_sales_price) As agg4, Avg(ss_list_price) As agg2, Avg(ss_quantity) As agg1, i_item_id, Avg(ss_coupon_amt) As agg3 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 COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE pl.LinkTypeId = 1 AND p.Id = pl.PostId AND p.Id = c.PostId AND p.Id = v.PostId AND p.FavoriteCount >= 0 AND p.Id = ph.PostId AND c.Score = 0 LIMIT 200; | stats |
select cnt, ss_ticket_number, c_first_name, c_salutation, c_last_name, c_preferred_cust_flag 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(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 NOT LIKE '%(AS Metro-Goldwyn-Mayer Pictures)%' AND ct.id = mc.company_type_id AND t.id = mc.movie_... | job |
Select Min(mc.note) As production_note, Min(t.title) As movie_title, Min(t.production_year) As movie_year From company_type As ct, info_type As it, movie_companies As mc, movie_info_idx As mi_idx, title As t Where t.id = mc.movie_id AND ct.kind = 'production companies' AND ct.id = mc.company_type_id AND (mc.note Like '... | job |
select c_name, c_custkey, o_orderdate, o_totalprice, sum(l_quantity), o_orderkey 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 Count(*) From comments As c, posts As p, postHistory As ph, votes As v, users As u Where p.OwnerUserId = ph.UserId AND ph.UserId = v.UserId AND p.Score <= 13 AND u.Id = c.UserId AND p.AnswerCount >= 0 AND c.UserId = 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 chn.id = ci.person_role_id and ci.note like '%(uncredited)%' and ci.note like '%(voice)%' and ci.mov... | job |
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE ps_suppkey = l_suppkey AND o_orderkey = l_orderkey AND ps_par... | tpch |
SELECT AVG(ss_coupon_amt) AS agg3, AVG(ss_list_price) AS agg2, AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1, i_item_id 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 promotions, total, CAST(promotions as DECIMAL(15, 4)) / CAST(total as DECIMAL(15, 4)) * 100 from ( select sum(ss_ext_sales_price) as promotions from store_sales join store on ss_store_sk = s_store_sk join promotion on ss_promo_sk = p_promo_sk join date_dim on ss_sold_date_sk = d_date_sk join customer on ss_custo... | tpcds |
SELECT MIN(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.person_id = ci.person_id AND lt.link = 'features' AND n.id = pi.person_id AND t.production_year BETWEEN 1980 AND 19... | job |
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND s_nationkey = n_nationkey AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderke... | 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 = ph.PostId AND p.Id = c.PostId AND p.Id = v.PostId AND c.Score = 0 AND pl.LinkTypeId = 1 AND p.Id = pl.RelatedPostId AND b.UserId = c.UserId | stats |
SELECT AVG(ss_sales_price) AS agg4, AVG(ss_coupon_amt) AS agg3, AVG(ss_list_price) AS agg2, 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 i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price, 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 WHERE d_moy = 11 AND i_manager_id = 1 AND d_year = 2001 GROUP BY i_brand, i_brand_id ORDER BY ext_price ASC, brand_id LIMIT 100; | tpcds |
SELECT s_address, s_comment, n_name, s_acctbal, p_partkey, p_mfgr, s_name, s_phone FROM part, supplier, partsupp, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 1 AND p_type LIKE 1 AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r_name = 1 AND ps_supplycost = ( SELEC... | tpch |
SELECT SUM(ps_supplycost * ps_availqty) AS VALUE, ps_partkey FROM partsupp, supplier, nation WHERE ps_suppkey = s_suppkey AND s_nationkey = n_nationkey AND n_name = 1 GROUP BY ps_partkey HAVING SUM(ps_supplycost * ps_availqty) > ( SELECT SUM(ps_supplycost * ps_availqty) * 1 FROM partsupp, supplier, nation WHERE ps_supp... | 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.movie_id = mc.movie_id AND it1.id = mi_idx.info_type_id AND cn.coun... | job |
SELECT c_acctbal, c_phone, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_comment, c_custkey, c_name, n_name, c_address 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(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 ci.movie_id = mk.movie_id AND t.id = ci.movie_id AND k.id = mk.keyword_id AND t.id = mk.movie_i... | job |
Select c_name, o_orderdate, Sum(l_quantity), c_custkey, o_totalprice, o_orderkey 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 count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, users as u where p.Id = ph.PostId AND p.Id = pl.PostId AND u.Id = p.OwnerUserId AND p.AnswerCount >= 0 AND p.PostTypeId = 1 AND p.Id = c.PostId 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 an1.person_id = ci.person_id AND ci.movie_id = t.id AND cn.country_code = '[jp]' AND n1.name Not Like '%Yu%' AN... | job |
select min(mi_idx.info) as rating, min(t.title) as northamerican_movie from aka_title as at, company_name as cn, info_type as it1, info_type as it2, kind_type as kt, movie_companies as mc, movie_info as mi, movie_info_idx as mi_idx, title as t where mi.movie_id = mc.movie_id and mi.movie_id = mi_idx.movie_id 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 ct.kind = 'production companies' AND mi.movie_i... | job |
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.movie_id = mi.movie_id AND it2.id = mi.info_type_id AND mi.movie_id... | 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 mc.movie_id = mi.movie_id and (mc.note like '%(co-production)%' or mc.note like '%(presents)%') and t.id = mi.movie_id and ct.kind = 'production companies' and t.id = mc.movie_id and... | job |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE b.UserId = c.UserId AND p.Id = ph.PostId AND p.Id = pl.RelatedPostId AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND c.Score = 0 AND p.Id = c.PostId | stats |
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE cn.country_code = '[us]' AND k.id =... | job |
Select Min(mc.note) As production_note, Min(t.title) As movie_title, Min(t.production_year) As movie_year From company_type As ct, info_type As it, movie_companies As mc, movie_info_idx As mi_idx, title As t Where t.id = mi_idx.movie_id AND t.id = mc.movie_id AND mc.movie_id = mi_idx.movie_id AND it.id = mi_idx.info_ty... | job |
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE c.Score = 0 AND b.UserId = c.UserId AND p.Id = c.PostId AND pl.LinkTypeId = 1 AND p.Id = v.PostId AND p.Id = pl.RelatedPostId AND p.Id = ph.PostId | 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 l_returnflag = 'R' AND o_orderdate >= DATE 1 AND c_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_orderkey = o_orderke... | tpch |
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_suppkey = l_suppkey AND p_name LIKE 1 ) AS profit AND ps_pa... | 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 it.id = mi.info_type_id AND (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.info = 'bottom 10 rank' AND ct.kind = 'production companies' AND ct.id = mc.compa... | job |
SELECT cust_nation, SUM(volume) AS revenue, supp_nation, l_year FROM ( SELECT n1.n_name AS supp_nation, n2.n_name AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, l_extendedprice * (1 - l_discount) AS volume FROM supplier, lineitem, orders, customer, nation n1, nation n2 WHERE ( (n1.n_name = 1 AND n2.n_name = 1... | 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 k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND t.production_year > 2005 AND t.id = mk.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', ... | 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 mk.keyword_id = k.id And k.keyword ='character-name-In-title' And cn.id = mc.company_id And mc.movie_id = t.id And mc.movie_id = mk.mo... | job |
select l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem where c_mktsegment = 1 and l_orderkey = o_orderkey and o_orderdate < DATE 1 and l_shipdate > DATE 1 and c_custkey = o_custkey group by l_orderkey, o_orderdate, o_shippriority order by reven... | tpch |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND n.name LIKE '%Downey%Robert%' AND t.id = ci.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND k.ke... | job |
select avg(ss_quantity), sum(ss_ext_wholesale_cost), avg(ss_ext_wholesale_cost), avg(ss_ext_sales_price) 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 s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND l1.l_receiptdate > l1.l_commitdate AND n_name = 1 AND o_orderkey = l1.l_orderkey AND o_orderstatus = 'F' AND s_suppkey = l1.l_... | 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 cn.country_code = '[us]' And mc.movie_id = mk.movie_id And ci.movie_id = mc.movie_id And n.... | job |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.Id = pl.PostId AND p.PostTypeId = 1 AND u.Id = p.OwnerUserId AND p.AnswerCount >= 0 AND p.Id = ph.PostId AND p.Id = c.PostId AND p.Id = v.PostId | 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 t.production_year > 2000 And mi.movie_id = ci.movie_id And cn.id = mc.com... | job |
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_list_price >= 90 AND ss_list_price <= 90 + 10 Or ss_coupon_amt BETWEEN 1530 AND 1530 + 1000 Or ss_wholesale_cost BETWEEN 89 AND 89 + 20) ) As b3 AND (ss_list_price BETW... | tpcds |
SELECT l_returnflag, COUNT(1) AS count_order, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, AVG(l_quantity) AS avg_qty, SUM(l_extendedprice) AS sum_base_price, SUM(l_quantity) AS sum_qty, AVG(l_discount)... | 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 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 s_suppkey = l_suppkey AND p_name LIKE 1 ) AS profit AND ps_pa... | tpch |
SELECT COUNT(1) 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 u.Id = p.OwnerUserId AND p.Id = c.PostId AND p.Id = ph.PostId AND p.Score <= 192 AND p.ViewCount >= 0 AND p.Id = v.PostId | stats |
select sum(l_extendedprice) / 7.0 as avg_yearly from lineitem, part where p_partkey = l_partkey and p_brand = 1 and p_container = 1 and l_quantity < ( select 0.2 * avg(l_quantity) from lineitem where l_partkey = p_partkey ) LIMIT 500; | tpch |
SELECT s_store_id, i_item_desc, SUM(ss_quantity) AS store_sales_quantity, i_item_id, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity, s_store_name 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( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share, o_year 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(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.keyword = 'anime' AND an.person_id = n.id AND ci.person_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 > 2000 AND 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.id = mk.keyword_id AND k... | job |
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE mi.info LIKE 'USA:% 199%' AND t.id ... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE it.id = mi_idx.info_type_id AND it.info = 'top 250 rank' AND (mc.note LIKE '%(co-production)%' OR mc.note ... | 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 t.id = mi.movie_id AND cn.country_code = '[us]' AND t.id = ci.movie_id AN... | job |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.