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 chn.id = ci.person_role_id AND ci.note LIKE '%(uncredited)%' AND cn.id = mc.company_id AND ci.movie_... | job |
select i_item_id, i_item_desc, s_store_id, s_store_name, max(ss_net_profit) as store_sales_profit, max(sr_net_loss) as store_returns_loss, 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(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 mc.movie_id = mk.movie_id AND cn.id = mc.company_id AND t.id = mk.movie_id AND cn.country_code =... | job |
Select o_orderdate, c_custkey, o_orderkey, Sum(l_quantity), c_name, 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 i_item_id, i_item_desc, s_store_id, s_store_name, MAX(ss_net_profit) AS store_sales_profit, MAX(sr_net_loss) AS store_returns_loss, 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(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE mk.keyword_id = k.id AND mc.movie_id = mk.movie_id AND t.id = mk.movie_id AND ci.movie_id =... | job |
SELECT i_item_id, i_item_desc, i_current_price FROM item INNER JOIN inventory ON i_item_sk = inv_item_sk INNER JOIN date_dim ON d_date_sk = inv_date_sk INNER JOIN store_sales ON ss_item_sk = i_item_sk WHERE i_manufact_id IN (427, 128, 154, 9) AND i_current_price >= 80 AND d_date BETWEEN CAST('2002-01-23' AS DATE) AND (... | tpcds |
SELECT p_mfgr, s_phone, n_name, p_partkey, s_name, s_acctbal, s_address, s_comment FROM part, supplier, partsupp, nation, region WHERE n_regionkey = r_regionkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey... | 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 k.keyword ='character-name-in-title' AND t.id = mk.movie_id AND cn.country_code ='[sm]' AND mk.keyword_id = k.id AND cn.id = mc.company_id AND mc.movie_id = t.id AND mc.movie_id = mk.mo... | job |
Select COUNT(1) From comments As c, posts As p, postLinks As pl Where c.UserId = p.OwnerUserId And p.Id = pl.PostId And p.CommentCount <= 18 And p.CreationDate >= '2010-07-23 07:27:31'::timestamp And p.CreationDate <= '2014-09-09 01:43:00'::timestamp LIMIT 200; | stats |
WITH year_total AS ( SELECT c_first_name AS customer_first_name, c_customer_id AS customer_id, c_birth_country AS customer_birth_country, c_login AS customer_login, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, 's' AS sale_type, c_preferred_cust_flag AS... | tpcds |
SELECT c_preferred_cust_flag, ss_ticket_number, c_salutation, cnt, c_first_name, c_last_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 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 k.keyword ='character-name-in-title' AND mk.keyword_id = k.id AND mc.movie_id = t.id AND t.id = mk.movie_id AND mc.movie_id = mk.movie_id AND cn.country_code =... | 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 o_orderkey = l1.l_orderkey AND s_suppkey = l1.l_suppkey AND n_name = 1 AND l1.l_rec... | tpch |
SELECT s_name, p_mfgr, s_phone, s_comment, s_address, p_partkey, s_acctbal, n_name 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.id = mc.company_id AND mc.movie_id = t.id AND k.keyword ='character-name-in-title' AND mc.movie_id = mk.movie_id AND mk.keyword_id = k.id AND cn.country_code ='[sm]' AND t.id = mk.mo... | job |
select p_mfgr, n_name, s_name, p_partkey, s_comment, s_phone, s_address, s_acctbal 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 l_linestatus, AVG(l_discount) AS avg_disc, l_returnflag, SUM(l_extendedprice) AS sum_base_price, COUNT(*) AS count_order, AVG(l_extendedprice) AS avg_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, SUM(l_extendedprice * (1 - l_di... | tpch |
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 k.keyword = 'marvel-cinematic-universe' AND t.production_year > 2010 AND n.name LIKE '%Downey%Robert%' AND t.id = ci.movie_id AND ci.movie_... | job |
SELECT SUM(ss_ext_wholesale_cost), AVG(ss_quantity), AVG(ss_ext_wholesale_cost), AVG(ss_ext_sales_price) FROM store_sales JOIN store ON s_store_sk = ss_store_sk JOIN customer_demographics ON cd_demo_sk = ss_cdemo_sk JOIN household_demographics ON hd_demo_sk = ss_hdemo_sk JOIN customer_address ON ca_address_sk = ss_addr... | tpcds |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, badges AS b WHERE pl.LinkTypeId = 1 AND p.Id = pl.RelatedPostId AND p.Id = ph.PostId AND b.UserId = c.UserId AND p.Id = v.PostId AND p.Id = c.PostId AND c.Score = 0 | stats |
WITH year_total AS ( SELECT c_login AS customer_login, c_customer_id AS customer_id, c_first_name AS customer_first_name, 's' AS sale_type, c_last_name AS customer_last_name, c_birth_country AS customer_birth_country, c_email_address AS customer_email_address, d_year AS dyear, SUM(((ss_ext_list_price - ss_ext_wholesale... | 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 = c.PostId AND p.Id = ph.PostId AND pl.LinkTypeId = 1 AND p.Id = pl.RelatedPostId AND p.Score <= 40 AND p.Id = v.PostId AND b.UserId = u.Id AND c.UserId = u.Id | stats |
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 t.id = ci.movie_id AND t.id = mk.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND ci.movie_id = m... | 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 t.id = mi.movie_id AND t.id = mk.movie_id AND mk.movie_id = mi.movie_id AND t.production_year > 2010 AND k.keyword LIKE '%sequel%' AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Danish... | job |
WITH year_total AS ( SELECT d_year AS dyear, c_last_name AS customer_last_name, c_login AS customer_login, c_birth_country AS customer_birth_country, SUM(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) AS year_total, c_preferred_cust_flag AS customer_preferred_cust_flag, c_... | tpcds |
SELECT MIN(t.title) AS marvel_movie, MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE t.production_year > 2010 AND ci.movie_id = mk.movie_id AND t.id = mk.movie_id AND n.id = ci.person_id AND k.keyword = 'marvel-cinematic-uni... | job |
select count(*) from comments as c, posts as p, postLinks as pl, postHistory as ph, votes as v, users as u where u.Id = p.OwnerUserId AND p.Id = pl.PostId AND p.AnswerCount >= 0 AND p.PostTypeId = 1 AND p.Id = v.PostId AND p.Id = c.PostId AND p.Id = ph.PostId | stats |
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 = t.id AND t.episode_nr >= 50 AND ci.movie_id = mc.movie_id AND mk.keyword_id =... | job |
Select nation, o_year, Sum(amount) As sum_profit From ( Select n_name As nation, EXTRACT(YEAR From o_orderdate) As o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity As amount From part, supplier, lineitem, partsupp, orders, nation Where s_suppkey = l_suppkey And s_nationkey = n_nationkey And p_nam... | tpch |
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where k.keyword like '%sequel%' AND mk.movie_id = mi.movie_id AND t.id = mi.movie_id AND t.id = mk.movie_id AND mi.info in ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'German') AND k.... | job |
select i_item_id, i_item_desc, s_store_id, s_store_name, max(ss_net_profit) as store_sales_profit, max(sr_net_loss) as store_returns_loss, 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(t.title) AS japanese_anime_movie, MIN(an.name) AS acress_pseudonym 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 an.person_id = n.id AND mk.movie_id = ci.movie_id AND cn.id =... | job |
select nation, o_year, sum(amount) as sum_profit from ( select n_name as nation, EXTRACT(YEAR from o_orderdate) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part, supplier, lineitem, partsupp, orders, nation where ps_suppkey = l_suppkey AND p_name like 1 ) as profit AND p_pa... | tpch |
SELECT i_item_id, i_item_desc, s_store_id, s_store_name, MAX(ss_net_profit) AS store_sales_profit, MAX(sr_net_loss) AS store_returns_loss, 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(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 pi.note = 'Volker Boehm' AND an.person_id = ci.person_id AND n.name_pcode_cf BETWEEN 'A' AND 'F' AND pi.person_id = an... | 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(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 ci.note LIKE '%(uncredited)%' AND t.id = mc.movie_id AND t.id = ci.movi... | 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 t.episode_nr >= 50 AND cn.country_code = '[us]' AND t.id = mk... | 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 lt.id = ml.link_type_id AND n.id = pi.person_id AND ml.linked_movie_id = t.id AND (n.gender = 'm' OR (n.gender = 'f' A... | 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 mk.movie_id = mi.movie_id AND t.production_year > 2010 AND k.id = mk.keyword_id AND mi.info = ANY(ARRAY['Sweden', 'Norway', 'Germany', 'Danish', 'Swedish', '... | job |
SELECT i_item_id, AVG(ss_coupon_amt) AS agg3, AVG(ss_list_price) AS agg2, AVG(ss_sales_price) AS agg4, AVG(ss_quantity) AS agg1 FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo... | tpcds |
select min(t.title) as movie_title from keyword as k, movie_info as mi, movie_keyword as mk, title as t where t.production_year > 2005 AND t.id = mk.movie_id AND k.id = mk.keyword_id AND t.id = mi.movie_id AND k.keyword like '%sequel%' AND mk.movie_id = mi.movie_id AND mi.info in ('Sweden', 'Norway', 'Germany', 'Denmar... | 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 kt.id = t.kind_id AND kt.kind = 'movie' AND ct.... | 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 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 o_orderdate, c_custkey, o_totalprice, o_orderkey, c_name, Sum(l_quantity) 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 s_acctbal, s_phone, s_address, n_name, s_name, p_partkey, 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 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_commitdate < l_receiptdate AND l_receiptda... | tpch |
SELECT MIN(an.name) AS cool_actor_pseudonym, MIN(t.title) AS series_named_after_char FROM aka_name AS an, cast_info AS ci, company_name AS cn, keyword AS k, movie_companies AS mc, movie_keyword AS mk, name AS n, title AS t WHERE an.person_id = n.id AND k.keyword = 'character-name-in-title' AND t.id = mc.movie_id AND ci... | job |
SELECT AVG(ss_quantity) AS agg1, AVG(ss_sales_price) AS agg4, AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, i_item_id FROM store_sales JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk JOIN date_dim ON ss_sold_date_sk = d_date_sk JOIN item ON ss_item_sk = i_item_sk JOIN promotion ON ss_promo_sk = p_promo... | tpcds |
SELECT i_manufact, i_brand AS brand, i_manufact_id, i_brand_id AS brand_id, SUM(ss_ext_sales_price) AS ext_price FROM date_dim INNER JOIN store_sales ON d_date_sk = ss_sold_date_sk INNER JOIN item ON ss_item_sk = i_item_sk INNER JOIN customer ON ss_customer_sk = c_customer_sk INNER JOIN customer_address ON c_current_ad... | tpcds |
Select c_custkey, o_orderdate, o_orderkey, Sum(l_quantity), c_name, 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 MAX(cs_net_profit) AS catalog_sales_profit, i_item_id, MAX(ss_net_profit) AS store_sales_profit, i_item_desc, MAX(sr_net_loss) AS store_returns_loss, s_store_name, s_store_id FROM store_sales JOIN store_returns ON store_sales.ss_customer_sk = store_returns.sr_customer_sk AND store_sales.ss_item_sk = store_return... | tpcds |
SELECT MIN(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 it2.info = 'release dates' AND kt.kind = 'movie' AND at.movie_id = mi.... | job |
SELECT c_last_name, c_first_name, cnt, ss_ticket_number, c_preferred_cust_flag, 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 c_phone, SUM(l_extendedprice * (1 - l_discount)) AS revenue, c_comment, n_name, c_address, c_acctbal, c_custkey, c_name FROM customer, orders, lineitem, nation WHERE l_orderkey = o_orderkey AND o_orderdate < DATE 1 + INTERVAL '3' MONTH AND l_returnflag = 'R' AND c_nationkey = n_nationkey AND c_custkey = o_custke... | tpch |
SELECT COUNT(cs_quantity) AS catalog_sales_quantitycount, COUNT(sr_return_quantity) AS store_returns_quantitycount, AVG(sr_return_quantity) AS store_returns_quantityave, STDDEV_SAMP(cs_quantity) / AVG(cs_quantity) AS catalog_sales_quantitycov, STDDEV_SAMP(ss_quantity) / AVG(ss_quantity) AS store_sales_quantitycov, i_it... | tpcds |
SELECT AVG(ss_quantity) AS agg1, AVG(ss_list_price) AS agg2, AVG(ss_coupon_amt) AS agg3, AVG(ss_sales_price) AS agg4, i_item_id FROM store_sales INNER JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk INNER JOIN date_dim ON ss_sold_date_sk = d_date_sk INNER JOIN item ON ss_item_sk = i_item_sk INNER JOIN promotion ... | tpcds |
SELECT MIN(mc.note) AS production_note, MIN(t.production_year) AS movie_year, 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.movie_id = mi_idx.movie_id AND it.id = mi_idx.info_type_id AND mc.note N... | job |
SELECT MIN(cn.name) AS from_company, MIN(lt.link) AS link_type, MIN(t.title) AS western_sequel FROM company_name AS cn, company_type AS ct, info_type AS it, keyword AS k, link_type AS lt, movie_companies AS mc, movie_info AS mi, movie_keyword AS mk, movie_link AS ml, title AS t WHERE mi.note LIKE '%internet%' AND t.id ... | job |
SELECT MIN(mi.info) AS release_date, MIN(miidx.info) AS rating, MIN(t.title) AS german_movie FROM company_name AS cn, company_type AS ct, info_type AS it, info_type AS it2, kind_type AS kt, movie_companies AS mc, movie_info AS mi, movie_info_idx AS miidx, title AS t WHERE kt.kind = 'movie' AND cn.country_code = '[de]' ... | job |
SELECT MIN(an1.name) AS actress_pseudonym, MIN(t.title) AS japanese_movie_dubbed FROM aka_name AS an1, cast_info AS ci, company_name AS cn, movie_companies AS mc, name AS n1, role_type AS rt, title AS t WHERE ci.role_id = rt.id AND ci.note = '(voice: English version)' AND n1.name LIKE '%Yo%' AND cn.country_code = '[jp]... | 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 ci.movie_id = mk.movie_id AND t.id = mk.movie_id AND t.id = ci.movie_id AND t.production_year > 2010 AND n.name LIKE '%Downey%Robert%' AND ... | 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 c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price From ( Select ss_ticket_number, ss_customer_sk, ca_city As bought_city, Sum(ss_ext_sales_price) As extended_price, Sum(ss_ext_list_price) As list_price, Sum(ss_ext_tax) As extended_tax From store_sales Joi... | tpcds |
SELECT MIN(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 ct.id = mc.company_type_id AND t.id = mc.movie_id AND ci.movie_id = mc.movie_id AND ci.note LIKE '%(... | 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 ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and s_nationkey = n_nationkey and n_regionkey... | tpch |
SELECT s_name, COUNT(*) AS numwait FROM supplier, lineitem l1, orders, nation WHERE s_nationkey = n_nationkey AND l1.l_receiptdate > l1.l_commitdate AND n_name = 1 AND EXISTS ( SELECT * FROM lineitem l2 WHERE l2.l_orderkey = l1.l_orderkey AND l2.l_suppkey <> l1.l_suppkey ) AND o_orderkey = l1.l_orderkey AND o_orderstat... | tpch |
Select s_store_name, Sum(sr_return_quantity) As store_returns_quantity, i_item_id, i_item_desc, Sum(ss_quantity) As store_sales_quantity, Sum(cs_quantity) As catalog_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 |
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.production_year > 2005 AND ct.id = mc.company_type_id AND ci.note LIKE '%(voice)%' AND ci.note LIK... | 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(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.id = ci.person_id AND t.id = mk.movie_id AND ci.movie_id = mk.movie_id AND k.id = mk.keyword_id AND n.name LIKE '%... | 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 r_name = 1 AND s_nationkey = n_nationkey AND p_partkey = ps_partkey AND p_size = 1 AND n_regionkey = r_regionkey AND ps_supplycost = ( Select Min(ps_supplycost) From p... | tpch |
SELECT AVG(sr_return_quantity) AS store_returns_quantityave, STDDEV_SAMP(sr_return_quantity) / AVG(sr_return_quantity) AS store_returns_quantitycov, STDDEV_SAMP(ss_quantity) AS store_sales_quantitystdev, AVG(ss_quantity) AS store_sales_quantityave, i_item_id, COUNT(sr_return_quantity) AS store_returns_quantitycount, s_... | 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 t.id = ci.movie_id AND t.id = mc.movie_id AND ct.id = mc.company_type_id AND cn.id = mc.company_id A... | job |
SELECT COUNT(*) FROM comments AS c, posts AS p, postLinks AS pl, postHistory AS ph, votes AS v, users AS u WHERE p.Id = v.PostId AND p.Id = ph.PostId AND u.Id = p.OwnerUserId AND p.PostTypeId = 1 AND p.Id = c.PostId AND p.AnswerCount >= 0 AND p.Id = pl.PostId LIMIT 200; | stats |
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 k.id = mk.keyword_id AND t.id = ci.movie_id AND n.name LIKE '%Downey%Robert%' AND t.production_... | job |
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 mc.note LIKE '%(USA)%' AND mi.note ... | job |
Select p_brand, p_type, p_size, Count(Distinct ps_suppkey) As supplier_cnt From partsupp, part Where p_type Not Like 1 And p_brand <> 1 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_partkey = ps_partkey 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 n.name LIKE '%Hemsworth%Chris%' AND k.id = mk.keyword_id AND n.id = ci.person_id AND t.production_year > 2010 AND t.id = mk.movie_id AND ci... | job |
WITH year_total AS ( SELECT c_birth_country AS customer_birth_country, 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_customer_id AS customer_id, d_year AS dyear, c_first_name AS customer_fi... | tpcds |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE k.id = mk.keyword_id AND n.id = ci.person_id AND k.keyword = 'marvel-cinematic-universe' AND t.id = ci.movie_id AND t.production_year > 201... | 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 cn.country_code = '[us]' AND kt.id = t.kind_id AND kt.kind = 'movie' A... | job |
SELECT SUM(l_extendedprice * (1 - l_discount)) AS revenue, o_orderdate, o_shippriority, l_orderkey FROM customer, orders, lineitem WHERE l_orderkey = o_orderkey AND c_mktsegment = 1 AND l_shipdate > DATE 1 AND o_orderdate < DATE 1 AND c_custkey = o_custkey GROUP BY l_orderkey, o_orderdate, o_shippriority ORDER BY reven... | tpch |
SELECT s_name, p_mfgr, p_partkey, s_acctbal, s_comment, s_address, s_phone, n_name FROM part, supplier, partsupp, nation, region WHERE r_name = 1 AND p_size = 1 AND n_regionkey = r_regionkey AND s_nationkey = n_nationkey AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_par... | 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.id = mk.keyword_id And t.id = mi.movie_id And t.production_year > 2005 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', 'Denmar... | 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 kt.id = t.kind_id AND kt.kind = 'movie' AND mi_idx.info < '3.5' AND t.... | job |
WITH _q AS ( 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 > 2000 AND k.id = mk.keyword_id AND k.keyword LIKE '%sequel%' AND mi.info IN ('Sweden', 'Norway', 'Germany', 'Denmark', 'Swedish', 'Danish', 'Norwegian', 'G... | job |
SELECT o_year, SUM( CASE WHEN nation = 1 THEN volume ELSE 0 END ) / SUM(volume) AS mkt_share FROM ( SELECT EXTRACT(YEAR FROM o_orderdate) AS o_year, l_extendedprice * (1 - l_discount) AS volume, n2.n_name AS nation FROM part, supplier, lineitem, orders, customer, nation n1, nation n2, region WHERE o_orderdate BETWEEN D... | tpch |
SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE s_suppkey = ps_suppkey AND p_type LIKE 1 AND p_size = 1 AND ps_supplycost = ( SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppke... | tpch |
Select Min(t.title) As marvel_movie, Min(k.keyword) As movie_keyword, Min(n.name) As actor_name From cast_info As ci, keyword As k, movie_keyword As mk, name As n, title As t Where k.keyword = 'marvel-cinematic-universe' And n.name Like '%Downey%Robert%' And t.production_year > 2010 And k.id = mk.keyword_id And t.id = ... | 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 it.id = mi.info_type_id AND lt.link... | job |
SELECT c_salutation, ss_ticket_number, c_preferred_cust_flag, c_last_name, cnt, 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 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 = miidx.movie_id AND it.id = miidx.... | 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.info ='rating' and mi_idx.info > '8.0' and t.production_year >= 2000 and t.production_year <= 2005 and t.id = mi_idx.movie_id and it.id = mi_idx.info_type_id limit 50; | 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 nation, o_year, sum(amount) as sum_profit from ( select n_name as nation, EXTRACT(YEAR from o_orderdate) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part, supplier, lineitem, partsupp, orders, nation where s_suppkey = l_suppkey AND p_partkey = l_partkey AND s_nationk... | tpch |
SELECT MIN(k.keyword) AS movie_keyword, MIN(n.name) AS actor_name, MIN(t.title) AS marvel_movie FROM cast_info AS ci, keyword AS k, movie_keyword AS mk, name AS n, title AS t WHERE n.id = ci.person_id AND k.id = mk.keyword_id AND t.production_year > 2010 AND t.id = ci.movie_id AND n.name LIKE '%Hemsworth%Chris%' AND ci... | job |
SELECT SUM(l_quantity) AS sum_qty, AVG(l_extendedprice) AS avg_price, COUNT(*) AS count_order, l_linestatus, SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge, SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price, SUM(l_extendedprice) AS sum_base_price, AVG(l_discount) AS avg_disc, l_returnflag, ... | tpch |
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 = v.PostId AND p.Id = c.PostId AND p.Id = pl.PostId AND pl.LinkTypeId = 1 AND c.Score = 0 AND p.Id = ph.PostId | stats |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.