text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
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.Score <= 40 AND p.Id = c.PostId AND c.UserId = u.Id AND b.UserId = u.Id AND p.Id = pl.RelatedPostId AND p.Id = v.PostId AND p.Id = ph.PostId AND pl.LinkTypeId = 1 | stats |
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE u.Id = c.UserId AND p.Score <= 13 AND c.UserId = p.OwnerUserId AND p.OwnerUserId = ph.UserId AND ph.UserId = v.UserId AND p.AnswerCount >= 0 | stats |
SELECT AVG(cs_list_price) AS agg2, AVG(cs_sales_price) AS agg4, i_item_id, AVG(cs_quantity) AS agg1, AVG(cs_coupon_amt) AS agg3 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 Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') And k.id = mk.keyword_id And t.id = mi.movie_id And t.id = mk.movie_id And t.production_year > 2005 And mk.movie... | job |
SELECT AVG(cs_coupon_amt) AS agg3, AVG(cs_sales_price) AS agg4, i_item_id, AVG(cs_quantity) AS agg1, AVG(cs_list_price) AS agg2 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 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.Id = v.PostId AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND p.Id = ph.PostId AND p.FavoriteCount >= 0 | stats |
SELECT COUNT(cs_quantity) AS catalog_sales_quantitycount, i_item_id, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, AVG(ss_quantity) AS store_sales_quantityave, COUNT(ss_quantity) AS store_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, s_sta... | tpcds |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi_idx.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND it.info = 'top 250 r... | 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.info = 'top 250 rank' AND it.id = mi_idx.info_type_id AND ct.id = mc.company_type_id AND ct.kind = 'pro... | job |
Select extended_price, c_last_name, list_price, ss_ticket_number, ca_city, c_first_name, extended_tax, bought_city 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 comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE p.Id = ph.PostId AND b.UserId = c.UserId AND p.Id = pl.RelatedPostId AND p.Id = c.PostId AND c.Score = 0 AND p.Id = v.PostId AND pl.LinkTypeId = 1 LIMIT 20; | stats |
SELECT MIN(t.title) AS western_violent_movie, MIN(mi_idx.info) AS rating, MIN(cn.name) AS movie_company 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(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE mc.movie_id = mk.movie_id AND n.id = ci.person_id AND an.person_id = n.id AND ci.movie_id =... | job |
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, n_name FROM customer, orders, lineitem, supplier, nation, region WHERE l_suppkey = s_suppkey AND s_nationkey = n_nationkey AND l_orderkey = o_orderkey AND c_nationkey = s_nationkey AND n_regionkey = r_regionkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1... | 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 it.info = 'release dates' AND mi.movie_id = ci.movie_id AND t.production_... | 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 >= 71 AND ss_list_price <= 71 + 10 Or ss_coupon_amt BETWEEN 1905 AND 1905 + 1000 Or ss_wholesale_cost BETWEEN 61 AND 61 + 20) ) As b3 AND (ss_list_price BETW... | tpcds |
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND k.id = mk.keyword_id AND t.production_year > 2010 AND t.id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND mk.movie_... | job |
SELECT p_brand, p_type, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_size FROM partsupp, part WHERE ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_partkey = ps_partkey AND p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_brand <> 1 AND p_type NOT LIKE 1 GROUP BY p_brand... | tpch |
SELECT AVG(ss_quantity) AS agg1, AVG(ss_coupon_amt) AS agg3, i_item_id, AVG(ss_list_price) AS agg2, 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(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword, 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 t.production_year > 2010 AND k.id = mk.keyword_id AND n.name LIKE '%Hemsworth%Chris%' AND ci.movie_id = mk.movie_id AND n.id = ci.person_id... | job |
SELECT AVG(ss_coupon_amt) AS agg3, AVG(ss_quantity) AS agg1, AVG(ss_sales_price) AS agg4, i_item_id, 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 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.country_code = '[us]' AND mi_idx.info < '3.5' AND it2.info = 'relea... | job |
SELECT AVG(ss_quantity) AS store_sales_quantityave, COUNT(sr_return_quantity) AS store_returns_quantitycount, i_item_desc, s_state, AVG(cs_quantity) AS catalog_sales_quantityave, i_item_id, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, COUNT(cs_quantity) AS catalog_sales_quantitycount, COUNT(ss_quanti... | 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 k.id = mk.keyword_id AND t.id = ci.movie_id AND t.id = mk.movie_id AND n.id = ci.person_id AND n.name LIKE '%Downey%Robert%' AND t.producti... | job |
SELECT i_item_desc, s_store_name, MAX(ss_net_profit) AS store_sales_profit, MAX(cs_net_profit) AS catalog_sales_profit, i_item_id, MAX(sr_net_loss) AS store_returns_loss, 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 c_comment, c_address, c_custkey, c_phone, n_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_name, c_acctbal from customer, orders, lineitem, nation where l_returnflag = 'R' AND c_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND o_orderdate >= DATE 1 AND l_orderkey = o_orderke... | 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 cn.country_code ='[sm]' AND mc.movie_id = t.id AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND mk.keyword_id ... | job |
SELECT SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count, l_shipmode, SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count FROM orders, lineitem WHERE l_shipmode IN (1, 1) AND l_receiptdate < DAT... | 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 mc.movie_id = mk.movie_id AND mc.company_id = cn.id AND t.id = mc.movie_id AND t.episode_nr... | job |
SELECT i_item_id, i_item_desc, i_current_price FROM item INNER JOIN inventory ON i_item_sk = inv_item_sk INNER JOIN date_dim ON d_date_sk = inv_date_sk INNER JOIN catalog_sales ON cs_item_sk = i_item_sk WHERE inv_quantity_on_hand >= 100 AND inv_quantity_on_hand <= 500 AND i_current_price BETWEEN 95 AND 95 + 30 AND i_ma... | 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 cn.id = mc.company_id AND t.id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND cn.country_code ='[nl]' AND mc.movie_id = t.id AND k.keyword ='character-name-IN-... | job |
select avg(ss_sales_price) as agg4, avg(ss_quantity) as agg1, i_item_id, avg(ss_list_price) as agg2, avg(ss_coupon_amt) as agg3 from store_sales INNER JOIN customer_demographics on ss_cdemo_sk = cd_demo_sk INNER JOIN date_dim on ss_sold_date_sk = d_date_sk INNER JOIN item on ss_item_sk = i_item_sk INNER JOIN promotion ... | tpcds |
SELECT MIN(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 ci.movie_id = mc.movie_id AND ci.role_id = rt.... | job |
WITH _q AS ( 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_d... | tpcds |
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE s_nationkey = n_nationkey AND p_name LIKE 1 ) AS profit AND p... | tpch |
SELECT i_item_id, i_current_price, 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 store_sales ON ss_item_sk = i_item_sk WHERE i_current_price >= 73 AND i_current_price <= 73 + 30 AND d_date BETWEEN CAST('1998-01-15' AS DATE) AND (CAST('1998-01-15' AS DATE) ... | tpcds |
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = ph.PostId AND pl.LinkTypeId = 1 AND p.FavoriteCount >= 0 AND p.Id = c.PostId AND p.Id = v.PostId AND p.Id = pl.PostId AND c.Score = 0 | stats |
SELECT AVG(cs_list_price) AS agg2, AVG(cs_quantity) AS agg1, i_item_id, AVG(cs_coupon_amt) AS agg3, AVG(cs_sales_price) AS agg4 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 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 rt.role = 'actress' And ci.role_id = rt.id And mc.note Like '%(Japan)%' And ci.note =... | job |
select sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, l_orderkey, o_shippriority from customer, orders, lineitem where c_mktsegment = 1 and c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate < DATE 1 and l_shipdate > DATE 1 group by l_orderkey, o_orderdate, o_shippriority order by reven... | 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 mc.company_id = cn.id AND ci.note = '(voice: English version)' AND ci.role_id = rt.id AND t.id = mc.movie_id AN... | job |
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 cn.country_code = '[us]' AND t.id = mi.movie_id AND an.person_id = n.id A... | job |
SELECT SUM(l_quantity), c_custkey, o_totalprice, o_orderkey, o_orderdate, c_name 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 MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE t.id = ci.movie_id AND ci.note LIKE '%(uncredited)%' AND cn.country_code = '[ru]' AND ct.id = mc.com... | job |
SELECT s_store_name, SUM(sr_return_quantity) AS store_returns_quantity, SUM(ss_quantity) AS store_sales_quantity, SUM(cs_quantity) AS catalog_sales_quantity, s_store_id, 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 |
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 mc.movie_id = mi... | 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 t.production_year > 2010 AND ci.movie_id = mk.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Downey%Robert%' AND n.... | job |
Select Sum(l_extendedprice) / 7.0 As avg_yearly From lineitem, part Where p_container = 1 AND l_quantity < ( Select 0.2 * Avg(l_quantity) From lineitem Where l_partkey = p_partkey ) AND p_partkey = l_partkey AND p_brand = 1 LIMIT 10; | tpch |
SELECT c_name, c_custkey, c_phone, n_name, c_comment, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_acctbal 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 c_custkey = o_custkey ... | tpch |
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE r_name = 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey ... | 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 t.id = mc.movie_id AND mc.note NOT LIKE '%(AS Metro-Goldwyn-Mayer Pic... | 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 lt.link LIKE '%follow%' AND mi.movi... | job |
select count(*) from posts as p, postLinks as pl, users as u where p.OwnerUserId = u.Id and p.Id = pl.PostId and p.CommentCount <= 17 and u.CreationDate <= '2014-09-12 07:12:16'::timestamp LIMIT 50; | stats |
SELECT nation, o_year, SUM(amount) AS sum_profit FROM ( SELECT n_name AS nation, EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount FROM part, supplier, lineitem, partsupp, orders, nation WHERE p_name LIKE 1 ) AS profit AND s_nationkey = n_nationkey AND p... | 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 n1.name LIKE '%Yo%' AND ci.movie_id = t.id AND rt.role = 'actress' AND ci.role_id = rt.id AND mc.note LIKE '%(J... | job |
SELECT MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword, 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 k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Downey%Robert%' AND t.production_year > 2010 AND t.id = mk.movie_id AND n.id = ci... | job |
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_name, c_comment, c_acctbal, c_phone, c_custkey, 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 SUM(sr_return_quantity) AS store_returns_quantity, SUM(ss_quantity) AS store_sales_quantity, SUM(cs_quantity) AS catalog_sales_quantity, s_store_name, i_item_id, i_item_desc, s_store_id FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti... | tpcds |
SELECT 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 mc.movie_id = t.id AND miidx.movie_id = t.id AN... | 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 = pl.RelatedPostId AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND b.UserId = u.Id AND p.Id = c.PostId AND c.UserId = u.Id AND p.Score <= 40 AND p.Id = ph.PostId LIMIT 20; | 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.country_code ='[sm]' And mc.movie_id = t.id And mc.movie_id = mk.movie_id And t.id = mk.movie_id And cn.id = mc.company_id And k.keyword ='character-name-In-title' And mk.keyword_id ... | job |
With year_total As ( Select c_preferred_cust_flag As customer_preferred_cust_flag, c_birth_country As customer_birth_country, c_customer_id As customer_id, 's' As sale_type, d_year As dyear, c_first_name As customer_first_name, c_last_name As customer_last_name, Sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_... | tpcds |
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE mc.movie_id = t.id AND it2.id = mi.info_type_id... | 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 ps_partkey = l_partkey AND s_nationkey = n_nationkey AND p_pa... | tpch |
SELECT list_price, c_last_name, ss_ticket_number, c_first_name, bought_city, ca_city, 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 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 mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND (mc.note LIKE... | job |
SELECT AVG(ss_ext_sales_price), AVG(ss_quantity), SUM(ss_ext_wholesale_cost), AVG(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 dt.d_year, SUM(ss_ext_sales_price) AS ext_price, item.i_brand AS brand, 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 dt.d_moy = 12 AND item.i_manager_id = 95 AND dt.d_year = 1999 GROUP BY ... | tpcds |
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE cn.id = mc.company_id AND it2.id = mi.info_type... | 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 o_orderdate BETWEEN D... | 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 t.id = mc.movie_id AND ci.movie_id = t.id AND an1.person_id = ci.person_id AND n1.name NOT LIKE '%Yu%' AND cn.c... | job |
SELECT c_custkey, o_orderkey, o_totalprice, SUM(l_quantity), c_name, o_orderdate 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 o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE o_orderdate BETWEEN D... | tpch |
Select Min(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 mc.note Like '%(Japan)%' AND ci.movie_id = mc.movie_id AND ci... | job |
Select c_first_name, extended_tax, bought_city, extended_price, ss_ticket_number, ca_city, c_last_name, 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 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 ct.id = mc.company_type_id AND mk.movie_id = ci.movie_id AND ... | 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 p_partkey = l_partkey And p_name L... | 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.id = mi.movie_id AND k.id = mk.keyword_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German']) AND t.id = mk.movie_id AND k.keyword LIKE '%sequel%' AN... | job |
SELECT STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, AVG(cs_quantity) AS catalog_sales_quantityave, i_item_desc, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, i_item_id, COUNT(ss_quantity) AS store_sales_quantitycount, COUNT(sr_return_quantity) AS store_returns_quantitycount,... | 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 t.id = mk.movie_id AND k.keyword ='character-name-in-title' AND cn.id = mc.company_id AND mk.keyword_id = k.id AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.country_code =... | 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 t.id = mi_idx.movie_id AND at.movie_id = mc.movie_id AND mi_idx.info <... | 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 o_orderkey = l_orderkey and l_receiptdate >=... | tpch |
SELECT SUM( CASE WHEN o_orderpriority = '1-URGENT' OR o_orderpriority = '2-HIGH' THEN 1 ELSE 0 END ) AS high_line_count, l_shipmode, SUM( CASE WHEN o_orderpriority <> '1-URGENT' AND o_orderpriority <> '2-HIGH' THEN 1 ELSE 0 END ) AS low_line_count FROM orders, lineitem WHERE l_shipmode IN (1, 1) AND o_orderkey = l_orde... | 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 t.production_year > 2010 AND n.id = ci.person_id AND t.id = mk.movie_id AND k.id = mk.keyword_id AND n.name Like '%Downey%Robert%' AND t.id... | job |
Select Sum( Case When o_orderpriority <> '1-URGENT' And o_orderpriority <> '2-HIGH' Then 1 Else 0 End ) As low_line_count, l_shipmode, Sum( Case When o_orderpriority = '1-URGENT' Or o_orderpriority = '2-HIGH' Then 1 Else 0 End ) As high_line_count From orders, lineitem Where l_receiptdate >= DATE 1 And l_shipmode In (1... | tpch |
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE t.id = mc.movie_id AND rt.id = ci.role_id AND ci.note LIKE '%(voice)%' AND rt.role = 'actor' AND chn... | job |
Select Min(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where k.keyword Like '%sequel%' AND t.id = mi.movie_id AND mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND t.id = mk.movie_id AND t.produ... | job |
Select c_custkey, c_name, Sum(l_extendedprice * (1 - l_discount)) As revenue, c_acctbal, n_name, c_address, c_phone, c_comment From customer, orders, lineitem, nation Where o_orderdate < DATE 1 + INTERVAL '3' MONTH And c_nationkey = n_nationkey And l_orderkey = o_orderkey And c_custkey = o_custkey And l_returnflag = 'R... | tpch |
Select Min(an1.name) As actress_pseudonym, Min(t.title) As japanese_movie_dubbed From aka_name As an1, cast_info As ci, company_name As cn, movie_companies As mc, name As n1, role_type As rt, title As t Where rt.role = 'actress' AND mc.company_id = cn.id AND ci.role_id = rt.id AND cn.country_code = '[jp]' AND n1.id = c... | job |
SELECT AVG(l_quantity) AS avg_qty, AVG(l_discount) AS avg_disc, SUM(l_quantity) AS sum_qty, COUNT(*) AS count_order, SUM(l_extendedprice) AS sum_base_price, AVG(l_extendedprice) AS avg_price, l_returnflag, l_linestatus, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice * (1 - l_di... | 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.info = 'bottom 10 rank' AND t.id = mc.movie_id AND t.id = mi.movie_id AND it.id = mi.info_type_id AND ct.id = mc.company_type_id AND (mc.note LIKE '%(co-production)%' OR mc.note L... | job |
Select MAX(t.title) As movie_title From keyword As k, movie_info As mi, movie_keyword As mk, title As t Where t.id = mk.movie_id And t.production_year > 2010 And mk.movie_id = mi.movie_id And k.keyword Like '%sequel%' And k.id = mk.keyword_id And mi.info In ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish',... | job |
SELECT c_first_name, c_last_name, ca_city, bought_city, extended_price, ss_ticket_number, list_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 SUM(ss_quantity) AS store_sales_quantity, s_store_id, i_item_desc, s_store_name, i_item_id, SUM(cs_quantity) AS catalog_sales_quantity, SUM(sr_return_quantity) AS store_returns_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 AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice) AS sum_base_price, l_returnflag, SUM(l_quantity) AS sum_qty, AVG(l_discount) AS avg_disc, l_linestatus, COUNT(1) AS count_order, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice * (1 - l_di... | tpch |
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_shipdate < l_c... | 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 t.production_year > 2010 AND t.id = mk.movie_id AND k.id = mk.keyword_id AND n.id = ci.person_id AND n.name LIKE '%Downey%Robert%' AND ci.m... | 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 t.id = mk.movie_id AND mc.movie_id = t.id AND cn.country_code ='[nl]' AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND cn.id = mc.comp... | 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 ct.id = mc... | job |
Select COUNT(1) From postHistory As ph, posts As p, users As u, badges As b Where u.Id = b.UserId And p.OwnerUserId = u.Id And ph.UserId = u.Id And ph.PostHistoryTypeId = 3 And p.Score >= -7 And u.Reputation >= 1 Limit 100; | stats |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.