text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
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 = c.PostId AND u.Id = b.UserId AND u.Id = p.OwnerUserId AND p.Id = ph.PostId AND p.Score <= 192 AND p.Id = v.PostId | stats |
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.production_year > 2000 AND mi.movie_id = mi_idx.movie_id AND it2.inf... | job |
SELECT s_store_name, s_store_id, i_item_desc, MAX(ss_net_profit) AS store_sales_profit, MAX(sr_net_loss) AS store_returns_loss, MAX(cs_net_profit) AS catalog_sales_profit, i_item_id FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return... | tpcds |
SELECT COUNT(1) FROM comments AS c, posts AS p, postLinks AS pl, votes AS v WHERE pl.PostId = v.PostId AND p.Id = c.PostId AND c.PostId = pl.PostId AND v.VoteTypeId = 2 AND p.Score >= -3 AND c.CreationDate >= '2010-08-02 23:52:10'::timestamp | stats |
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v Where p.Id = ph.PostId AND p.Id = v.PostId AND p.FavoriteCount >= 0 AND c.Score = 0 AND pl.LinkTypeId = 1 AND p.Id = pl.PostId AND p.Id = c.PostId | stats |
SELECT COUNT(*) FROM comments AS c, votes AS v, badges AS b, users AS u WHERE u.Id = c.UserId AND u.CreationDate >= '2010-07-20 01:27:29'::timestamp AND u.Id = v.UserId AND c.Score = 1 AND u.Id = b.UserId LIMIT 1000; | stats |
with ss as ( select i_manufact_id, sum(ss_ext_sales_price) as total_sales from store_sales inner join date_dim on ss_sold_date_sk = d_date_sk inner join customer_address on ss_addr_sk = ca_address_sk inner join item on ss_item_sk = i_item_sk where d_year = 2002 and i_category in ('Sports') and d_moy = 1 and ca_gmt_offs... | 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 ci.movie_id = mc.movie_id AND mk.keyword_id = k.id AND t.episode_nr < 100 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 = c.PostId AND c.Score = 0 AND p.Id = ph.PostId AND p.Id = pl.PostId AND p.Id = v.PostId AND pl.LinkTypeId = 1 AND p.FavoriteCount >= 0 LIMIT 20; | 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 ci.note LIKE '%(uncredited)%' AND t.id = mc.movie_id AND ct.id = mc.company_type_id AND ci.note LIKE... | 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 k.keyword ='character-name-in-title' AND cn.id = mc.company_id AND mk.keyword_id = k.id AND t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND mc.movie_id ... | job |
SELECT ss_ticket_number, list_price, extended_price, extended_tax, ca_city, bought_city, c_last_name, c_first_name FROM ( SELECT ss_ticket_number, ss_customer_sk, ca_city AS bought_city, SUM(ss_ext_sales_price) AS extended_price, SUM(ss_ext_list_price) AS list_price, SUM(ss_ext_tax) AS extended_tax FROM store_sales JOI... | tpcds |
SELECT cc_name AS call_center_name, SUM(cr_net_loss) AS returns_loss, cc_manager AS manager, cc_call_center_id AS call_center FROM call_center JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk JOIN date_dim ON cr_returned_date_sk = d_date_sk JOIN customer ON cr_returning_customer_sk = c_customer_sk JOIN cus... | tpcds |
SELECT 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 t.id = mi.movie_id AND it.info = 'bottom 10 rank' AND (mc.note LIKE '%(co-production)%' OR mc.... | 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 mk.movie_id = mc.movie_id AND t.pro... | job |
SELECT p_type, p_size, p_brand, 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_type NOT LIKE 1 AND p_partkey = ps_partkey AND p_brand <> 1 GROUP BY p_brand... | 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 o_orderkey = l_orderkey AND p_partk... | tpch |
SELECT STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, i_item_id, AVG(sr_return_quantity) AS store_returns_quantityave, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, i_item_desc, AVG(cs_quantity) AS catalog_sales_quantityave, s_state, AVG(ss_quantity) ... | 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 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 t.id = ci.movie_id AND t.production_y... | job |
SELECT i_item_id, s_store_id, SUM(sr_return_quantity) AS store_returns_quantity, s_store_name, SUM(cs_quantity) AS catalog_sales_quantity, SUM(ss_quantity) AS store_sales_quantity, i_item_desc 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 Sum(ss_ext_sales_price) As ext_price, item.i_brand As brand, item.i_brand_id As brand_id, dt.d_year From date_dim As dt Join store_sales On dt.d_date_sk = store_sales.ss_sold_date_sk Join item On store_sales.ss_item_sk = item.i_item_sk Where item.i_manager_id = 57 AND dt.d_moy = 12 AND dt.d_year = 2002 Group By ... | 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 mi.movie_id = mi_idx.movie_id AND kt.id = t.kind_id AND t.id = mi.movi... | 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 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 o_orderkey = l_orderkey AND ps_suppkey = l_suppkey AND p_name... | 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 k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_id AND t.id = ci.movie_id AND k.id = mk.keyword_i... | job |
SELECT s_acctbal, p_partkey, p_mfgr, s_name, s_phone, n_name, s_comment, s_address 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 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 mc.movie_id = t.id AND k.keyword ='character-name-IN-title' AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND t.id = mk.mo... | 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 o_orderkey = l_orderkey AND s_nationkey = n_nationkey AND p_n... | tpch |
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE mi.movie_id = t.id AND it.info = 'rating' AND k... | 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.movie_id AND cn.country_code = '[us]' AND t.production_year ... | 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 ci.movie_id = t.id AND t.id = mk.movie_id AND an.person_id = ... | 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 c.UserId = u.Id AND b.UserId = u.Id AND p.Id = v.PostId AND p.Id = c.PostId AND p.Id = ph.PostId AND p.Score <= 40 AND p.Id = pl.RelatedPostId AND pl.LinkTypeId = 1 | stats |
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 t.id = mc.movie_id AND it.id = mi.info_type_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND t.id = mi.movie_id AND ct.kind = 'producti... | 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 t.id = ci.movie_id AND n.name LIKE '%Downey%Robert%' AND k.k... | job |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE s_nationkey = n_nationkey AND c_custkey = o_custkey AND l_suppkey = s_suppkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND c_nationkey = s_nationkey AND n_regionkey = r_regionkey AND l_o... | tpch |
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where t.id = mk.movie_id And k.keyword ='character-name-In-title' And mc.movie_id = mk.movie_id And cn.country_code ='[nl]' And mc.movie_id = t.id And cn.id = mc.company_id And mk.keyword_id ... | 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 ( (n1.n_name = 1 AND n2.n_name = 1... | 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 p_partkey = l_partkey AND p_name LIKE 1 ) AS profit AND s_sup... | tpch |
Select s_address, s_name, total_revenue, s_phone, s_suppkey From supplier, revenue0 Where s_suppkey = supplier_no And total_revenue = ( Select Max(total_revenue) From revenue0 ) Order By s_suppkey | tpch |
SELECT MIN(n.name) AS voicing_actress, MIN(t.title) AS voiced_movie FROM aka_name AS an, char_name AS chn, cast_info AS ci, company_name AS cn, info_type AS it, movie_companies AS mc, movie_info AS mi, name AS n, role_type AS rt, title AS t WHERE t.production_year > 2000 AND n.id = ci.person_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 mi.info LIKE 'USA:%200%' AND it2.id = mi.info_type_id AND t.id = mi_id... | job |
Select Min(mi_idx.info) As rating, Min(t.title) As movie_title From info_type As it, movie_info_idx As mi_idx, title As t Where t.production_year BETWEEN 2000 AND 2005 AND it.id = mi_idx.info_type_id AND it.info ='rating' AND mi_idx.info > '8.0' AND t.id = mi_idx.movie_id | job |
Select Avg(ss_quantity), Avg(ss_ext_sales_price), Avg(ss_ext_wholesale_cost), Sum(ss_ext_wholesale_cost) From store_sales JOIN store On s_store_sk = ss_store_sk JOIN customer_demographics On cd_demo_sk = ss_cdemo_sk JOIN household_demographics On hd_demo_sk = ss_hdemo_sk JOIN customer_address On ca_address_sk = ss_addr... | tpcds |
SELECT 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 store_sales ON ss_item_sk = i_item_sk WHERE d_date BETWEEN CAST('2002-01-23' AS DATE) AND (CAST('2002-01-23' AS DATE) + INTERVAL '60 days') AND i_manufact_id... | tpcds |
Select Min(mi_idx.info) As rating, Min(t.title) As movie_title From info_type As it, movie_info_idx As mi_idx, title As t Where t.production_year Between 2000 And 2005 And it.id = mi_idx.info_type_id And t.id = mi_idx.movie_id And it.info ='rating' And mi_idx.info > '8.0' | job |
Select Min(cn.name) As movie_company, Min(mi_idx.info) As rating, Min(t.title) As western_violent_movie From company_name As cn, company_type As ct, info_type As it1, info_type As it2, keyword As k, kind_type As kt, movie_companies As mc, movie_info As mi, movie_info_idx As mi_idx, movie_keyword As mk, title As t Where... | job |
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE cn.id = mc.company_id AND mc.movie_id = t.id AND k.keyword ='character-name-IN-title' AND mk.keyword_id = k.id AND cn.country_code ='[de]' AND t.id = mk.movie_id AND mc.movie_id = mk.mo... | 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 ct.kind = 'production companies' AND t.id = mc.movie_id AND mc.movie_id = mi_idx.movie_id AND it.info = 't... | 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.id = ml.link_type_id AND k.keywo... | job |
Select s_suppkey, s_address, total_revenue, s_name, s_phone From supplier, revenue0 Where s_suppkey = supplier_no And total_revenue = ( Select Max(total_revenue) From revenue0 ) Order By s_suppkey | tpch |
SELECT MIN(t.title) AS movie_title FROM 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', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German']) AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND... | job |
SELECT p_type, COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_size, p_brand FROM partsupp, part WHERE p_size IN (1, 1, 1, 1, 1, 1, 1, 1) AND p_brand <> 1 AND p_type NOT LIKE 1 AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) AND p_partkey = ps_partkey GROUP BY p_brand... | tpch |
SELECT cc_call_center_id AS call_center, cc_name AS call_center_name, cc_manager AS manager, SUM(cr_net_loss) AS returns_loss FROM call_center INNER JOIN catalog_returns ON cr_call_center_sk = cc_call_center_sk INNER JOIN date_dim ON cr_returned_date_sk = d_date_sk INNER JOIN customer ON cr_returning_customer_sk = c_cu... | tpcds |
SELECT COUNT(*) FROM comments AS c, votes AS v, badges AS b, users AS u WHERE c.Score = 1 AND u.Id = v.UserId AND u.CreationDate >= '2010-07-20 01:27:29'::timestamp AND u.Id = c.UserId AND u.Id = b.UserId | stats |
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 |
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_custkey = o_custkey AND l_orderkey = o_orderkey AND c_nationkey = n_nationkey AND o_orderdate < ... | tpch |
SELECT ca_city, bought_city, ss_ticket_number, c_last_name, extended_tax, list_price, c_first_name, extended_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(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.note NOT LIKE '%(USA)%' AND t.id = mc.movie_id AND ci.movie_id = mc.movie_id AND ci.role_id = rt.id AND n1.n... | job |
SELECT s_suppkey, total_revenue, s_phone, s_address, s_name FROM supplier, revenue0 WHERE total_revenue = ( SELECT MAX(total_revenue) FROM revenue0 ) AND s_suppkey = supplier_no ORDER BY s_suppkey | tpch |
Select Min(t.title) As western_sequel, Min(lt.link) As link_type, Min(cn.name) As from_company From company_name As cn, company_type As ct, info_type As it, keyword As k, link_type As lt, movie_companies As mc, movie_info As mi, movie_keyword As mk, movie_link As ml, title As t Where lt.id = ml.link_type_id And cn.id =... | 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 i_item_id, i_item_desc, s_store_id, s_store_name, Sum(ss_quantity) As store_sales_quantity, Sum(sr_return_quantity) As store_returns_quantity, Sum(cs_quantity) As catalog_sales_quantity From store_sales Join store_returns On ss_customer_sk = sr_customer_sk And ss_item_sk = sr_item_sk And ss_ticket_number = sr_ti... | tpcds |
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE kt.kind = 'movie' AND at.movie_id = mi_idx.movie_id AND t.production_y... | job |
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND pi.person_id = ci.person_id AND it.id = pi.info_type_id ... | job |
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE r_name = 1 AND s_supp... | tpch |
SELECT AVG(ss_quantity), AVG(ss_ext_sales_price), AVG(ss_ext_wholesale_cost), SUM(ss_ext_wholesale_cost) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr... | tpcds |
Select Min(t.title) As movie_title From company_name As cn, keyword As k, movie_companies As mc, movie_keyword As mk, title As t Where mc.movie_id = mk.movie_id AND k.keyword ='character-name-In-title' AND mc.movie_id = t.id AND cn.id = mc.company_id AND cn.country_code ='[nl]' AND t.id = mk.movie_id AND mk.keyword_id ... | 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.id = mi_idx.info_type_id AND mi.movie_id = mi_idx.movie_id AND t.i... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE (mc.note LIKE '%(co-production)%' OR mc.note LIKE '%(presents)%') AND it.id = mi_idx.info_type_id AND it.i... | job |
SELECT COUNT(1) FROM comments AS c, votes AS v, badges AS b, users AS u WHERE u.Id = v.UserId AND c.Score = 1 AND u.CreationDate >= '2010-07-20 01:27:29'::timestamp AND u.Id = b.UserId AND u.Id = c.UserId LIMIT 10; | stats |
SELECT MIN(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE ci.note = '(voice: English version)' AND ci.movie_id = t.id AND t.id = mc.movie_id AND cn.country_code = '[jp]'... | job |
Select s_name, Count(*) As numwait From supplier, lineitem l1, orders, nation Where n_name = 1 And s_suppkey = l1.l_suppkey And o_orderkey = l1.l_orderkey And s_nationkey = n_nationkey And o_orderstatus = 'F' And Not Exists ( Select * From lineitem l3 Where l3.l_orderkey = l1.l_orderkey And l3.l_suppkey <> l1.l_suppkey... | tpch |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE t.id = mc.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND ct.id = mc.company_type_... | job |
select min(t.title) as movie_title from company_name as cn, keyword as k, movie_companies as mc, movie_keyword as mk, title as t where cn.id = mc.company_id AND cn.country_code ='[de]' AND mc.movie_id = t.id AND k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND t.id = mk.mo... | job |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE r_name = 1 AND n_regionkey = r_regionkey AND c_custkey = o_custkey AND l_orderkey = o_orderkey AND c_nationkey = s_nationkey AND l_suppkey = s_suppkey AND o_orderdate >= DATE 1 AND s_nationk... | tpch |
select s_name, s_address from supplier, nation where n_name = 1 and s_nationkey = n_nationkey and s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like 1 ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppke... | 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 cn.country_code = '[us]' AND an.person_id =... | job |
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE... | job |
SELECT STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, COUNT(ss_quantity) AS store_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, s_state, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, AVG(ss_quantity) AS s... | tpcds |
WITH _q AS ( SELECT MIN(t.title) AS american_movie FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info AS mi, title AS t WHERE t.id = mi.movie_id AND t.id = mc.movie_id AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' AND mc.movie_id = mi.movie_id AND it.info = 'bottom 10 rank' AND ct.... | job |
SELECT MIN(n.name) AS actor_name, MIN(k.keyword) AS movie_keyword, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = mk.movie_id AND k.id = mk.keyword_id AND t.production_year > 2010 AND k.keyword = 'marvel-cinematic-universe' AND n.id = ci.person_i... | job |
with _q as ( select i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_quantity) as store_sales_quantity, sum(sr_return_quantity) as store_returns_quantity, sum(cs_quantity) as catalog_sales_quantity from store_sales join store_returns on ss_customer_sk = sr_customer_sk and ss_item_sk = sr_item_sk and ss_ticket_n... | 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 ='[sm]' AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND t.id = mk.movie_id AND mc.movie_id = t.id AND k.keyword ='character-name-IN-... | job |
SELECT i_item_desc, s_store_id, MAX(sr_net_loss) AS store_returns_loss, MAX(ss_net_profit) AS store_sales_profit, s_store_name, MAX(cs_net_profit) AS catalog_sales_profit, i_item_id FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return... | tpcds |
SELECT MIN(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 it.info = 'rating' AND mi.movie_id = t.id AND i... | job |
SELECT MAX(t.production_year) AS movie_year, MAX(mc.note) AS production_note, MAX(t.title) AS movie_title FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi_idx.movie_id AND it.info = 'top 250 rank' AND ct.kind = 'production companies' AND mc.note NOT L... | job |
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE... | job |
Select 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 + INTERVAL '1' YEAR A... | tpch |
SELECT i_item_id, i_item_desc, s_store_id, s_store_name, SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity FROM store_sales JOIN store_returns ON ss_customer_sk = sr_customer_sk AND ss_item_sk = sr_item_sk AND ss_ticket_number = sr_ti... | tpcds |
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE o_orderstatus = 'F' AND s_nationkey = n_nationkey AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND s_suppkey = l1.l_suppkey AND l1.l_receiptdate > l1.l_commitdate AND NOT ... | tpch |
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 |
SELECT c_preferred_cust_flag, cnt, c_last_name, c_first_name, ss_ticket_number, c_salutation 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 Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, badges As b, users As u Where p.Id = v.PostId And p.Id = ph.PostId And p.Id = pl.RelatedPostId And c.UserId = u.Id And b.UserId = u.Id And p.Score <= 40 And p.Id = c.PostId And pl.LinkTypeId = 1 | stats |
select sum(l_extendedprice * (1 - l_discount)) as revenue, n_name from customer, orders, lineitem, supplier, nation, region where r_name = 1 and l_suppkey = s_suppkey and c_nationkey = s_nationkey and n_regionkey = r_regionkey and l_orderkey = o_orderkey and o_orderdate < DATE 1 + INTERVAL '1' YEAR and o_orderdate >= D... | 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 ci.movie_id = mk.movie_id AND n.id = ci.person_id AND k.id = mk.keyword_id AND t.id = mk.movie_id AND t.id = ci.movie_id AND t.production_y... | job |
SELECT SUM(l_extendedprice) / 7.0 AS avg_yearly FROM lineitem, part WHERE p_container = 1 AND p_brand = 1 AND l_quantity < ( SELECT 0.2 * AVG(l_quantity) FROM lineitem WHERE l_partkey = p_partkey ) AND p_partkey = l_partkey LIMIT 100; | 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 cn.id = mc.company_id AND cn.country_code = '[ru]' AND ci.movie_id = mc.movie_id AND ci.note LIKE '%... | job |
Select Sum(l_extendedprice) As sum_base_price, Sum(l_extendedprice * (1 - l_discount)) As sum_disc_price, Sum(l_quantity) As sum_qty, Avg(l_quantity) As avg_qty, Sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) As sum_charge, Avg(l_extendedprice) As avg_price, Avg(l_discount) As avg_disc, l_returnflag, l_linestatu... | tpch |
SELECT i_item_desc, s_store_name, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity, i_item_id, SUM(ss_quantity) AS store_sales_quantity, 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.