db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
address
Name the country with the largest number of households in a residential area.
the largest number of households refers to MAX(households);
SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.county ORDER BY T2.households 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
What is the github address of the solution path "joeyrobert_bloomfilter\DataTypes.BloomFilter.sln"?
github address refers to Url; solution path refers to Path; Path = 'joeyrobert_bloomfilter\DataTypes.BloomFilter.sln';
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'joeyrobert_bloomfilterDataTypes.BloomFilter.sln'
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 corresponding classes for attributes of image id 8.
classes for attributes refers to ATT_CLASS; image id 8 refers to IMG_ID = 8
SELECT T2.ATT_CLASS FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 8
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...
retail_world
How many products supplied by Plutzer Lebensmittelgromrkte AG that is currently out of stock and on order?
Plutzer Lebensmittelgromrkte AG refers to CompanyName; is currently out of stock and on order refers to UnitsInStock = 0 and UnitsOnOrder > 0
SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Plutzer Lebensmittelgromrkte AG' AND T1.UnitsInStock = 0 AND T1.UnitsOnOrder = 0
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Which state has greater than 50 CBSA officers of metro type?
greater than 50 CBSA officers of metro type refers to COUNT(CBSA_type = 'Metro') > 50;
SELECT T2.state FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_type = 'Metro' GROUP BY T2.state HAVING COUNT(T1.CBSA_type) > 50
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
List 5 github address that the solutions can be implemented without the need of compilation.
github address refers to Url; solution can be implemented without the need of compliation refers to WasCompiled = 1;
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.WasCompiled = 1 LIMIT 5
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 unique id number identifying the onion object class?
unique id number identifying refers to OBJ_CLASS_ID; onion object class refers to OBJ_CLASS = 'onion'
SELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS = 'onion'
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...
retail_world
What are the highest salary earn by the the employee and what is his/her position in the company?
highest salary refers to max(salary); position refers to Title
SELECT Salary, Title FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Among the area code 787, list the country of the cities with a postal point type of unique postal office.
postal point type of unique postal office refers to type = 'Unique Post Office';
SELECT DISTINCT T2.county FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code INNER JOIN zip_data AS T3 ON T1.zip_code = T3.zip_code WHERE T1.area_code = '787' AND T3.type = 'Unique Post Office'
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
List all the tokenized name of the solution path "jurney_P4Backup\P4Backup\P4Backup.sln ".
tokenized name refers to NameTokenized; solution path refers to Path; Path = 'jurney_P4Backup\P4Backup\P4Backup.sln';
SELECT DISTINCT T2.NameTokenized FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'jurney_P4BackupP4BackupP4Backup.sln'
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 are the corresponding classes for the "very large bike" attribute?
attribute refers to ATT_CLASS
SELECT ATT_CLASS_ID FROM ATT_CLASSES WHERE ATT_CLASS = 'very large'
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...
retail_world
How many employees from USA with Sales Representative title?
from USA refers to Country = 'USA'
SELECT COUNT(Country) FROM Employees WHERE Country = 'USA' AND Title = 'Sales Representative'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
codebase_comments
List 5 solution path that has sampling time of 636431758961741000.
solution path refers to Path; sampling time refers to SampledAt; SampledAt = '636431758961741000';
SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SampledAt = 636431758961741000 LIMIT 5
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 are the id of all the objects belonging to the transportation class?
id of all the objects belonging to the transportation class refers to OBJ_CLASS_ID and OBJ_CLASS IN ('bus', 'train', 'aeroplane', 'car', 'etc.')
SELECT OBJ_CLASS_ID FROM OBJ_CLASSES WHERE OBJ_CLASS IN ('bus', 'train', 'aeroplane', 'car', 'etc')
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...
retail_world
How many suppliers are from UK?
from UK refers to Country = 'UK'
SELECT COUNT(SupplierID) FROM Suppliers WHERE Country = 'UK'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Indicate the name of the country with a population greater than 10000 in 2010.
population greater than 10000 in 2010 refers to population_2010 > 10000;
SELECT DISTINCT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2010 > 10000
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...
image_and_language
How many objects are there in the attribute class id with the highest number of objects?
objects refers to OBJ_SAMPLE_ID; attribute class id with the highest number of objects refers to max(COUNT(ATT_CLASS_ID))
SELECT COUNT(ATT_CLASS_ID) FROM IMG_OBJ_att GROUP BY IMG_ID ORDER BY COUNT(ATT_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...
retail_world
What are the the total number of territory in each region?
null
SELECT COUNT(TerritoryDescription) FROM Territories WHERE RegionID IN (1, 2, 3, 4) GROUP BY RegionID
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Among the types of postal points in Saint Croix, what percentage of postal points is the post office?
DIVIDE(COUNT(type = 'Post Office' ), COUNT(type)) as percentage where county = 'SAINT CROIX';
SELECT CAST(COUNT(CASE WHEN T2.type = 'Post Office' THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(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'
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 solution path does the repository with 111 stars, 58 forks, and 111 watchers?
solution path refers to Path;
SELECT COUNT(T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 111 AND T1.Forks = 58 AND T1.Watchers = 111
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 ids of the images that have a self-relation relationship.
ids of the images refers to IMG_ID; self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
SELECT DISTINCT IMG_ID FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID
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...
retail_world
How many territory fall into region 1?
region 1 refers to RegionID = 1
SELECT COUNT(TerritoryID) FROM Territories WHERE RegionID = 1
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
What is the Asian population in the city with the alias Leeds?
null
SELECT SUM(T2.asian_population) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Leeds'
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
List all the method name of the solution path "graffen_NLog.Targets.Syslog\src\NLog.Targets.Syslog.sln ".
method name refers to Name; solution path refers to Path; Path = 'graffen_NLog.Targets.Syslog\src\NLog.Targets.Syslog.sln';
SELECT DISTINCT T2.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'graffen_NLog.Targets.SyslogsrcNLog.Targets.Syslog.sln'
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
How many images have at least 25 attributes?
images refers to IMG_ID; have at least 25 attributes refers to count(ATT_CLASS_ID) > = 25
SELECT COUNT(*) FROM ( SELECT IMG_ID FROM IMG_OBJ_att GROUP BY IMG_ID HAVING COUNT(ATT_CLASS_ID) > 25 ) T1
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...
retail_world
What percentage does the shipment of products by Speedy Express to Sweden make up to the shipping company's total?
Speedy Express is a company; Sweden is a ShipCountry; calculation = DIVIDE(SUM(ShipCountry = 'Sweden'), SEM(ShipCountry)) * 100
SELECT CAST(COUNT(CASE WHEN T1.ShipCountry = 'Sweden' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Speedy Express'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
In cities that do not implement daylight savings, what is the total number of cities?
do not implement daylight savings refers to daylight_savings = 'No';
SELECT COUNT(T1.area_code) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.daylight_savings = 'No'
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 liked by people does the solution path "ninject_Ninject\Ninject.sln " have?
how many liked by people refers to Stars; solution path refers to Path; Path = 'ninject_Ninject\Ninject.sln';
SELECT DISTINCT T1.Stars FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'ninject_NinjectNinject.sln'
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
How many times is the number of images containing "broccoli" than "tomato"?
images refers to IMG_ID; "broccoli" refers to OBJ_CLASS = 'broccoli'; "tomato" refers to OBJ_CLASS = 'tomato' ; How many times = divide(count(OBJ_SAMPLE_ID) when OBJ_CLASS = 'broccoli', count(OBJ_SAMPLE_ID) when OBJ_CLASS = 'tomato')
SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'broccoli' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.OBJ_CLASS = 'tomato' THEN T2.OBJ_SAMPLE_ID ELSE NULL END) times FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID
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...
retail_world
List the cities where the product 'Mishi Kobe Niku' were shipped to.
cities refers to ShipCity; 'Mishi Kobe Niku' is a ProductName
SELECT T1.ShipCity FROM Orders AS T1 INNER JOIN `Order Details` AS T2 ON T1.OrderID = T2.OrderID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T3.ProductName = 'Mishi Kobe Niku'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Calculate the percentage of households in residential areas of countries over 10000.
DIVIDE(SUM(households > 10000), SUM(households)) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.households > 10000 THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
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 language code of method is used for the github address "https://github.com/managedfusion/managedfusion.git "?
language code of method refers to Lang; github address refers to Url; Url = 'https://github.com/managedfusion/managedfusion.git';
SELECT COUNT(DISTINCT T3.Lang) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/managedfusion/managedfusion.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
State the object class of sample no.10 of image no.2320341.
object class refers to OBJ_CLASS; sample no.10 refers to OBJ_SAMPLE_ID = 10; image no.2320341 refers to IMG_ID = 2320341
SELECT T1.OBJ_CLASS FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2320341 AND T2.OBJ_SAMPLE_ID = 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...
retail_world
Which products by Plutzer Lebensmittelgromrkte AG were discontinued and what are their price?
products refers to ProductName; 'Plutzer Lebensmittelgromrkte AG' is a CompanyName; price refers to UnitPrice; discontinued products refers to discontinued = 1
SELECT T1.UnitPrice FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Plutzer Lebensmittelgromrkte AG' AND T1.Discontinued = 1
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
codebase_comments
Provide the github address with the summary of method "A test for Decompose ".
github address refers to Url; summary of method refers to Summary; Summary = 'A test for Decompose';
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T3.Summary = 'A test for Decompose'
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
How many samples of "wall" are there in image no.2353079?
samples of "wall" refers to OBJ_SAMPLE_ID and OBJ_CLASS = 'wall' ; image no.2353079 refers to IMG_ID = 2353079
SELECT SUM(CASE WHEN T1.OBJ_CLASS = 'wall' THEN 1 ELSE 0 END) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2353079
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...
retail_world
Name all products supplied by Zaanse Snoepfabriek.
products refers to ProductName; 'Zaanse Snoepfabriek' is a CompanyName
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Zaanse Snoepfabriek'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
List down the names of the cities belonging to Noble, Oklahoma.
the county of Noble is located in the state of Oklahoma;
SELECT T3.city FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T1.name = 'Oklahoma' AND T2.county = 'NOBLE'
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
What is the average processed time of the solution with a repository of 254 likes, 88 followers, and 254 watchers?
average processed time = AVG(ProcessedTime);
SELECT CAST(SUM(T2.ProcessedTime) AS REAL) / COUNT(T2.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 254 AND T1.Forks = 88 AND T1.Watchers = 254
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 object whose attribute is blurry in image no.2377993? Give the explanation about the object.
attribute is blurry refers to ATT_CLASS = 'blurry'; image no.2377993 refers to IMG_ID = 22377993; explanation about the object refers to OBJ_CLASS
SELECT T4.OBJ_CLASS_ID, T4.OBJ_CLASS FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T2.ATT_CLASS = 'blurry' AND T1.IMG_ID = 22377993
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...
retail_world
Name the suppliers that supply products under the category 'cheeses.'
suppliers refers to CompanyName; 'cheeses' is a Description
SELECT DISTINCT T1.CompanyName FROM Suppliers AS T1 INNER JOIN Products AS T2 ON T1.SupplierID = T2.SupplierID INNER JOIN Categories AS T3 ON T2.CategoryID = T3.CategoryID WHERE T3.Description = 'Cheeses'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
What is the elevation of the city with the alias East Longmeadow?
null
SELECT T2.elevation FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'East Longmeadow'
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...
trains
How many cars are there on train no.1?
train no.1 refers to train_id = 1
SELECT COUNT(id) FROM cars WHERE train_id = 1
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
Tell the attribute of the weeds in image no.2377988.
attribute of the weeds refers to OBJ_CLASS = 'weeds'; image no.2377988 refers to IMG_ID = 2377988
SELECT T2.ATT_CLASS FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T1.IMG_ID = T3.IMG_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE T4.OBJ_CLASS = 'weeds' AND T1.IMG_ID = 2377988
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...
retail_world
Please give the contact name for Tokyo Traders.
Tokyo Traders refers to CompanyName = 'Tokyo Traders'
SELECT ContactName FROM Suppliers WHERE CompanyName = 'Tokyo Traders'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
codebase_comments
Tell the path of the solution for the method "ExportToRTF.RTFStyleSheet.H6Write".
path of the solution refers to Path; method refers to Name; Name = 'ExportToRTF.RTFStyleSheet.H6Write';
SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'ExportToRTF.RTFStyleSheet.H6Write'
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 relationship between "feathers" and "onion" in image no.2345528?
relationship refers to PRED_CLASS; "feathers" and "onion" in image no.2345528 refers to IMG_ID = 2345528 and OBJ_CLASS = 'feathers' and OBJ_CLASS = 'onion'
SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_SAMPLE_ID INNER JOIN OBJ_CLASSES AS T4 ON T3.OBJ_CLASS_ID = T4.OBJ_CLASS_ID WHERE (T4.OBJ_CLASS = 'feathers' OR T4.OBJ_CLASS = 'onion') AND T2.IMG_ID = 2345...
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...
retail_world
The product 'Mozzarella di Giovanni' belongs in which category? Include the category's description as well.
Mozzarella di Giovanni' is a ProductName; category refers to CategoryName;
SELECT T2.CategoryName, T2.Description FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.ProductName = 'Mozzarella di Giovanni'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Among the cities with alias St Thomas, provide the type of postal point for each city.
null
SELECT DISTINCT T2.type FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'St Thomas'
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...
trains
Please list the IDs of all the trains with at least one car in a non-regular shape.
non-regular shape refers to shape in ('elipse', 'bucket')
SELECT train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
Give the number of images containing the object sample of "suit".
number of images refers to IMG_ID; object sample of "suit" refers to OBJ_CLASS = 'suit'
SELECT COUNT(T.IMG_ID) FROM ( SELECT T2.IMG_ID FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T1.OBJ_CLASS = 'suit' GROUP BY T2.IMG_ID ) T
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...
retail_world
Name the products where the suppliers come from Finland.
'Finland' is a Country; product refers to ProductName; suppliers refers to SupplierID
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'Finland'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Provide the alias of the city with the highest population in year 2020.
the highest population in year 2020 refers to MAX(population_2020);
SELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2020 = ( SELECT MAX(population_2020) 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...
trains
How many trains are there that run in the east direction?
east is a direction
SELECT COUNT(id) FROM trains WHERE direction = 'east'
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
How many samples of food object are there in image no.6?
samples of food object refers to OBJ_CLASS = 'food'; image no.6 refers to IMG_ID = 6
SELECT COUNT(T2.OBJ_SAMPLE_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 6 AND T1.OBJ_CLASS = 'food'
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...
retail_world
How many orders were shipped via Federal Shipping?
'Federal Shipping' is a CompanyName; orders refers to OrderID
SELECT COUNT(T1.OrderID) FROM Orders AS T1 INNER JOIN Shippers AS T2 ON T1.ShipVia = T2.ShipperID WHERE T2.CompanyName = 'Federal Shipping' AND T1.ShipVia = 3
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Give the country and area code of the city with zip code 1116.
null
SELECT T2.county, T1.area_code FROM area_code AS T1 INNER JOIN country AS T2 ON T1.zip_code = T2.zip_code WHERE T1.zip_code = 1116
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...
trains
What is the shape of the tail car on train no.1?
train no.1 refers to train_id = 1; tail car refers to position = 4
SELECT shape FROM cars WHERE train_id = 1 AND position = 4
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
Give the object number of the sample which has the relationship of "lying on" with object sample no.1 from image no.2345524.
object number of the sample refers to OBJ1_SAMPLE_ID; object sample no.1 from image no.2345524 refers to OBJ2_SAMPLE_ID = 1 and IMG_ID = 2345524
SELECT T2.OBJ1_SAMPLE_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345524 AND T1.PRED_CLASS = 'lying on' AND T2.OBJ2_SAMPLE_ID = 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...
retail_world
List all the territories where Laura Callahan is in charge.
territories refers to TerritoryDescription; Laura Callahan is the full name of an employee; full name refers to FirstName, LastName
SELECT T3.TerritoryDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T1.FirstName = 'Laura' AND T1.LastName = 'Callahan'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Among the listed cities, provide the area code of the city with the largest water area.
the largest water area refers to MAX(water_area);
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.water_area = ( SELECT MAX(water_area) 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...
trains
Please list the IDs of all the cars on train no.1 that have 2 wheels.
train no.1 refers to train_id = 1; 2 wheels refers to wheels = 2
SELECT id FROM cars WHERE train_id = 1 AND wheels = 2
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
What is the relationship between object sample no.12 and no.8 of image no.2345511?
relationship refers to PRED_CLASS; object sample no.12 and no.8 of image no.2345511 refers to IMG_ID = 2345511 AND OBJ1_SAMPLE_ID = 12 AND OBJ2_SAMPLE_ID = 8
SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 2345511 AND T2.OBJ1_SAMPLE_ID = 12 AND T2.OBJ2_SAMPLE_ID = 8
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...
retail_world
What is the full name of the employee who is in charge of the territory of Denver?
full name refers to FirstName, LastName; Denver is a TerritoryDescription
SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID WHERE T3.TerritoryDescription = 'Denver'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
List the area code of the city with the highest Hispanic population.
the highest Hispanic population refers to MAX(hispanic_population);
SELECT T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.hispanic_population = ( SELECT MAX(hispanic_population) 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
Give the repository Url of the one with most solutions.
repository URL refers to Url; repository Url with most solutions refers to MAX(COUNT(Solution.Id));
SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) 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
Give the number of samples in image no.2377985 whose attribute is electrical.
number of samples refers to OBJ_SAMPLE_ID; image no.2377985 refers to IMG_ID = 2377985; attribute is electrical refers to ATT_CLASS = 'electrical'
SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915
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...
retail_world
Sir Rodney's Marmalade is supplied by which company and who is the contact for this company?
'Sir Rodney's Marmalade' is a ProductName; company refers to CompanyName; contact for a company refers to ContactName
SELECT T2.CompanyName, T2.ContactName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.ProductName LIKE 'Sir Rodney%s Marmalade'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
What are the zip code for the Senate house?
House of Repsentatives can stand for senate house
SELECT T2.zip_code FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.House = 'House of Repsentatives' GROUP BY T2.zip_code
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...
trains
Please list the IDs of all the trains that run in the east direction and have less than 4 cars.
less than 4 cars refers to carsNum < 4
SELECT T1.id FROM trains AS T1 INNER JOIN ( SELECT train_id, MAX(position) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'east' AND T2.carsNum < 4
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
How many white objects are there in image no.2347915?
white objects refers to ATT_CLASS = 'white'; image no.2347915 refers to IMG_ID = 2347915
SELECT SUM(CASE WHEN T2.ATT_CLASS = 'white' THEN 1 ELSE 0 END) FROM IMG_OBJ_ATT AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.IMG_ID = 2347915
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...
retail_world
List all product names under Confections.
'Confections' is a CompanyName;
SELECT T1.ProductName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T2.CategoryName = 'Confections'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
What is the average of the white population in the cities with area code 920?
AVG(white_population) where area_code = 920;
SELECT AVG(T2.white_population) FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.area_code = 920
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...
trains
How many cars on train no.1 have the roof open?
train no. 1 refers to train_id = 1; roof open refers to roof = 'none'
SELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none'
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
Give the bounding box of the kite in image no.2324765.
bounding box refers to (x, y, W, H); kite refers to OBJ_CLASS = 'kite'; image no.2324765 refers to IMG_ID = 2324765
SELECT T2.X, T2.Y, T2.W, T2.H FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 2324765 AND T1.OBJ_CLASS = 'kite'
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...
retail_world
What is the full address of Rattlesnake Canyon Grocery?
full address refers to ShipAddress, ShipCity, ShipRegion,ShipPostalCode, ShipCountry; 'Rattlesnake Canyon Grocery' is a ShipName;
SELECT DISTINCT ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry FROM Orders WHERE ShipName = 'Rattlesnake Canyon Grocery'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
What is the elevation of the city belonging to Hampden, Massachusetts?
the county of Hampden is located in the state of Massachusetts.
SELECT T3.elevation FROM state AS T1 INNER JOIN country AS T2 ON T1.abbreviation = T2.state INNER JOIN zip_data AS T3 ON T2.zip_code = T3.zip_code WHERE T1.name = 'Massachusetts' AND T2.county = 'HAMPDEN' GROUP BY T3.elevation
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...
trains
Among the trains that run in the east direction, how many of them have more than 2 long cars?
more than 2 long cars refers to longCarsNum > 2
SELECT SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
Provide the number of predicted classes.
predicted classes refers to PRED_CLASS
SELECT COUNT(PRED_CLASS_ID) FROM PRED_CLASSES
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...
retail_world
Write the address and phone number of Margaret Peacock.
Margaret Peacock is the full name of an employee; full name refers to FirstName, LastName; phone number refers to HomePhone
SELECT Address, HomePhone FROM Employees WHERE FirstName = 'Margaret' AND LastName = 'Peacock'
CREATE TABLE Products ( CategoryID INTEGER, -- Example Values: `1`, `2`, `7`, `6`, `8` | Value Statics: Total count 77 - Distinct count 8 - Null count 0 Unit TEXT, -- ReorderLevel INT, -- ProductName TEXT, -- Price REAL DEFAULT 0, -- FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID), Supplier...
address
Give the alias of the cities with an Asian population of 7.
Asian population of 7 refers to asian_population = 7;
SELECT T1.alias FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.asian_population = 7
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...
trains
Among the trains that run in the east direction, how many of them have at least one car in a non-regular shape?
non-regular shape refers to shape in ('elipse', 'bucket')
SELECT SUM(CASE WHEN T1.shape IN ('bucket', 'elipse') THEN 1 ELSE 0 end)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
How many object classes are there in the database?
object classes refers to OBJ_CLASS
SELECT COUNT(OBJ_CLASS_ID) FROM OBJ_CLASSES
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...
address
List down the country of the cities with a population greater than 97% of the average population of all countries in 2020.
population_2020 > MULTIPLY(0.97, AVG(population_2020));
SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.population_2020 > 0.97 * ( SELECT AVG(population_2020) 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...
trains
Please list the IDs of all the cars with double sides on trains that run in the west direction.
double sides on trains refers to sides = 'double'
SELECT T1.id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.sides = 'double'
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
State the total number of the attribute classes.
attribute classes refers to ATT_CLASS
SELECT COUNT(ATT_CLASS_ID) FROM ATT_CLASSES
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...
codebase_comments
For the repository with '8094' watchers , how many solutions does it contain?
repository refers to Repo.Id and RepoId; solutions a repository contains refers to Solution.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = 8094
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 percentage of the object samples in the class of "man" in image no.1?
object samples refers to OBJ_SAMPLE_ID; class of "man" refers to OBJ_CLASS = 'man'; image no.1 refers to IMG_ID = 1; percentage = divide(count(OBJ_SAMPLE_ID)when OBJ_CLASS = 'man', count(OBJ_SAMPLE_ID)) as percentage
SELECT CAST(COUNT(CASE WHEN T1.OBJ_CLASS = 'man' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.OBJ_CLASS_ID) FROM OBJ_CLASSES AS T1 INNER JOIN IMG_OBJ AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.IMG_ID = 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...
address
Which city has the most bad aliases?
the most bad aliases refer to MAX(COUNT(bad_alias));
SELECT T2.city FROM avoid AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code GROUP BY T1.bad_alias ORDER BY COUNT(T1.zip_code) 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...
trains
In which direction does the train with an ellipse-shape car run?
shape = 'ellipse'
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
What is the average difference in the y coordinate of 2 object samples with the relation "parked on" in image no.1?
relation "parked on" refers to PRED_CLASS = 'parked on'; image no.1 refers to IMG_ID = 1; average difference in the y coordinate = divide(sum(Y), count(PRED_CLASS)) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID
SELECT CAST(SUM(T3.Y) AS REAL) / COUNT(CASE WHEN T1.PRED_CLASS = 'parked on' THEN 1 ELSE NULL END) FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID
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...
address
Provide the zip codes and coordinates of the postal points under Allentown-Bethlehem-Easton, PA-NJ.
coordinates refer to latitude and longitude; under Allentown-Bethlehem-Easton, PA-NJ refers to CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ';
SELECT T2.zip_code, T2.latitude, T2.longitude FROM CBSA AS T1 INNER JOIN zip_data AS T2 ON T1.CBSA = T2.CBSA WHERE T1.CBSA_name = 'Allentown-Bethlehem-Easton, PA-NJ'
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 does the repository which has 1445 Forks contain?
solutions refers to Solution.Id; repository refers to Repository.Id;
SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 1445
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 are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1?
bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of "by" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1
SELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by'
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...
address
Among the cities with alias Ponce, what is the percentage of cities with a country level FIPS code of less than 20?
DIVIDE(COUNT(county_fips < 20), COUNT(county_fips)) as percentage where alias = 'Ponce';
SELECT CAST(COUNT(CASE WHEN T2.county_fips < 20 THEN T2.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T2.zip_code) FROM alias AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.alias = 'Ponce'
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...
trains
Please list the shapes of all the head cars on the trains that run in the east direction.
head cars refers to position = 1;
SELECT T1.shape FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.position = 1 GROUP BY T1.shape
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
To which predicted relation class does the self-relation of the object sample in image no.5 belong?
predicted relation class refers to PRED_CLASS; self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID; image no.5 refers to IMG_ID = 5
SELECT T1.PRED_CLASS FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T2.IMG_ID = 5 AND T2.OBJ1_SAMPLE_ID = T2.OBJ2_SAMPLE_ID
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...
trains
Please list the directions in which the trains with at least one empty-loaded car run.
at least one empty-loaded car run refers to load_num = 0
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0
CREATE TABLE cars ( `id` INTEGER NOT NULL, -- `load_shape` TEXT DEFAULT NULL, -- Example Values: `circle`, `hexagon`, `triangle`, `rectangle`, `diamond` | Value Statics: Total count 63 - Distinct count 5 - Null count 0 `train_id` INTEGER DEFAULT NULL, -- `load_num` INTEGER DEFAULT NULL, -- Example Values: `1...
image_and_language
Please list the IDs of all the images with more than 2 pairs of object samples with the relation "parked on".
IDs of all the images refers to IMG_ID; relation "parked on" refers to PRED_CLASS = 'parked on'; more than 2 pairs refers to count(IMG_ID) where OBJ1_SAMPLE_ID ! = OBJ2_SAMPLE_ID
SELECT T2.IMG_ID FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID WHERE T1.PRED_CLASS = 'parked on' AND T2.OBJ1_SAMPLE_ID != T2.OBJ2_SAMPLE_ID GROUP BY T2.IMG_ID HAVING COUNT(T2.IMG_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...
address
Count the number of postal points in the district represented by Kirkpatrick Ann.
postal points refer to zip_code;
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.first_name = 'Kirkpatrick' AND T1.last_name = 'Ann'
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...