text stringlengths 84 1.49k | benchmark stringclasses 4
values |
|---|---|
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 rt.id = ci.role_id AND cn.country_code = '[ru]' AND ci.movie_id = mc.movie_id... | job |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE c_nationkey = s_nationkey AND o_orderdate < DATE 1 + INTERVAL '1' YEAR AND r_name = 1 AND l_orderkey = o_orderkey AND n_regionkey = r_regionkey AND l_suppkey = s_suppkey AND c_custkey = o_cu... | tpch |
SELECT MIN(cn.name) AS movie_company, MIN(mi_idx.info) AS rating, MIN(t.title) AS western_violent_movie FROM company_name AS cn, company_type AS ct, info_type AS it1, info_type AS it2, keyword AS k, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, movie_keyword AS mk, title AS t WHERE... | job |
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE cn.country_code = '[us]' AND it.inf... | job |
with ss as ( select i_manufact_id, sum(ss_ext_sales_price) as total_sales from store_sales join date_dim on ss_sold_date_sk = d_date_sk join customer_address on ss_addr_sk = ca_address_sk join item on ss_item_sk = i_item_sk where d_moy = 11 and ca_gmt_offset = -8 and d_year = 2001 and i_category in ('Sports') group by ... | 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 c_nationkey = n2.n_nationkey AND s... | 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 mc.note NOT LIKE '%(as Metro-Goldwy... | job |
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where mi.info in ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') and mk.movie_id = mi.movie_id and t.production_year > 2010 and k.keyword like '%sequel%' and k.id = mk.keyword_id... | job |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE k.keyword = 'marvel-cinematic-universe' AND t.production_year > 2010 AND n.id = ci.person_id AND t.id = ci.movie_id AND t.id = mk.movie_id ... | 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(*) As cnt From store_sales Inner Join date_dim On ss_sold_date_sk = d_date_sk Inner Join store On ss_store_sk = s_store_sk Inner Join household_demographics On ss_hdemo_sk =... | tpcds |
Select Avg(sr_return_quantity) As store_returns_quantityave, Count(cs_quantity) As catalog_sales_quantitycount, STDDEV_SAMP(sr_return_quantity) As store_returns_quantitystdev, STDDEV_SAMP(sr_return_quantity) / Avg(sr_return_quantity) As store_returns_quantitycov, STDDEV_SAMP(cs_quantity) / Avg(cs_quantity) As catalog_s... | tpcds |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, users AS u, badges AS b WHERE ph.UserId = u.Id AND ph.PostHistoryTypeId = 3 AND p.Score >= -7 AND u.Id = b.UserId AND p.OwnerUserId = u.Id AND u.Reputation >= 1 LIMIT 10; | stats |
Select Min(t.title) As russian_movie, Min(chn.name) As uncredited_voiced_character From char_name As chn, cast_info As ci, company_name As cn, company_type As ct, movie_companies As mc, role_type As rt, title As t Where chn.id = ci.person_role_id AND cn.id = mc.company_id AND t.id = mc.movie_id AND ci.movie_id = mc.mov... | job |
SELECT l_orderkey, o_orderdate, SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_shippriority FROM customer, orders, lineitem WHERE o_orderdate < DATE 1 AND c_custkey = o_custkey AND c_mktsegment = 1 AND l_orderkey = o_orderkey AND l_shipdate > DATE 1 GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven... | 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 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 k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Downey%Robert%' AND ci.movie_id = mk.movie_id AND t.id = ... | job |
SELECT AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1, AVG(ss_coupon_amt) AS agg3, i_item_id, AVG(ss_list_price) AS agg2 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 SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share, o_year FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE l_orderkey = o_orderk... | 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 t.production_year > 2005 AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND k.id = mk.keyword_id AND k.keyword LIKE '%sequel%' AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany',... | 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 ml.linked_movie_id = t.id AND lt.link = 'features' AND (n.gender = 'm' OR (n.gender = 'f' AND n.name LIKE 'B%')) AND a... | job |
SELECT n_name, c_comment, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_acctbal, c_custkey, c_address, c_name, c_phone FROM customer, orders, lineitem, nation WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AN... | tpch |
select min(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 at.movie_id = mi.movie_id and cn.id ... | 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 it.info = 'mini biography' AND t.id = ci.movie_id AND pi... | 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 t.id = ci.movie_id AND t.id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND k.id = mk.keyword_id AND ci.mo... | job |
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE t.id = mk.movie_id AND k.id = mk.keyword_id AND mk.movie_id = mi.movie_id AND k.keyword LIKE '%sequel%' AND t.id = mi.movie_id AND t.production_year > 2010 AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany',... | 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 t.episode_nr < 100 AND mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND cn.country_co... | job |
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 c_comment, n_name, c_name, c_acctbal, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_address, c_phone, c_custkey FROM customer, orders, lineitem, nation WHERE c_custkey = o_custkey AND l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AN... | tpch |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE k.id = mk.keyword_id AND t.id = ci.movie_id AND n.id = ci.person_id AND n.name LIKE '%Hemsworth%Chris%' AND t.id = mk.movie_id AND t.produc... | 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 o_orderkey = l_orderkey AND s_nati... | tpch |
SELECT MIN(n.name) AS of_person, MIN(t.title) AS biography_movie FROM aka_name AS an, cast_info AS ci, info_type AS it, link_type AS lt, movie_link AS ml, name AS n, person_info AS pi, title AS t WHERE n.name_pcode_cf BETWEEN 'A' AND 'F' AND ci.person_id = n.id AND t.production_year BETWEEN 1980 AND 1995 AND (n.gender ... | job |
select count(distinct ps_suppkey) as supplier_cnt, p_type, p_brand, p_size from partsupp, part where p_partkey = ps_partkey and p_brand <> 1 and p_type not like 1 and p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) and ps_suppkey not in ( select s_suppkey from supplier where s_comment like '%Customer%Complaints%' ) group b... | tpch |
select count(*) from comments as c, postHistory as ph, badges as b, votes as v, users as u where ph.PostHistoryTypeId = 12 and u.UpVotes = 0 and ph.UserId = v.UserId and v.UserId = c.UserId and b.UserId = ph.UserId and u.Id = b.UserId | stats |
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 count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v where p.FavoriteCount >= 0 AND p.Id = pl.PostId AND pl.LinkTypeId = 1 AND p.Id = c.PostId AND c.Score = 0 AND p.Id = v.PostId AND p.Id = ph.PostId | stats |
SELECT MAX(t.title) AS movie_title, MAX(mc.note) AS production_note, MAX(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.id = mc.company_type_id AND mc.movie_id = mi_idx.movie_id AND it.info = 'top 250 rank' AND mc.note NOT ... | job |
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE NOT EXISTS ( SELECT * FROM lineitem l3 WHERE l3.l_orderkey = l1.l_orderkey AND l3.l_suppkey <> l1.l_suppkey AND l3.l_receiptdate > l3.l_commitdate ) AND s_nationkey = n_nationkey AND n_name = 1 AND o_orderstatus = 'F' AND o_orderkey = l... | tpch |
SELECT MIN(mi_idx.info) AS rating, MIN(t.title) AS northamerican_movie FROM aka_title AS at, company_name AS cn, info_type AS it1, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS mi_idx, title AS t WHERE at.title LIKE '%Champion%' AND mi_idx.info < '3.5' 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 at.title LIKE '%Champion%' AND at.movie_id = mc.movie_id AND t.id = mc... | 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 cn.id = mc.company_id AND miidx.movie_id = mc.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 mc.movie_id = t.id AND mk.keyword_id = k.id AND t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND k.keyword ='character-name-In-title' AND cn.country_code ='[de]' AND cn.id = mc.comp... | job |
Select cntrycode, Count(1) As numcust, Sum(c_acctbal) As totacctbal From ( Select SUBSTRING(c_phone From 1 FOR 2) As cntrycode, c_acctbal From customer Where SUBSTRING(c_phone From 1 FOR 2) In (1, 1, 1, 1, 1, 1, 1) ) And Not Exists ( Select * From orders Where o_custkey = c_custkey ) ) As custsale And c_acctbal > ( Sel... | 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.note LIKE '%(Japan)%' AND ci.note = '(voice: English version)' AND n1.id = ci.person... | job |
With _q As ( Select Count(1) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, users As u Where p.Id = v.PostId AND p.Id = pl.PostId AND u.Id = p.OwnerUserId AND p.Id = c.PostId AND p.PostTypeId = 1 AND p.AnswerCount >= 0 ) Select * From _q AND p.Id = ph.PostId | stats |
SELECT COUNT(DISTINCT ps_suppkey) AS supplier_cnt, p_brand, p_size, p_type FROM partsupp, part WHERE p_partkey = ps_partkey AND p_brand <> 1 AND p_type NOT LIKE 1 AND p_size = ANY(ARRAY[1, 1, 1, 1, 1, 1, 1, 1]) AND ps_suppkey NOT IN ( SELECT s_suppkey FROM supplier WHERE s_comment LIKE '%Customer%Complaints%' ) GROUP B... | tpch |
SELECT SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_quantity) AS sum_qty, l_linestatus, AVG(l_discount) AS avg_disc, l_returnflag, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, COUNT(*) AS count_order, AVG(l_extendedprice) AS avg_price, SUM(l_extendedprice) AS sum_base_price, ... | tpch |
WITH year_total AS ( SELECT d_year AS dyear, c_last_name AS customer_last_name, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_login AS customer_login, c_birth_country AS customer_birth_country, c_email_address AS customer_email_address, c_customer_id ... | tpcds |
SELECT ss_ticket_number, c_last_name, cnt, c_preferred_cust_flag, c_salutation, c_first_name 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 SUM(ss_quantity) AS store_sales_quantity, SUM(sr_return_quantity) AS store_returns_quantity, SUM(cs_quantity) AS catalog_sales_quantity, i_item_id, i_item_desc, s_store_name, 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(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 n.gender = 'f' AND it.info = 'release dates' AND mi.movie_id = ci.movie_i... | 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 t.production_year > 2010 AND mi.info in ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND mk... | job |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v WHERE c.Score = 0 AND p.Id = c.PostId AND p.Id = ph.PostId AND p.Id = pl.PostId AND p.FavoriteCount >= 0 AND pl.LinkTypeId = 1 AND p.Id = v.PostId | stats |
SELECT SUM(ss_ext_wholesale_cost), AVG(ss_ext_wholesale_cost), AVG(ss_ext_sales_price), AVG(ss_quantity) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr... | tpcds |
Select n_name, Sum(l_extendedprice * (1 - l_discount)) As revenue From customer, orders, lineitem, supplier, nation, region Where r_name = 1 And c_custkey = o_custkey And c_nationkey = s_nationkey And l_orderkey = o_orderkey And n_regionkey = r_regionkey And o_orderdate >= DATE 1 And l_suppkey = s_suppkey And o_orderda... | 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 ci.movie_id = mc.movie_id AND ci.role_id = rt.id AND t.id = mc.movie_id A... | job |
SELECT MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword 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 ci.movie_id = mk.movie_id AND n.id = ci.person_id AND n.name LIKE '%Hemsworth%Chris%' AND k... | job |
SELECT i_item_id, AVG(cs_quantity) AS agg1, AVG(cs_list_price) AS agg2, AVG(cs_coupon_amt) AS agg3, AVG(cs_sales_price) AS agg4 FROM catalog_sales INNER JOIN customer_demographics ON cs_bill_cdemo_sk = cd_demo_sk INNER JOIN date_dim ON cs_sold_date_sk = d_date_sk INNER JOIN item ON cs_item_sk = i_item_sk INNER JOIN pro... | tpcds |
SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue FROM customer, orders, lineitem, supplier, nation, region WHERE l_orderkey = o_orderkey AND o_orderdate >= DATE 1 AND s_nationkey = n_nationkey AND l_suppkey = s_suppkey AND c_nationkey = s_nationkey AND n_regionkey = r_regionkey AND c_custkey = o_custke... | 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 NOT LIKE '%Yu%' AND n1.id = ci.person_id AND mc.company_id = cn.id AND mc.note NOT LIKE '%(USA)%' AND n... | job |
SELECT MIN(t.title) AS movie_title FROM keyword AS k, movie_info AS mi, movie_keyword AS mk, title AS t WHERE mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.id = mk.keyword_id AND t.id = mi.movie_id AND k.keyword LIKE '%sequel%' AND t.id = mk.movie_id AND t.produ... | job |
SELECT MIN(t.title) AS movie_title FROM company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, title AS t WHERE k.keyword ='character-name-in-title' AND mc.movie_id = t.id AND mk.keyword_id = k.id AND cn.id = mc.company_id AND cn.country_code ='[de]' AND mc.movie_id = mk.movie_id AND t.id = mk.mo... | job |
SELECT MAX(k.keyword) AS movie_keyword, MAX(n.name) AS actor_name, MAX(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = mk.movie_id AND t.id = ci.movie_id AND k.keyword = 'marvel-cinematic-universe' AND n.name LIKE '%Hemsworth%Chris%' AND ci.movie_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 it.id = mi_idx.info_type_id AND t.id = mi_idx.movie_id AND t.production_year >= 2000 AND t.production_year <= 2010 AND it.info ='rating' AND mi_idx.info > '7.0' | job |
select p_mfgr, n_name, s_acctbal, s_phone, s_address, s_comment, s_name, p_partkey 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 o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE p_type = 1 ) AS all_n... | tpch |
Select 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 i_brand AS brand, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price, i_manufact_id, i_manufact FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO... | tpcds |
SELECT 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 AVG(l_quantity) AS avg_qty, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, COUNT(*) AS count_order, l_returnflag, SUM(l_quantity) AS sum_qty, AVG(l_discount) AS avg_disc, SUM(l_extendedprice) AS sum_base_price, l_linestatus, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, AVG(l_e... | 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 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.id = ci.movie_id AND ci.movie_id = mk.movie_id AND n.name LIKE '%Downey%Robert%' AND k.keyword = 'marvel-cinematic-universe' AND t.id = m... | 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 t.id = mk.movie_id AND t.id = ci.movie_id AND k.keyword = 'marvel-cinematic-... | job |
select min(t.title) as movie_title from company_name as cn, keyword as k, movie_companies as mc, movie_keyword as mk, title as t where cn.country_code ='[nl]' AND cn.id = mc.company_id AND k.keyword ='character-name-in-title' AND t.id = mk.movie_id AND mk.keyword_id = k.id AND mc.movie_id = t.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 t.id = mc.movie_id AND it.id = mi_idx.info_type_id AND ct.kind = 'production companies' AND t.id = mi_idx.... | job |
SELECT COUNT(*) FROM postHistory AS ph, posts AS p, users AS u, badges AS b WHERE ph.UserId = u.Id AND ph.PostHistoryTypeId = 3 AND p.Score >= -7 AND u.Reputation >= 1 AND u.Id = b.UserId AND p.OwnerUserId = u.Id LIMIT 20; | 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 n1.name not like '%Yu%' and an1.person_id = n1.id and mc.note not like '%(USA)%' and rt.role = 'actress' and an... | job |
Select Count(*) From comments As c, postHistory As ph, votes As v, users As u Where u.UpVotes <= 123 AND u.Views >= 0 AND u.DownVotes >= 0 AND ph.UserId = c.UserId AND u.Id = v.UserId AND v.UserId = ph.UserId | stats |
SELECT MIN(t.title) AS japanese_movie_dubbed, MIN(an1.name) AS actress_pseudonym FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE n1.name LIKE '%Yo%' AND ci.movie_id = t.id AND mc.note NOT LIKE '%(USA)%' AND ci.note = '(voice: English versio... | job |
Select Count(*) From comments As c, posts As p, postLinks As pl, postHistory As ph, votes As v, badges As b Where p.Id = pl.RelatedPostId AND p.Id = v.PostId AND c.Score = 0 AND p.Id = ph.PostId AND b.UserId = c.UserId AND p.Id = c.PostId AND pl.LinkTypeId = 1 | stats |
SELECT c_comment, c_phone, c_address, c_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_acctbal, c_custkey, n_name FROM customer, orders, lineitem, nation WHERE l_orderkey = o_orderkey AND c_nationkey = n_nationkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND c_custkey = o_custkey AND l_returnflag = 'R... | 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.keyword LIKE '%sequel%' AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', 'Danish', 'Norwegian', 'German') AND t.p... | job |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.id = ci.movie_id AND n.name LIKE '%Hemsworth%Chris%' AND k.id = mk.keyword_id AND n.id = ci.person_id AND t.id = mk.movie_id AND ci.movie... | job |
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 item.i_manager_id = 57 AND dt.d_year = 2002 AND dt.d_moy = 12 GROUP BY ... | tpcds |
SELECT c_first_name, bought_city, ss_ticket_number, ca_city, list_price, extended_tax, extended_price, c_last_name FROM ( SELECT ss_ticket_number, ss_customer_sk, ca_city AS bought_city, SUM(ss_ext_sales_price) AS extended_price, SUM(ss_ext_list_price) AS list_price, SUM(ss_ext_tax) AS extended_tax FROM store_sales JOI... | tpcds |
SELECT cnt, c_last_name, c_preferred_cust_flag, ss_ticket_number, c_first_name, c_salutation 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 COUNT(1) FROM postHistory AS ph, posts AS p, votes AS v, badges AS b, users AS u, comments AS c WHERE u.Id = p.OwnerUserId AND p.Id = ph.PostId AND p.Id = v.PostId AND u.Id = b.UserId AND p.ViewCount >= 0 AND p.Score <= 192 AND p.Id = c.PostId | stats |
Select i_item_id, Avg(cs_quantity) As agg1, Avg(cs_list_price) As agg2, Avg(cs_coupon_amt) As agg3, Avg(cs_sales_price) As agg4 From catalog_sales INNER JOIN customer_demographics On cs_bill_cdemo_sk = cd_demo_sk INNER JOIN date_dim On cs_sold_date_sk = d_date_sk INNER JOIN item On cs_item_sk = i_item_sk INNER JOIN pro... | 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 it.id = miidx.info_ty... | job |
SELECT MIN(mc.note) AS production_note, MIN(t.title) AS movie_title, MIN(t.production_year) AS movie_year FROM company_type AS ct, info_type AS it, movie_companies AS mc, movie_info_idx AS mi_idx, title AS t WHERE t.id = mi_idx.movie_id AND t.id = mc.movie_id AND ct.id = mc.company_type_id AND mc.note NOT LIKE '%(as Me... | 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_type not like 1 AND ps_suppkey not in ( select s_suppkey from supplier where s_comment like '%Customer%Complaints%' ) AND p_brand <> 1 AND p_size in (1, 1, 1, 1, 1, 1, 1, 1) group by p_brand... | tpch |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE k.id = mk.keyword_id AND ci.movie_id = mk.movie_id AND t.production_year > 2010 AND n.name LIKE '%Downey%Robert%' AND t.id = mk.movie_id AN... | 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 o_orderdate < DATE 1 AND c_mktsegment = 1 AND l_shipdate > DATE 1 AND c_custkey = o_custkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven... | 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 + INTERVAL '1' YEAR A... | 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 mi.movie_id = mc.movie_id AND t.id = mi.movie_id AND n.id = ci.person_id ... | job |
Select s_phone, s_suppkey, total_revenue, s_name, s_address From supplier, revenue0 Where total_revenue = ( Select Max(total_revenue) From revenue0 ) AND s_suppkey = supplier_no Order By s_suppkey | tpch |
WITH _q AS ( SELECT s_name, s_address FROM supplier, nation WHERE 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_suppkey = ps_suppkey AND l_shipdate >=... | tpch |
SELECT o_orderdate, o_totalprice, c_name, c_custkey, SUM(l_quantity), o_orderkey FROM customer, orders, lineitem WHERE o_orderkey IN ( SELECT l_orderkey FROM lineitem GROUP BY l_orderkey HAVING SUM(l_quantity) > 1 ) AND c_custkey = o_custkey AND o_orderkey = l_orderkey GROUP BY c_name, c_custkey, o_orderkey, o_orderdat... | tpch |
SELECT i_brand_id AS brand_id, i_manufact_id, i_manufact, SUM(ss_ext_sales_price) AS ext_price, i_brand AS brand FROM date_dim JOIN store_sales ON d_date_sk = ss_sold_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN customer ON ss_customer_sk = c_customer_sk JOIN customer_address ON c_current_addr_sk = ca_address_sk JO... | 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 mc.movie_id = t.id and mk.keyword_id = k.id and mc.movie_id = mk.movie_id and k.keyword ='character-name-in-title' and cn.id = mc.comp... | 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 cn.country_code = '[jp]' AND ci.person_id = an.person_id AND ... | job |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.