text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
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.country_code = '[de]' AND mi.movie_id = t.id... | job |
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v Where pl.LinkTypeId = 1 AND c.Score = 0 AND p.Id = ph.PostId AND p.Id = c.PostId AND p.FavoriteCount >= 0 AND p.Id = pl.PostId AND p.Id = v.PostId | stats |
SELECT AVG(ss_list_price) AS agg2, AVG(ss_quantity) AS agg1, i_item_id, AVG(ss_sales_price) AS agg4, 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 MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.id = mi.info_type_id AND mc.movie_id = mi.movie_id AND ct.kind = 'production companies' AND it.info = 'bottom... | job |
SELECT i_item_desc, SUM(sr_return_quantity) AS store_returns_quantity, SUM(ss_quantity) AS store_sales_quantity, s_store_id, s_store_name, i_item_id, SUM(cs_quantity) AS catalog_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti... | tpcds |
SELECT AVG(ss_quantity) AS store_sales_quantityave, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, COUNT(sr_return_quantity) AS store_returns_quantitycount, AVG(cs_quantity) AS catalog_sales_quantityave, COUNT(ss_quantity... | 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(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 cn.country_code ='[de]' AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND mc.movie_id = t.id AND cn.id = mc.company_id AND k.keyword ='character-name-in-... | job |
SELECT i_item_id, SUM(ss_quantity) AS store_sales_quantity, s_store_id, SUM(cs_quantity) AS catalog_sales_quantity, i_item_desc, SUM(sr_return_quantity) AS store_returns_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 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 s_suppkey = l_suppkey AND p_nam... | tpch |
SELECT COUNT(*) FROM comments AS c, posts AS p, postHistory AS ph, votes AS v, users AS u WHERE c.UserId = p.OwnerUserId AND p.AnswerCount >= 0 AND u.Id = c.UserId AND p.Score <= 13 AND p.OwnerUserId = ph.UserId AND ph.UserId = v.UserId | stats |
SELECT o_orderdate, c_custkey, SUM(l_quantity), o_totalprice, o_orderkey, 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 SUM(l_quantity) AS sum_qty, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_extendedprice) AS avg_price, AVG(l_quantity) AS avg_qty, l_returnflag, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice) AS sum_base_price, AVG(l_discount) AS avg_disc, COUNT(*) AS... | 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 cn.id = mc.company_id AND mc.movie_id = t.id AND mc.movie_id = mk.movie_id AND cn.country_code ='[de]' AND k.keyword ='character-name-in-title' AND mk.keyword_id ... | job |
Select Count(*) From comments As c, postHistory As ph, badges As b, votes As v, users As u Where ph.PostHistoryTypeId = 12 AND u.Id = b.UserId AND b.UserId = ph.UserId AND v.UserId = c.UserId AND u.UpVotes = 0 AND ph.UserId = v.UserId | stats |
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 t.id = mi.movie_id AND t.id = mk.movie_id AND k.id = mk.keyword_id AND k.keyword LIKE '%sequel%' AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany',... | job |
SELECT MIN(t.title) AS western_violent_movie, MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating 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(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 it.info = 'top 250 rank' AND it.id = mi_idx.info_type_id AND (mc.note LI... | 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 ct.kind = 'production companies' AND t.id = mi.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND it.id = mi.info_type_id AND (mc.n... | job |
SELECT i_item_id, i_item_desc, i_current_price 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 i_current_price BETWEEN 75 AND 75 + 30 AND d_date BETWEEN CAST('2000-05-01' AS DATE) AND (CAST('2000-05-01' AS DATE) + INTERVAL '... | 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.country_code ='[de]' And t.id = mk.movie_id And cn.id = mc.company_id And mc.movie_id = t.id And mk.keyword_id = k.id And k.keyword ='character-name-In-title' And mc.movie_id = mk.mo... | job |
select sum(ss_ext_sales_price) as ext_price, item.i_brand as brand, dt.d_year, item.i_brand_id as brand_id from date_dim as dt inner join store_sales on dt.d_date_sk = store_sales.ss_sold_date_sk inner join item on store_sales.ss_item_sk = item.i_item_sk where dt.d_moy = 11 and dt.d_year = 1999 and item.i_manager_id = ... | 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 ct.kind = 'productio... | job |
SELECT CAST(promotions AS DECIMAL(15, 4)) / CAST(total AS DECIMAL(15, 4)) * 100, total, promotions 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(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE ci.movie_id = mc.movie_id AND n1.name NOT LIKE '%Yu%' AND t.id = mc.movie_id AND ci.note = '(voice: English ver... | 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 it1.info = 'rating' And at.movie_id = mi_idx.movie_id And cn.id = mc.c... | job |
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE ci.movie_id = mc.movie_id AND ct.id = mc.company_type_id AND rt.id = ci.role_id AND rt.role = 'actor... | job |
Select p_brand, p_type, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where 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_partkey = ps_partkey AND p_brand <> 1 AND p_type Not Like 1 Group By p_brand... | tpch |
SELECT SUM(ss_quantity) AS store_sales_quantity, i_item_id, s_store_name, SUM(sr_return_quantity) AS store_returns_quantity, s_store_id, i_item_desc, SUM(cs_quantity) AS catalog_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti... | tpcds |
SELECT o_orderkey, o_orderdate, c_custkey, c_name, SUM(l_quantity), 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 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 n.gender = 'f' AND ci.note LIKE '%(vo... | 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_type LIKE 1 AND s_nationkey = n_nationkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppk... | 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 mk.movie_id = ci.movie_id AND t.id = mc.movie_id AND ci.role_... | job |
SELECT COUNT(1) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.Id = c.PostId AND u.Id = b.UserId AND u.Id = p.OwnerUserId AND p.Id = v.PostId AND p.Id = ph.PostId AND p.ViewCount >= 0 AND p.Score <= 192 | stats |
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 t.id = mi_idx.movie_id AND (mc.note Like '%(co-production)%' Or mc.note Like ... | 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 t.id = mc.movie_id AND t.id = mk.mo... | job |
SELECT MIN(t.production_year) AS movie_year, MIN(mc.note) AS production_note, 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 ct.id = mc.company_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND it.id = mi_idx.i... | job |
SELECT supp_nation, cust_nation, l_year, SUM(volume) AS revenue FROM ( SELECT n1.n_name AS supp_nation, n2.n_name AS cust_nation, EXTRACT(YEAR FROM l_shipdate) AS l_year, l_extendedprice * (1 - l_discount) AS volume FROM supplier, lineitem, orders, customer, nation n1, nation n2 WHERE c_nationkey = n2.n_nationkey AND l... | tpch |
SELECT MAX(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 mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND mc.movie_id = t.id AND cn.country_code =... | job |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.ViewCount >= 0 AND p.Id = v.PostId AND p.Id = ph.PostId AND u.Id = b.UserId AND u.Id = p.OwnerUserId AND p.Score <= 192 AND p.Id = c.PostId | stats |
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 it.info = 'rat... | job |
SELECT i_item_id, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity, s_store_name, SUM(ss_quantity) AS store_sales_quantity, s_store_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 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 s_suppkey = l_suppkey... | 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.id = ci.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Hemsworth%Chris%' AND k.id = mk.keyword_id AND ci.movie_id... | job |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE p.Id = v.PostId AND p.FavoriteCount >= 0 AND p.Id = pl.PostId AND pl.LinkTypeId = 1 AND p.Id = ph.PostId AND c.Score = 0 AND p.Id = c.PostId LIMIT 50; | 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 = ph.PostId AND p.Id = c.PostId AND pl.LinkTypeId = 1 AND b.UserId = c.UserId AND c.Score = 0 AND p.Id = v.PostId AND p.Id = pl.RelatedPostId | 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 it.info = 'release dates' AND ci.person_id = an.person_id AND ci.role_id ... | job |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.Id = ph.PostId AND u.Id = p.OwnerUserId AND p.ViewCount >= 0 AND u.Id = b.UserId AND p.Id = v.PostId AND p.Score <= 192 AND p.Id = c.PostId | stats |
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', 'Denish', 'Norwegian', 'German']) AND t.id = mi.movie_id AND k.keyword LIKE '%sequel%' AND t.id = mk.movie_id AND k.id = mk.keyword_id AN... | job |
Select Min(mi_idx.info) As rating, Min(t.title) As movie_title From info_type As it, movie_info_idx As mi_idx, title As t Where it.id = mi_idx.info_type_id And t.id = mi_idx.movie_id And it.info ='rating' And t.production_year Between 2000 And 2010 And mi_idx.info > '7.0' | job |
select l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem where l_orderkey = o_orderkey AND c_mktsegment = 1 AND l_shipdate > DATE 1 AND c_custkey = o_custkey AND o_orderdate < DATE 1 group by l_orderkey, o_orderdate, o_shippriority order by reven... | tpch |
WITH year_total AS ( SELECT c_login AS customer_login, c_last_name AS customer_last_name, c_birth_country AS customer_birth_country, c_preferred_cust_flag AS customer_preferred_cust_flag, d_year AS dyear, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, 's... | tpcds |
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE... | job |
select count(1) from comments as c, postHistory as ph, votes as v, users as u where u.Id = v.UserId and u.Views >= 0 and v.UserId = ph.UserId and u.UpVotes <= 123 and ph.UserId = c.UserId and u.DownVotes >= 0 | stats |
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 mi.movie_id = mc.movie_id AND it.info = 'rating... | 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 l_shipmode IN ... | tpch |
SELECT s_store_id, MAX(ss_net_profit) AS store_sales_profit, s_store_name, MAX(sr_net_loss) AS store_returns_loss, i_item_desc, i_item_id, MAX(cs_net_profit) AS catalog_sales_profit FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return... | tpcds |
select min(chn.name) as uncredited_voiced_character, min(t.title) as russian_movie from char_name as chn, cast_info as ci, company_name as cn, company_type as ct, movie_companies as mc, role_type as rt, title as t where cn.id = mc.company_id and t.id = mc.movie_id and ci.note like '%(uncredited)%' and ci.note like '%(v... | job |
SELECT AVG(cs_coupon_amt) AS agg3, AVG(cs_sales_price) AS agg4, AVG(cs_list_price) AS agg2, i_item_id, AVG(cs_quantity) AS agg1 FROM catalog_sales JOIN customer_demographics ON cs_bill_cdemo_sk = cd_demo_sk JOIN date_dim ON cs_sold_date_sk = d_date_sk JOIN item ON cs_item_sk = i_item_sk JOIN promotion ON cs_promo_sk = ... | tpcds |
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE kt.kind = 'movie' AND kt.id = t.kind_id AND ct.... | job |
Select Count(1) From votes As v, posts As p, badges As b, users As u Where p.Id = v.PostId And u.Id = p.OwnerUserId And u.Id = b.UserId And p.Score <= 22 And u.Reputation >= 1 Limit 20; | stats |
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 = v.PostId AND p.FavoriteCount >= 0 AND p.Id = ph.PostId AND c.Score = 0 AND p.Id = pl.PostId AND p.Id = c.PostId | 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 = ph.PostId and p.Id = v.PostId and b.UserId = c.UserId and c.Score = 0 and pl.LinkTypeId = 1 and p.Id = c.PostId and p.Id = pl.RelatedPostId | stats |
select max(chn.name) as uncredited_voiced_character, max(t.title) as russian_movie from char_name as chn, cast_info as ci, company_name as cn, company_type as ct, movie_companies as mc, role_type as rt, title as t where ci.note like '%(voice)%' and ci.note like '%(uncredited)%' and cn.country_code = '[ru]' and rt.role ... | 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 join date_dim on ss_sold_date_sk = d_date_sk join store on ss_store_sk = s_store_sk join household_demographics on ss_hdemo_sk = hd_demo_sk where ... | tpcds |
SELECT MIN(t.title) AS german_movie, MIN(mi.info) AS release_date, MIN(miidx.info) AS rating FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE kt.id = t.kind_id AND miidx.movie_id = mc.movie... | job |
Select p_type, p_brand, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where 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_type Not Like 1 AND p_size In (1, 1, 1, 1, 1, 1, 1, 1) Group By p_brand... | tpch |
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_shipdate < l_commitdate AND l_receiptdate ... | 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 it.info = 'top 250 rank' AND t.id = mc.movie_id AND ct.kind = 'production companies' AND t.id = mi_idx.mov... | 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 n.name LIKE '%Downey%Robert%' AND k.keyword = 'marvel-cinematic-universe' AND ci.movie_id = mk.movie_id AND t.... | 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 n_regionkey = r_regionkey AND p_size = 1 AND r_name = 1 AND s_suppkey = ps_suppkey AND p_type LIKE 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM part... | tpch |
Select Count(*) From postHistory As ph, posts As p, votes As v, badges As b, users As u, comments As c Where p.ViewCount >= 0 AND p.Score <= 192 AND u.Id = b.UserId AND u.Id = p.OwnerUserId AND p.Id = v.PostId AND p.Id = ph.PostId AND p.Id = c.PostId LIMIT 50; | stats |
SELECT AVG(ss_quantity) AS store_sales_quantityave, AVG(cs_quantity) AS catalog_sales_quantityave, AVG(sr_return_quantity) AS store_returns_quantityave, s_state, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, i_item_desc, STDDEV_SAMP(sr_return_quantity) AS store_returns_quantitystdev, STDDEV_SA... | tpcds |
WITH _q AS ( SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address... | tpcds |
WITH year_total AS ( SELECT c_preferred_cust_flag AS customer_preferred_cust_flag, c_last_name AS customer_last_name, d_year AS dyear, 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_birth_country... | tpcds |
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where mc.movie_id = t.id And cn.country_code ='[nl]' And k.keyword ='character-name-In-title' And mk.keyword_id = k.id And cn.id = mc.company_id And mc.movie_id = mk.movie_id And t.id = mk.mo... | job |
SELECT MIN(t.title) AS western_violent_movie, MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating 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 c_first_name, bought_city, list_price, extended_price, c_last_name, ss_ticket_number, ca_city, 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 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 > 2005 AND k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German']... | 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.id = mk.keyword_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') AND t.id = mi.movie_id AND mk.movie_id = mi.movie_id AND k.keyword LIKE '%sequel%' AND ... | 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 ci.movie_id = mk.movie_id AND mk.keyword_id = k.id AND t.episode_nr < 100 AND ci.movie_id =... | job |
Select p_brand, p_type, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where p_partkey = ps_partkey And p_size In (1, 1, 1, 1, 1, 1, 1, 1) And ps_suppkey Not In ( Select s_suppkey From supplier Where s_comment Like '%Customer%Complaints%' ) And p_type Not Like 1 And p_brand <> 1 Group By p_brand... | tpch |
SELECT s_phone, n_name, p_partkey, s_name, s_acctbal, s_address, s_comment, p_mfgr 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 COUNT(*) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE p.Id = c.PostId AND p.Id = ph.PostId AND p.ViewCount >= 0 AND p.Id = v.PostId AND u.Id = p.OwnerUserId AND p.Score <= 192 AND u.Id = b.UserId | stats |
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE t.id = mc.movie_id AND lt.id = ml.l... | job |
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 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_shipdate < l_commitdate And l_receiptdate ... | tpch |
SELECT MAX(sr_net_loss) AS store_returns_loss, i_item_desc, s_store_name, s_store_id, i_item_id, MAX(ss_net_profit) AS store_sales_profit, MAX(cs_net_profit) AS catalog_sales_profit FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return... | tpcds |
SELECT 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 l_shipdate BETWEEN DATE '1995-01-0... | 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_custkey = o_custkey AND c_nation... | tpch |
SELECT o_orderdate, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_shippriority, l_orderkey FROM customer, orders, lineitem WHERE c_mktsegment = 1 AND c_custkey = o_custkey AND o_orderdate < DATE 1 AND l_orderkey = o_orderkey AND l_shipdate > DATE 1 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 k.keyword Like '%sequel%' And mi.info In ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Denish', 'Norwegian', 'German') And t.id = mk.movie_id And t.id = mi.movie_id And k.id = mk.keyword_id And mk.movi... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND t.id = mi_idx.movie_id AND it.info =... | 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 t.id = mi_idx.movie_id AND ct.id = mc.company_... | job |
SELECT s_address, total_revenue, s_suppkey, s_phone, 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(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 ct.id = mc.company_type_id AND it.i... | job |
SELECT c_last_name, c_preferred_cust_flag, c_salutation, c_first_name, cnt, ss_ticket_number FROM ( SELECT ss_ticket_number, ss_customer_sk, COUNT(*) AS cnt FROM store_sales JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN store ON ss_store_sk = s_store_sk JOIN household_demographics ON ss_hdemo_sk = hd_demo_sk WHERE ... | tpcds |
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE k.keyword = 'character-name-in-title' AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id ... | job |
SELECT MIN(chn.name) AS uncredited_voiced_character, MIN(t.title) AS russian_movie FROM char_name AS chn, cast_info AS ci, company_name AS cn, company_type AS ct, movie_companies AS mc, role_type AS rt, title AS t WHERE cn.country_code = '[ru]' AND cn.id = mc.company_id AND ct.id = mc.company_type_id AND ci.note LIKE '... | 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.info = 'bottom 10 rank' AND it.id = mi.info_type_id AND t.id = mi.movie_id AND ct.id = mc.company_type_id AND ct.kind = 'production companies' AND t.id = mc.movie_id AND mc.movie_... | job |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.