db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
cars
Which country produced the car with the lowest price?
the lowest price refers to min(price)
SELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.price ASC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the customers in Asia, how many customers are in debt?
customers in Asia refer to n_name where r_name = 'ASIA'; customers in debt refer to c_acctbal < 0;
SELECT COUNT(T1.n_name) FROM nation AS T1 INNER JOIN customer AS T2 ON T1.n_nationkey = T2.c_nationkey INNER JOIN region AS T3 ON T1.n_regionkey = T3.r_regionkey WHERE T2.c_acctbal < 0 AND T3.r_name = 'ASIA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
What is the total number of suppliers from Germany?
suppliers refer to s_suppkey; Germany is the name of the nation which refers to n_name = 'GERMANY';
SELECT COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T2.n_name = 'GERMANY'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Which car is the cheapest? Provide its acceleration, number of cylinders, and producing year.
the cheapest refers to min(price); number of cylinders refers to cylinders; producing year refers to model_year
SELECT T1.acceleration, T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID ORDER BY T3.price ASC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Name the countries that belong in the region with comment description "furiously express accounts wake sly".
r_comment = 'furiously express accounts wake sly';
SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'furiously express accounts wake sly'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Calculate the percentage of cars that belong to the USA.
belong to the USA refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%
SELECT CAST(SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
List down the countries that are located in Asia.
countries in Asia refer to n_name where r_name = 'ASIA';
SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
What was the origin country of the car model ford torino produced in 1970?
origin country refers to country; Ford Torino refers to car_name = 'ford torino'; produced in 1970 refers to model_year = 1970
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'ford torino' AND T2.model_year = 1970
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Provide the order comments for at least 5 orders made by customers in the furniture segment.
order comments refer to o_comment; c_mktsegment = 'Furniture';
SELECT T1.o_comment FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_mktsegment = 'Furniture' LIMIT 5
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
What is the average price of model 70 cars?
model 70 refers to model = 70; average price = avg(price) where model = 70
SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.model = 70
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the customers from Brazil, how many customers are in automobile market segment?
customers refer to c_custkey; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; c_mktsegment = 'automobile';
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'AUTOMOBILE' AND T2.n_name = 'BRAZIL'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
What is the total number of orders made by customers in United States?
orders refer to o_orderkey; the United States is the name of the nation which refers to n_name = 'UNITED STATES';
SELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey INNER JOIN nation AS T3 ON T2.c_nationkey = T3.n_nationkey WHERE T3.n_name = 'UNITED STATES'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
How many models of Ford Maverick were produced?
Ford Maverick refers to car_name = 'ford maverick'
SELECT COUNT(DISTINCT T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
What is the order priority of the order with the highest total price?
order with the highest total price refers to MAX(o_totalprice);
SELECT o_orderpriority FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
Give the phone number of the customer with the highest account balance.
phone number of the customer refers to c_phone; the highest account balance refers to MAX(c_acctbal);
SELECT c_phone FROM customer ORDER BY c_acctbal DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Calculate the average production rate per year from 1971 to 1980. Among them, name the cars with a weight of fewer than 1800 lbs.
from 1971 to 1980 refers to model_year between 1971 and 1980; average production rate per year = divide(count(ID where model_year between 1971 and 1980), 9); car's name refers to car_name; a weight of fewer than 1800 lbs refers to weight < 1800
SELECT CAST(COUNT(T1.ID) AS REAL) / 9 FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 UNION ALL SELECT DISTINCT T2.car_name FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 AND T2.weight < 1800
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the customers in the furniture market segment, how many of them have a nation key of 1?
furniture market segment refers to c_mktsegment = 'FURNITURE';
SELECT COUNT(c_custkey) FROM customer WHERE c_mktsegment = 'FURNITURE' AND c_nationkey = 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Which country does Chevy C20 come from?
Chevy C20 refers to car_name = 'chevy c20'
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevy c20'
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
How many of the line items have been shipped by rail with a quantity less than 30?
shipped by rail refers to l_shipmode = 'RAIL'; quantity less than 30 refers to l_quantity < 30;
SELECT COUNT(l_linenumber) FROM lineitem WHERE l_quantity < 30 AND l_shipmode = 'RAIL'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
How many orders were shipped in 1994?
orders shipped in 1994 refer to l_orderkey where year(l_shipdate) = 1994;
SELECT COUNT(l_orderkey) FROM lineitem WHERE STRFTIME('%Y', l_shipdate) = '1994'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Among the cars with 8 cylinders, what is the name of the one that's the most expensive?
with 8 cylinders refers to cylinders = 8; name of the car refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8 ORDER BY T2.price DESC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the parts supplied by Supplier#000000018, provide parts names which had supply costs above 900.
Supplier#000000018 is the name of supplier which refers to s_name; supply costs above 900 refer to ps_supplycost > 900;
SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN supplier AS T3 ON T1.ps_suppkey = T3.s_suppkey WHERE T1.ps_supplycost > 900 AND T3.s_name = 'Supplier#000000018'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Which is the most fuel efficient car in 1975?
car's name refers to car_name; the most fuel efficient refers to max(mpg); in 1975 refers to model_year = 1975
SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = '1975' ORDER BY T1.mpg DESC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the parts shipped by rail on 1st December, 1995, list part names with 10% discount.
shipped by rail on 1st December, 1995 refers to l_shipmode = 'RAIL' where l_shipdate = '1995-12-01'; part names with 10% discount refer to p_name where l_discount = 0.1;
SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey INNER JOIN lineitem AS T3 ON T1.ps_partkey = T3.l_partkey WHERE T3.l_discount = 0.1 AND T3.l_shipdate = '1995-12-01' AND T3.l_shipmode = 'RAIL'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
What is the price of Chevrolet Vega 2300?
Chevrolet Vega 2300 refers to car_name = 'chevrolet vega 2300'
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet vega 2300'
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the suppliers from Middle East region, how many suppliers were in debt?
suppliers from Middle East region refer to s_name where r_name = 'MIDDLE EAST'; in debt refers to s_acctbal < 0;
SELECT COUNT(T3.s_name) FROM region AS T1 INNER JOIN nation AS T2 ON T1.r_regionkey = T2.n_regionkey INNER JOIN supplier AS T3 ON T2.n_nationkey = T3.s_nationkey WHERE T3.s_acctbal < 0 AND T1.r_name = 'MIDDLE EAST'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
List the suppliers' names which supplied smoke red pale saddle plum.
p_name = 'smoke red pale saddle plum'; the suppliers' names refer to s_name;
SELECT T3.s_name FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN supplier AS T3 ON T2.ps_suppkey = T3.s_suppkey WHERE T1.p_name = 'smoke red pale saddle plum'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
What is the acceleration of the most expensive car?
the most expensive refers to max(price)
SELECT T1.acceleration FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Calculate the percentage of suppliers in Germany.
DIVIDE(COUNT(s_suppkey where n_name = 'GERMANY'), COUNT(s_suppkey)) as percentage;
SELECT CAST(SUM(IIF(T2.n_name = 'GERMANY', 1, 0)) AS REAL) * 100 / COUNT(T1.s_suppkey) FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey WHERE T1.s_acctbal < 0
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
How many American cars have an acceleration time of less than 12 seconds?
American car refers to country = 'USA'; an acceleration time of less than 12 seconds refers to acceleration < 12
SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.acceleration < 12
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Calculate the total profit made by chocolate floral blue coral cyan.
SUBTRACT(MULTIPLY(l_extendedprice, (SUBTRACT(1, l_discount)), MULTIPLY(ps_supplycost, l_quantity))) where p_name = 'chocolate floral blue coral cyan';
SELECT SUM(T3.l_extendedprice * (1 - T3.l_discount) - T2.ps_supplycost * T3.l_quantity) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_partkey = T3.l_partkey AND T2.ps_suppkey = T3.l_suppkey WHERE T1.p_name = 'chocolate floral blue coral cyan'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
How many items did Customer#000021159 order? Calculate those items total charges.
items Customer#000021159 order refer to l_linenumber where c_name = 'Customer#000021159'; SUM(MULTIPLY(MULTIPLY(l_extendedprice, SUBTRACT(1, l_discount)), SUM(1, l_tax))) where c_name = 'Customer#000021159';
SELECT COUNT(T2.o_orderkey), SUM(T3.l_extendedprice * (1 - T3.l_discount) * (1 + T3.l_tax)) FROM customer AS T1 INNER JOIN orders AS T2 ON T1.c_custkey = T2.o_custkey INNER JOIN lineitem AS T3 ON T2.o_orderkey = T3.l_orderkey WHERE T1.c_name = 'Customer#000021159' GROUP BY T3.l_linenumber
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
List the price of Ford cars from model 1970 to 1980.
Ford cars refers to car_name LIKE 'ford%'; from model 1970 to 1980 refers to model_year BETWEEN 1970 AND 1980
SELECT DISTINCT T3.price FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID WHERE T1.car_name LIKE 'ford%' AND T2.model_year BETWEEN 1970 AND 1980
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Calculate the total price of orders by Customer#000000013.
Customer#000000013 is the name of the customer which refers to c_name;
SELECT SUM(T1.o_totalprice) FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey WHERE T2.c_name = 'Customer#000000013'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
List the name of the most expensive car.
car's name refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
List down the nation keys and names in Africa.
Africa refers to r_name = 'Africa';
SELECT T1.n_name, T1.n_nationkey FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'AFRICA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Which car consumes fuel the most and has the highest price?
consumes fuel the most refers to min(mpg); has the highest price refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.mpg DESC, T2.price DESC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the customers from Morocco, how many customers were in debt?
customers refer to c_custkey; Morocco is the name of the nation which refers to n_name = 'MOROCCO'; in debt refers to c_acctbal < 0;
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 0 AND T2.n_name = 'MOROCCO'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
How many customers are there in India?
customers refer to c_custkey; India is the name of the nation which refers to n_name = 'INDIA';
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'INDIA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
Which country produced the most expensive car in 1970?
the most expensive refers to max(price); in 1970 refers to model_year = 1970
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN price AS T4 ON T4.ID = T1.ID WHERE T2.model_year = 1970 ORDER BY T4.price DESC LIMIT 1
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
Among the orders shipped in November, 1998 by air, how many orders were urgent?
orders shipped in November, 1998 refer to o_orderkey where l_shipdate LIKE '1998-11-%'; by air refers to l_shipmode = 'AIR'; the order is urgent if o_orderpriority = '1-URGENT' ;
SELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'AIR' AND T1.o_orderpriority = '1-URGENT' AND SUBSTR(T2.l_shipdate, 1, 7) = '1998-11'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
How many Japanese cars weigh more than 2000 lbs?
Japanese car refers to country = 'Japan'; weigh more than 2000 lbs refers to weight > 2000
SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan' AND T1.weight > 2000
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
List any five parts name in Medium Plated Brass.
p_type = 'MEDIUM PLATED BRASS'; parts name refer to p_name;
SELECT p_name FROM part WHERE p_type = 'MEDIUM PLATED BRASS' LIMIT 5
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
Calculate the percentage of manufactured parts by Manufacturer#3.
DIVIDE(COUNT(p_partkey where p_mfgr = 'Manufacturer#3'), COUNT(p_partkey)) as percentage;
SELECT CAST(SUM(IIF(p_mfgr = 'Manufacturer#3', 1, 0)) AS REAL) * 100 / COUNT(p_partkey) FROM part
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
What years did the Buick Skylark 320 get in production?
year refers to model_year; Buick Skylark 320 refers to car_name = 'buick skylark 320'
SELECT T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'buick skylark 320'
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
How many part supplies were nearly out of stock?
supplies nearly out of stock refer to ps_partkey where ps_availqty < 10;
SELECT COUNT(ps_suppkey) FROM partsupp WHERE ps_availqty < 10
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
Calculate the percentage of customers' accounts in debt.
DIVIDE(COUNT(c_custkey where c_acctbal < 0), COUNT(c_custkey)) as percentage;
SELECT CAST(SUM(IIF(c_acctbal < 0, 1, 0)) AS REAL) * 100 / COUNT(c_custkey) FROM customer
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
cars
How many cars with horsepower greater than 200 were produced in 1975?
horsepower greater than 200 refers to horsepower > 200; in 1975 refers to model_year = 1975
SELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower > 200 AND T2.model_year = 1975
CREATE TABLE data ( foreign key (ID) references price(ID), acceleration REAL, -- model INTEGER, -- Example Values: `70`, `71`, `72`, `73`, `74` | Value Statics: Total count 398 - Distinct count 13 - Null count 0 horsepower INTEGER, -- weight INTEGER, -- displacement REAL, -- ID INTEGER primary key, c...
retails
What was the order date of items with the highest total price?
the highest total price refers to MAX(o_totalprice);
SELECT o_orderdate FROM orders WHERE o_totalprice = ( SELECT MAX(o_totalprice) FROM orders )
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
shakespeare
Among the comedy works of Shakespeare, what is the percentage of his works with a character named "antonio"?
comedy works refers to GenreType = 'Comedy'; a character named "antonio" refers to CharName = 'antonio'; percentage = divide(sum(CharName = 'Antonio'), count(CharName)) as percentage
SELECT CAST(SUM(IIF(T4.CharName = 'antonio', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.GenreType = 'Comedy'
CREATE TABLE characters ( CharName TEXT not null, -- Abbrev TEXT not null, -- Description TEXT not null, -- id INTEGER primary key autoincrement, ); CREATE TABLE paragraphs ( chapter_id INTEGER default 0 not null references chapters, -- character_id INTEGER not null references characters, -- Paragraph...
retails
How many items were shipped on 4th December, 1993?
items shipped on 4th December, 1993 refer to l_linenumber where l_shipdate = '1993-12-04';
SELECT COUNT(l_linenumber) FROM lineitem WHERE l_shipdate = '1993-12-04'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
Identify the names of the top 3 customers with the highest number of orders of all time and calculate for the average total price per order of each customers.
customers with the highest number of orders refer to c_name where MAX(COUNT(o_orderkey)); DIVIDE(SUM(o_totalprice), COUNT(o_orderkey));
SELECT T.c_name, T.res FROM ( SELECT T2.c_name, SUM(T1.o_totalprice) / COUNT(T1.o_orderkey) AS res , COUNT(T1.o_orderkey) AS num FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey GROUP BY T1.o_custkey ) AS T ORDER BY T.num DESC LIMIT 3
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
retails
What is the average price before discount of the top 10 orders with the highest total price?
DIVIDE(SUM(l_extendedprice), 10) where MAX(o_totalprice);
SELECT SUM(T2.l_extendedprice) / 10 FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 10
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
State the male population for all zip code which were under the Berlin, NH CBSA.
"Berlin, NH" is the CBSA_name
SELECT T2.male_population FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Berlin, NH' GROUP BY T2.male_population
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Give the tokenized name for the method "Supay.Irc.Messages.KnockMessage.GetTokens".
null
SELECT NameTokenized FROM Method WHERE Name = 'Supay.Irc.Messages.KnockMessage.GetTokens'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
retails
How much is the profit for smoke turquoise purple blue salmon that was delivered in person on 5/7/1996?
SUBTRACT(MULTIPLY(l_extendedprice, (SUBTRACT(1, l_discount)), MULTIPLY(ps_supplycost, l_quantity))) where p_name = 'smoke turquoise purple blue salmon' and l_receiptdate = '1996-05-07' and l_shipinstruct = 'DELIVER IN PERSON';
SELECT T1.l_extendedprice * (1 - T1.l_discount) - T2.ps_supplycost * T1.l_quantity AS num FROM lineitem AS T1 INNER JOIN partsupp AS T2 ON T1.l_suppkey = T2.ps_suppkey INNER JOIN part AS T3 ON T2.ps_partkey = T3.p_partkey WHERE T1.l_receiptdate = '1996-05-07' AND T1.l_shipinstruct = 'DELIVER IN PERSON' AND T3.p_name = ...
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
Name 10 cities with their states that are under the Lexington-Fayette, KY office of the Canada Border Services Agency.
"Lexington-Fayette, KY" is the CBSA_name
SELECT DISTINCT T2.city, T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Lexington-Fayette, KY' LIMIT 10
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Show the full Comment of the method "DE2_UE_Fahrradkurier.de2_uebung_fahrradkurierDataSet1TableAdapters.TableAdapterManager.UpdateInsertedRows".
null
SELECT FullComment FROM Method WHERE Name = 'DE2_UE_Fahrradkurier.de2_uebung_fahrradkurierDataSet1TableAdapters.TableAdapterManager.UpdateInsertedRows'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
retails
Among the products manufactured by manufacturer 5 that have a retail price of no more than 1,000, how many products were shipped via rail?
manufacturer 5 refers to p_mfgr = 'Manufacturer#5'; retail price of no more than 1,000 refers to p_retailprice < 1000; shipped via rail refers to shipmode = 'RAIL';
SELECT COUNT(T1.ps_partkey) FROM partsupp AS T1 INNER JOIN lineitem AS T2 ON T1.ps_suppkey = T2.l_suppkey INNER JOIN part AS T3 ON T1.ps_partkey = T3.p_partkey WHERE T3.p_mfgr = 'Manufacturer#5' AND T3.p_retailprice < 1000 AND T2.l_shipmode = 'RAIL'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
What is the percentage ratio between Democrats and Republicans in Indiana? List the zip codes belonging to Democrats.
"Democrats" and "Republicans" refers to party = 'Democrat" and party = 'Republican'; percentage ratio = Multiply (Divide (Count(party = 'Democrat"), Count(party = 'Republican')), 100)
SELECT CAST(COUNT(CASE WHEN T2.party = 'Democrat' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T2.party = 'Republican' THEN 1 ELSE NULL END)FROM zip_congress AS T1 INNER JOIN congress AS T2 ON T2.cognress_rep_id = T1.district
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Give the number of watchers that the repository of the solution No. 338082 have.
number of watchers refers to Watchers; solution number refers to Solution.Id;
SELECT T1.Watchers FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 338082
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
retails
How many countries are there in the region whose comment description is "asymptotes sublate after the r."
r_comment = 'asymptotes sublate after the r'; countries refer to n_nationkey;
SELECT COUNT(T1.n_nationkey) FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_comment = 'asymptotes sublate after the r'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
What is the area code of Phillips county in Montana?
"PHILLIPS" is the county; 'Montana' is the name of state
SELECT DISTINCT T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN state AS T3 ON T2.state = T3.abbreviation WHERE T2.county = 'PHILLIPS' AND T3.name = 'Montana'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Which method has the summary "Write a command to the log"?
null
SELECT Name FROM Method WHERE Summary = 'Write a command to the log'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
What is the predicate class of image ID 68?
predicate class of image ID 68 refers to PRED_CLASS where IMG_ID = 68;
SELECT T2.PRED_CLASS FROM IMG_REL AS T1 INNER JOIN PRED_CLASSES AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.IMG_ID = 68
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
What are the names of the parts manufactured by manufacturer 3 that have a supply cost of 1,000?
names of the parts refer to p_name; manufacturer 3 refers to p_mfgr = 'Manufacturer#3'; ps_supplycost = 1000;
SELECT T2.p_name FROM partsupp AS T1 INNER JOIN part AS T2 ON T1.ps_partkey = T2.p_partkey WHERE T1.ps_supplycost = 1000 AND T2.p_mfgr = 'Manufacturer#3'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
List all the bad alias for zip codes in Puerto Rico.
"Puerto Rico" refers to state = 'PR'
SELECT T1.bad_alias FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.state = 'PR'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Among all the solution of the 'zh-cn' methods, which path is most often used?
solution refers to SolutionId; zh-cn refers to Lang = 'zh-cn'; path that is most often used refers to MAX(COUNT(Path));
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'zh-cn' GROUP BY T1.Path ORDER BY COUNT(T1.Path) DESC LIMIT 1
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
Write the object classes of image ID 22 alongside the object's width and height.
object classes of image ID 22 refers to OBJ_CLASS where IMG_ID = 22; the object's width and heigh refer to W and H coordinates of the bounding box respectively;
SELECT T1.W, T1.H, T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 22
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
What are the countries in the region of Asia?
countries in the region of Asia refer to n_name where r_name = 'ASIA';
SELECT T1.n_name FROM nation AS T1 INNER JOIN region AS T2 ON T1.n_regionkey = T2.r_regionkey WHERE T2.r_name = 'ASIA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
Calculate the average of 2020's population in each zip code.
average of 2020 population in each zip code refers to Divide (Sum(population_2020), Count(zip_code))
SELECT CAST(SUM(population_2020) AS REAL) / COUNT(zip_code) FROM zip_data
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Please list all the paths of the solutions containing files within the repository whose url is "https://github.com/maxild/playground.git".
null
SELECT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/maxild/playground.git'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
What is the most common object class of image ID 56?
the most common object class of image ID 56 refers to MAX(COUNT(OBJ_CLASS_ID)) where IMG_ID = 56;
SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 56 GROUP BY T2.OBJ_CLASS ORDER BY COUNT(T2.OBJ_CLASS_ID) DESC LIMIT 1
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
Among the customers from the United States, which market segment has the highest number of customers?
the highest number of customers refer to MAX(COUNT(c_custkey)); the United States is the name of the nation which refers to n_name = 'UNITED STATES'; market segment refers to c_mktsegment;
SELECT T.c_mktsegment FROM ( SELECT T1.c_mktsegment, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'UNITED STATES' GROUP BY T1.c_mktsegment ) AS T ORDER BY T.num DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
What is the state for area code of 787?
null
SELECT DISTINCT T2.state FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 787
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Show the solution path for the method "Mosa.Platform.x86.Instructions.IMul.EmitLegacy"?
solution path refers to Path; method refers to Name; Name = 'Mosa.Platform.x86.Instructions.IMul.EmitLegacy';
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Mosa.Platform.x86.Instructions.IMul.EmitLegacy'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
What object class is in the X and Y coordinates of 126 and 363?
object class refers to OBJ_CLASS; X and Y coordinates of 126 and 363 refer to coordinates of the bounding box where X = 126 and Y = 363;
SELECT T1.IMG_ID, T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.X = 126 AND T1.Y = 363
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
How many orders shipped via ship have a medium priority?
orders shipped via ship refer to o_orderkey where l_shipmode = 'SHIP'; medium priority refers to o_orderpriority = '3-MEDIUM';
SELECT COUNT(T1.o_orderkey) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T2.l_shipmode = 'SHIP' AND T1.o_orderpriority = '3-MEDIUM'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
codebase_comments
Please list the path of the solution that contains files found within the repository most people like.
more stars mean more people like this repository; most people like refers to max(Stars);
SELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo )
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
Write 10 coordinates with the object class "pizza."
coordinates for the object refer to X, Y, W and H coordinates of the bounding box; object class "pizza" refers to OBJ_CLASS = 'pizza';
SELECT T1.IMG_ID, T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'pizza' LIMIT 10
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
How many suppliers are from Japan?
suppliers refer to s_nationkey; Japan is the name of the nation which refers to n_name = 'JAPAN';
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T2.n_name = 'JAPAN'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
Which CBSAs have more than 10 zip codes?
has more than 10 zip codes refers to CBSA where count(CBSA) > 10
SELECT T1.CBSA_name FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA GROUP BY T1.CBSA HAVING COUNT(T2.zip_code) > 10
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
For the repository which got '189' Stars, how many solutions which needs to be compiled does it contain?
repository refers to Repository.Id; solution needs to be compiled refers to WasCompiled = 0;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 189 AND T2.WasCompiled = 0
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
List the object classes of image ID 36 with coordinates (0,0).
object classes of image ID 36 refers to OBJ_CLASS where IMG_ID = 36; coordinates (0,0) refer to X and Y coordinates of the bounding box where X = 0 and Y = 0;
SELECT T2.OBJ_CLASS FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.IMG_ID = 36 AND T1.X = 0 AND T1.Y = 0
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
How many in debt customers in the household market segment are from Russia?
in debt customers refer to c_custkey where c_acctbal < 0; c_mktsegment = 'HOUSEHOLD'; Russian is the name of the nation which refers to n_name = 'RUSSIA';
SELECT COUNT(T1.c_custkey) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_acctbal < 0 AND T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'RUSSIA'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
Which zip code in Massachusetts that have more than 1 area code?
"Massachusetts" is the state; zip code more than 1 area code refers to Count (zip_code) > 1
SELECT T1.zip_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.state = 'MA' GROUP BY T1.zip_code HAVING COUNT(T1.area_code) > 1
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
How many solutions contain files found within the repository most people like?
more stars mean more people like this repository; most people like refers to max(Stars);
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = ( SELECT MAX(Stars) FROM Repo )
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
List all the attribute classes of image ID 22.
attribute classes of image ID 22 refer to ATT_CLASS where MG_ID = 22;
SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.IMG_ID = 22
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
How many urgent orders were shipped the next day?
the order is urgent if o_orderpriority = '1-URGENT'; shipped the next day refers to SUBTRACT(l_shipdate, o_orderdate) = 1;
SELECT COUNT(T2.o_orderkey) FROM lineitem AS T1 INNER JOIN orders AS T2 ON T2.o_orderkey = T1.l_orderkey WHERE JULIANDAY(T1.l_shipdate) - JULIANDAY(T2.o_orderdate) = 1 AND T2.o_orderpriority = '1-URGENT'
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
What is the longitude and latitude for the district represented by Grayson Alan?
null
SELECT T1.latitude, T1.longitude FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Grayson' AND T3.last_name = 'Alan'
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Give the repository ID for the solution of method "Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal".
repository ID refers to RepoID; method refers to Name; Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal';
SELECT DISTINCT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
In the Y coordinate of image ID 12, how many are 0?
Y coordinate many are 0 refers to Y coordinates of the bounding box where Y = 0; image ID 12 refers to IMG_ID = 12;
SELECT COUNT(IMG_ID) FROM IMG_OBJ WHERE IMG_ID = 12 AND Y = 0
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
In which country do most of the customers come from?
country refers to n_name; most of the customers refer to MAX(COUNT(c_custkey));
SELECT T.n_name FROM ( SELECT T2.n_name, COUNT(T1.c_custkey) AS num FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name ) AS T ORDER BY T.num DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
Among the zip code under Saint Croix county, which zip code has the biggest land area?
biggest land area refers to Max(land_area); "SAINT CROIX" is the county
SELECT T1.zip_code FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'SAINT CROIX' ORDER BY T2.land_area DESC LIMIT 1
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
Among the solutions that contain files within the repository followed by over 1000 people, how many of them can be implemented without needs of compilation?
followed by over 1000 people refers to Forks >1000; can be implemented without needs of compilation refers to WasCompiled = 1;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks > 1000 AND T2.WasCompiled = 1
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
List all bounding box widths and heights of object sample ID 2.
The bounding box's W and H abbreviations stand for the object's width and height respectively; object sample ID 2 refers to OBJ_SAMPLE_ID = 2;
SELECT W, H FROM IMG_OBJ WHERE OBJ_SAMPLE_ID = 2
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...
retails
When was the order with the highest amount of total price shipped?
when shipped refers to l_shipdate; the highest amount of total price refers to MAX(o_totalprice);
SELECT T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 1
CREATE TABLE partsupp ( ps_supplycost REAL not null, -- foreign key (ps_suppkey) references supplier (s_suppkey) on update cascade on delete cascade, ps_comment TEXT null, -- ps_availqty INTEGER null, -- ps_suppkey INTEGER not null, -- ps_partkey INTEGER not null, -- primary key (ps_partkey, ps_suppkey...
address
List all representatives of districts which have more than 30 000 population in 2020.
more than 30000 population in 2020 refers to population_2020 > 30000; representative refers to first_name, last_name
SELECT T3.first_name, T3.last_name FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T1.population_2020 > 30000 GROUP BY T3.first_name, T3.last_name
CREATE TABLE state ( name TEXT, -- abbreviation TEXT primary key, ); CREATE TABLE country ( zip_code INTEGER, -- foreign key (state) references state(abbreviation), county TEXT, -- primary key (zip_code, county), state TEXT, -- foreign key (zip_code) references zip_data(zip_code), ); CREATE TABLE area...
codebase_comments
For the method which got the tokenized name as 't jadwal entity get single mpic', what is the path time for its solution?
tokenized name refers to NameTokenized; NameTokenized = 't jadwal entity get single mpic'; path time for its solution refers to ProcessedTime;
SELECT DISTINCT T1.ProcessedTime FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 't jadwal entity get single mpic'
CREATE TABLE Method ( ApiCalls TEXT, -- NameTokenized TEXT, -- Name TEXT, -- SolutionId INTEGER, -- CommentIsXml INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0 SampledAt INTEGER, -- Id INTEGER not null primary key autoincrement, Lang TEXT,...
image_and_language
List the object sample IDs of image ID 17 with coordinates (0,0).
object sample ID refers to OBJ_SAMPLE_ID; image ID 17 refers to IMG_ID = 17; coordinates (0,0) refer to X and Y coordinates of the bounding box where X = 0 and Y = 0;
SELECT OBJ_SAMPLE_ID FROM IMG_OBJ WHERE IMG_ID = 17 AND X = 0 AND Y = 0
CREATE TABLE OBJ_CLASSES ( OBJ_CLASS TEXT not null, -- OBJ_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE ATT_CLASSES ( ATT_CLASS TEXT not null, -- ATT_CLASS_ID INTEGER default 0 not null primary key, ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER default 0 not null, -- foreign key (IMG_ID...