db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
human_resources | List the full name and social security number of the account representative with average performance. | full name = firstname, lastname; social security number refers to ssn; account representative is a position title; average performance refers to performance = 'Average' | SELECT T1.firstname, T1.lastname, T1.ssn FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Average' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
student_loan | List at least 5 students who have payment due and are enlisted in Peace Corps organization? | have payment due refers to bool = 'pos'; organization refers to organ; organ = 'Peace Corps'; | SELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T2.organ = 'peace_corps' AND T1.bool = 'pos' LIMIT 5 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
human_resources | What is the maximum salary of position "Trainer"? | maximum salary refers to maxsalary; Trainee is a positiontitle | SELECT maxsalary FROM position WHERE positiontitle = 'Trainee' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
superstore | Please list any three orders that caused a loss to the company. | caused a loss to the company refers to Profit < 0 | SELECT `Order ID` FROM central_superstore WHERE Profit < 0 LIMIT 3 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | Which positions are suitable with 4 years degree education? | 4 years degree education refers to educationrequired = '4 year degree'; positions refers to positiontitle | SELECT positiontitle FROM position WHERE educationrequired = '4 year degree' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
student_loan | Calculate the average number of female students who are disabled and who joined Foreign Legion organization. | average = DIVIDE(COUNT(disabled.name who are not in male.name WHERE organ = 'foreign_legion'), COUNT(disabled.name)); female students who are disabled refers to disabled.name who are NOT in male.name; organization refers to organ; organ = 'Foreign Legion'; | SELECT CAST(SUM(IIF(T3.name IS NULL, 1, 0)) AS REAL) / COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name WHERE T2.organ = 'foreign_legion' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | What is the shipment duration for order number CA-2011-134103? | shipment duration = subtract("Ship Date", "Order Date"); order number CA-2011-134103 refers to "Order ID" = 'CA-2011-134103' | SELECT DISTINCT strftime('%J', `Ship Date`) - strftime('%J', `Order Date`) AS duration FROM central_superstore WHERE `Order ID` = 'CA-2011-134103' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | Which city and address has zip code of above 90000? | zip code of above 90000 refers to zipcode > 90000; city refers to locationcity | SELECT locationcity, address FROM location WHERE zipcode > 90000 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
student_loan | How many disabled students are female? | female refers to disabled.name who are NOT in male.name; | SELECT COUNT(name) FROM disabled WHERE name NOT IN ( SELECT name FROM male ) | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | Provide the shipping dates and products of the orders by Gene Hale. | Gene Hale' refers to "Customer Name"; shipping date refers to "Ship Date"; products refers to "Product Name" | SELECT DISTINCT T2.`Ship Date`, T3.`Product Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T1.`Customer Name` = 'Gene Hale' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | List the location cities in the Western states. | Western states refers to state = 'CO' OR state = 'UT' OR state = 'CA'; location cities refers to locationcity | SELECT locationcity FROM location WHERE state IN ('CO', 'UT', 'CA') | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
student_loan | Calculate the percentage of students who have never been absent. | percentage = CONCAT(DIVIDE(MULTIPLY(COUNT(name WHERE month = 0), 100), COUNT(name)),'%'); never been absent refers to month = 0; | SELECT CAST(SUM(IIF(month = 0, 1, 0)) AS REAL) * 100 / COUNT(name) FROM longest_absense_from_school | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | Among the orders with sales value of no less than 5,000 in west superstore, how many were bought by the customers in California? | customers in California refers to State = 'California'; orders with sales value of no less than 5,000 refers to Sales > = 5,000 | SELECT COUNT(DISTINCT T1.`Order ID`) FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` INNER JOIN people AS T3 ON T3.`Customer ID` = T1.`Customer ID` WHERE T1.Sales > 5000 AND T3.State = 'California' AND T2.Region = 'West' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | Mention the employee's full name and performance status who got the lowest in salary per year. | full name = firstname, lastname; the lowest salary refers to MIN(salary) | SELECT firstname, lastname, performance FROM employee ORDER BY salary ASC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | How many cities are in the Philippines? | Philippines refers to CountryCode = 'PHL'; | SELECT COUNT(ID) FROM City WHERE Name = 'PHL' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | How many disabled students have payment due? | have payment due refers to bool = 'pos'; | SELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T2.bool = 'pos' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | In which segment does the customer who purchased the product from the east superstore with the highest original price belong? | highest original price refers to max(divide(Sales, subtract(1, Discount))) | SELECT T2.Segment FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T1.Region = 'East' ORDER BY (T1.Sales / (1 - T1.Discount)) DESC LIMIT 1 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | In which state can you find the highest amount of good performing Account Representatives? | good performing refers to performance = 'Good'; Account Representatives is a positiontitle; highest amount of employee refers to MAX(positionID); | SELECT T2.state FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T1.performance = 'Good' GROUP BY T2.state ORDER BY COUNT(T2.state) DESC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | What country in Asia has the largest gross national product(GNP)? | Asia refers to Continent = 'Asia'; largest gross national product refers to MAX(GNP); | SELECT Name FROM Country WHERE Continent = 'Asia' ORDER BY GNP DESC LIMIT 1 | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
human_resources | What is the average salary of the worst performing managers? | the worst performing refers to performance = 'Poor'; manager is a positiontitle; average salary refers to AVG(salary) | SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' AND T2.positiontitle = 'Manager' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | List all the countries in Asia. | Asia refers to Continent = 'Asia'; | SELECT Name FROM Country WHERE Continent = 'Asia' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | How many students enlisted in the navy? | navy refers to organ = 'navy'; | SELECT COUNT(name) FROM enlist WHERE organ = 'navy' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | List the products ordered by Matt Abelman from the Western store in 2013. | ordered by Matt Abelman refers to "Customer Name" = 'Matt Abelman'; in 2013 refers to "Order Date" like '2013%' | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Matt Abelman' AND STRFTIME('%Y', T1.`Order Date`) = '2013' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | How many Account Representatives are there in Illinois with satisfying performance? | Account Representatives is a position title; satisfying performance mostly refers togood performance | SELECT COUNT(*) FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID INNER JOIN position AS T3 ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Account Representative' AND T1.performance = 'Good' AND T2.state = 'IL' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | What country declared its independence in 1994? | declared independence in 1994 refers to IndepYear = 1994; | SELECT Name FROM Country WHERE IndepYear = 1994 | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | List at least 10 students who have no payment due and are enlisted in Fire Department organization. | no payment due refers to bool = 'neg'; organization refers to organ; organ = 'fire_department'; | SELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T1.bool = 'neg' AND T2.organ = 'fire_department' LIMIT 10 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | List the products ordered by customers in Coachella. | in Coachella refers to City = 'Coachella'; products refers to "Product Name" | SELECT DISTINCT T3.`Product Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.City = 'Coachella' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | Which position has the highest number of female employees with a 2 year degree? | 2 year degree refers to educationrequired = '2 year degree'; female refers to gender = 'F'; the highest number of employees refers to MAX(positionID) | SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree' AND T1.gender = 'F' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | In English speaking countries, provide the difference between the number of countries with republic and constitutional monarchy as its government form. | English speaking refers to Language = 'English' ; difference = SUBTRACT(COUNT(Language = 'English' WHERE GovernmentForm = 'Republic'), COUNT(Language = 'English' WHERE GovernmentForm = 'ConstitutionalMonarchy')); | SELECT COUNT(T1.GovernmentForm = 'Republic') - COUNT(T1.GovernmentForm = 'ConstitutionalMonarchy') FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | How many students are enlisted in the Navy organization? | enlisted in the navy organization refers to organ = 'navy'; | SELECT COUNT(name) FROM enlist WHERE organ = 'navy' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
human_resources | Which position has the highest amount of poor performing employees? | poor performing employees refers to performance = 'Poor'; the highest amount of employees refers to MAX(positiontitle) | SELECT T2.positiontitle FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.performance = 'Poor' GROUP BY T2.positiontitle ORDER BY COUNT(T2.positiontitle) DESC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | Among the countries that have GNP greater than 1500, what is the percentage of the countries have English as its language? | GNP greater than 1500 refers to GNP > 1500 ; percentage = MULTIPLY(DIVIDE(SUM(Code WHERE GNP > 1500 AND Language = 'English'), COUNT(Code WHERE GNP > 1500)) 1.0); English as its language refers to Language = 'English'; | SELECT CAST(SUM(IIF(T2.Language = 'English', 1, 0)) AS REAL) * 100 / COUNT(T1.Code) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GNP > 1500 | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | Provide the students' names and schools who enrolled for 15 months. | enrolled for 15 months refers to month = 15; | SELECT name, school FROM enrolled WHERE month = 15 | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | How many orders of O'Sullivan Plantations 2-Door Library in Landvery Oak in central superstore were shipped through the shipping mode with the fastest delivery speed? | 'O'Sullivan Cherrywood Estates Traditional Bookcase' is the "Product Name"; shipping mode with the fastest delivery speed refers to "Ship Mode" = 'First Class' | SELECT COUNT(DISTINCT T1.`Order ID`) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.`Product Name` = 'O''Sullivan Plantations 2-Door Library in Landvery Oak' AND T2.Region = 'Central' AND T1.`Ship Mode` = 'First Class' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | How many male Regional Managers are there? | male refers to gender = 'M'; Regional Managers is a position title | SELECT COUNT(*) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Regional Manager' AND T1.gender = 'M' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | Who is the head of the country where Santa Catarina district belongs? | head of the country refers to HeadOfState; | SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.District = 'Santa Catarina' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | Calculate the ratio in percentage between the average number of female and male students who joined Fire Department organization. | ratio = CONCAT(MULTIPLY(DIVIDE(COUNT(enlist.name WHERE organ = 'fire_department' which is NOT in male.name), COUNT(enlist.name WHERE organ = 'fire_department),'%'))) AS FEMALE; ratio = CONCAT(MULTIPLY(DIVIDE(COUNT(enlist.name WHERE organ = 'fire_department' which is IN male.name), COUNT(enlist.name WHERE organ = 'fire_... | SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name), CAST(SUM(IIF(T2.name IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE T1.organ = 'fire_department' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
superstore | What is the name of the corporate customer from Rhode Island who had the highest number of orders in 2016 from the east superstore? | corporate customer refers to Segment = 'Corporate'; Rhode Island refers to State = 'Rhode Island'; in 2016 refers to "Order Date" BETWEEN '2016-01-01' AND '2016-12-31'; east superstore refers to Region = 'East'; highest number of orders refers to max(order_number); name of corporate customer refers to "Customer Name" | SELECT T2.`Customer Name` FROM east_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T2.Segment = 'Corporate' AND T2.State = 'Rhode Island' AND T2.Region = 'East' AND STRFTIME('%Y', T1.`Order Date`) = '2016' GROUP BY T2.`Customer Name` ORDER BY COUNT(T2.`Customer Name`) DESC LIMIT 1 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | What is the average salary of all employees with a 2 year degree position? | 2 year degree refers to educationrequired = '2 year degree'; calculation = DIVIDE(SUM(salary), COUNT(positiontitle)) | SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T2.educationrequired = '2 year degree' | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | List down the districts belong to the country headed by Adolf Ogi. | headed by Adolf Ogi refers to HeadOfState = 'Adolf Ogi'; | SELECT T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = 'Adolf Ogi' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | List down the enrolled schools and duration of student214. | enrolled schools refers to school; duration refers to month; student214 is a name of student; | SELECT school, month FROM enrolled WHERE name = 'student214' | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
human_resources | What is the full office location address where most of the employees work at? | full office location address = address, locationcity, state, zipcode; location where most employees work at refers to MAX(locationID) | SELECT T2.address, T2.locationcity, T2.state, T2.zipcode FROM employee AS T1 INNER JOIN location AS T2 ON T1.locationID = T2.locationID GROUP BY T2.address, T2.locationcity, T2.state, T2.zipcode ORDER BY COUNT(*) DESC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | Provide the language used by the people of Belize. | Belize is a name of country; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belize' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
superstore | What are the names of the ordered products that have profit deficiency in central superstore? | names of the ordered products refers to Product Name; deficiency refers to profit value is negative; profit > 0 | SELECT DISTINCT T2.`Product Name` FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'Central' AND T1.Profit < 0 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
student_loan | What is the ratio of students who have payment due and those who do not have payment due? | ratio = DIVIDE(COUNT(name WHERE `bool` = 'pos'), COUNT(name WHERE `bool` = 'neg')); have payment due refers to `bool` = 'pos'; no payment due refers to `bool` = 'neg'; | SELECT CAST(SUM(IIF(`bool` = 'pos', 1, 0)) AS REAL) / SUM(IIF(`bool` = 'neg', 1, 0)) FROM no_payment_due | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
human_resources | How much is the minimum salary given to the position with the most complex work? | most complex work refers to MAX(educationrequired); minimum salary refers to minsalary | SELECT minsalary FROM position ORDER BY educationrequired DESC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | How many languages are used in Cyprus? | Cyprus is a name of Country; | SELECT SUM(CASE WHEN T1.Name = 'Cyprus' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | List down the student names who did not file for bankruptcy. | students name who did not file a bankruptcy refers to person.name who are NOT in filed_for_bankrupcy.name; | SELECT name FROM person WHERE name NOT IN ( SELECT name FROM filed_for_bankrupcy ) | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
human_resources | How much is the salary of the first ever employee that was hired? | first-ever employee that was hired refers to MIN(hiredate) | SELECT salary FROM employee ORDER BY hiredate ASC LIMIT 1 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | Give the cities and district names that belong to the country with Hajastan as its local name. | null | SELECT T2.Name, T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LocalName = 'Hajastan' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
superstore | In west superstore, what is the name and the shipping mode of the product that was ordered with the shortest shipment time? | name refers to "Product Name"; shipping mode refers to Ship Mode; shortest shipment time refers to min(subtract(Ship Date, Order Date)) | SELECT DISTINCT T2.`Product Name`, T1.`Ship Mode` FROM west_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Region = 'West' ORDER BY T1.`Ship Date` - T1.`Order Date` LIMIT 1 | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | How many positions have a maximum salary of no more than US$1000,000? | maximum salary of no more than US$1000,000 refers to maxsalary < '100000'; | SELECT COUNT(*) FROM position WHERE CAST(REPLACE(SUBSTR(maxsalary, 4), ',', '') AS REAL) < 100000 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | What are the official languages used in Belgium? | official languages refers to IsOfficial = 'T'; Belgium is a name of country; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belgium' AND T2.IsOfficial = 'T' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
human_resources | Who is the employee with the highest salary? Specify his/her full name. | the highest salary refers to MAX(salary); full name = firstname, lastname | SELECT firstname, lastname FROM employee WHERE CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL)) FROM employee ) | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | List down the languages of the countries that have population below 8000. | population below 8000 refers to Population < 8000; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Population < 8000 | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
student_loan | Calculate the average enlisted students per organization. | average = DIVIDE(FLOOR(COUNT(NAME), COUNT(DISTINCT organ))); | SELECT CAST(COUNT(NAME) AS REAL) * 100 / COUNT(DISTINCT organ) FROM enlist | CREATE TABLE longest_absense_from_school
(
"name" TEXT default '' not null primary key,
foreign key ("name") references person ("name") on update cascade on delete cascade,
"month" INTEGER default 0 null, -- Example Values: `0`, `1`, `2`, `3`, `4` | Value Statics: Total count 1000 - Distinct count 10 - Null count 0 ... |
human_resources | How many employees whose performance is poor have a salary of over $50,000 per year? | performance is poor refers to performance = 'Poor'; salary of over $50,000 refers to salary > '50000' | SELECT COUNT(*) FROM employee WHERE performance = 'Poor' AND CAST(REPLACE(SUBSTR(salary, 4), ',', '') AS REAL) > 50000 | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
world | What is the surface area of the country where Sutton Coldfield city belongs? | null | SELECT T1.SurfaceArea FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Sutton Coldfield' | CREATE TABLE Country
(
`Name` TEXT NOT NULL DEFAULT '', --
`SurfaceArea` REAL NOT NULL DEFAULT 0.00, --
`Continent` TEXT NOT NULL DEFAULT 'Asia', -- Example Values: `North America`, `Asia`, `Africa`, `Europe`, `South America` | Value Statics: Total count 239 - Distinct count 7 - Null count 0
`Population` INT... |
superstore | How many orders were made by Corey Roper in 2015? | null | SELECT COUNT(T2.`Customer ID`) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Corey Roper' AND STRFTIME('%Y', T2.`Ship Date`) = '2015' | CREATE TABLE west_superstore
(
Profit REAL, --
Region TEXT, -- Example Values: `West` | Value Statics: Total count 6406 - Distinct count 1 - Null count 0
"Product ID" TEXT, --
foreign key ("Product ID", Region) references product("Product ID",Region),
"Order Date" DATE, --
foreign key ("Customer ID", Reg... |
human_resources | If Jose Rodriguez tried his best, how many percentage can his salary raise without changing his position? | Jose Rodriguez is the full name of an employee; full name = firstname, lastname; calculation = DIVIDE(SUBTRACT(maxsalary, salary), salary) * 100 | SELECT 100 * (CAST(REPLACE(SUBSTR(T2.maxsalary, 4), ',', '') AS REAL) - CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) AS per FROM employee AS T1 INNER JOIN position AS T2 ON T1.positionID = T2.positionID WHERE T1.firstname = 'Jose' AND T1.lastname = 'Rodr... | CREATE TABLE position
(
minsalary TEXT, -- Example Values: `US$25,000.00`, `US$50,000.00`, `US$18,000.00`, `US$100,000.00` | Value Statics: Total count 4 - Distinct count 4 - Null count 0
maxsalary TEXT, -- Example Values: `US$75,000.00`, `US$150,000.00`, `US$25,000.00`, `US$250,000.00` | Value Statics: Total coun... |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 14