cnatale/presto-athena-txt-2-sql huggingface dataset:
Count the number of budget codes.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Ref_budget_codes
List all budget type codes and descriptions.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_code, budget_type_description FROM Ref_budget_codes
What are the type codes and descriptions of each budget type?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_code, budget_type_description FROM Ref_budget_codes
What is the description for the budget type with code ORG?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = 'ORG'
Return the description of the budget type that has the code ORG.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = 'ORG'
How many documents have expenses?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Documents_with_expenses
Count the number of documents with expenses.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Documents_with_expenses
What are the document ids for the budget type code 'SF'?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'
Give the ids of documents with expenses that have the budget code 'SF'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF'
Show the budget type code and description and the corresponding document id.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code
Return the budget type codes, budget type descriptions and document ids for documents with expenses.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code
Show ids for all documents with budget types described as 'Government'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = 'Government'
Give the ids for documents that have the budget description 'Government'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code = T2.Budget_Type_code WHERE T2.budget_type_Description = 'Government'
Show budget type codes and the number of documents in each budget type.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code
What are the different budget type codes, and how many documents are there for each?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code
What is the budget type code with most number of documents.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1
Give the budget type code that is most common among documents with expenses.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1
What are the ids of documents which don't have expense budgets?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
Return the ids of documents that do not have expenses.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
Show ids for all documents in type CV without expense budgets.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id FROM Documents WHERE document_type_code = 'CV' EXCEPT SELECT document_id FROM Documents_with_expenses
What are the ids of documents with the type code CV that do not have expenses.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT document_id FROM Documents WHERE document_type_code = 'CV' EXCEPT SELECT document_id FROM Documents_with_expenses
What are the ids of documents with letter 's' in the name with any expense budgets.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%'
Give the ids of documents that have expenses and contain the letter s in their names.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%'
How many documents do not have any expense?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)
Count the number of documents that do not have expenses.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)
What are the dates for the documents with both 'GV' type and 'SF' type expenses?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'
Give the dates of creation for documents that have both budget type codes 'GV' and 'SF'.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'
What are the account details with the largest value or with value having char '5' in it?
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE '%5%'
Return the account details with the greatest value, as well as those that include the character 5.
Additional table information: table: cre_Docs_and_Epenses
SQL: SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE '%5%'
Find the total number of scientists.
Additional table information: table: scientist_1
SQL: SELECT COUNT(*) FROM scientists
How many scientists are there?
Additional table information: table: scientist_1
SQL: SELECT COUNT(*) FROM scientists
Find the total hours of all projects.
Additional table information: table: scientist_1
SQL: SELECT SUM(hours) FROM projects
What is the total number of hours for all projects?
Additional table information: table: scientist_1
SQL: SELECT SUM(hours) FROM projects
How many different scientists are assigned to any project?
Additional table information: table: scientist_1
SQL: SELECT COUNT(DISTINCT scientist) FROM assignedto
Count the number of different scientists assigned to any project.
Additional table information: table: scientist_1
SQL: SELECT COUNT(DISTINCT scientist) FROM assignedto
Find the number of distinct projects.
Additional table information: table: scientist_1
SQL: SELECT COUNT(DISTINCT name) FROM projects
How many different projects are there?
Additional table information: table: scientist_1
SQL: SELECT COUNT(DISTINCT name) FROM projects
Find the average hours of all projects.
Additional table information: table: scientist_1
SQL: SELECT AVG(hours) FROM projects
What is the average hours across all projects?
Additional table information: table: scientist_1
SQL: SELECT AVG(hours) FROM projects
Find the name of project that continues for the longest time.
Additional table information: table: scientist_1
SQL: SELECT name FROM projects ORDER BY hours DESC LIMIT 1
What is the name of the project with the most hours?
Additional table information: table: scientist_1
SQL: SELECT name FROM projects ORDER BY hours DESC LIMIT 1
List the name of all projects that are operated longer than the average working hours of all projects.
Additional table information: table: scientist_1
SQL: SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)
What are the names of projects that have taken longer than the average number of hours for all projects?
Additional table information: table: scientist_1
SQL: SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)
Find the name and hours of project that has the most number of scientists.
Additional table information: table: scientist_1
SQL: SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1
What is the name and hours for the project which has the most scientists assigned to it?
Additional table information: table: scientist_1
SQL: SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.
Additional table information: table: scientist_1
SQL: SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'
What is the name of the project that has a scientist assigned to it whose name contains 'Smith'?
Additional table information: table: scientist_1
SQL: SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'
Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.
Additional table information: table: scientist_1
SQL: SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'
What is the sum of hours for projects that scientists with the name Michael Rogers or Carol Smith are assigned to?
Additional table information: table: scientist_1
SQL: SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'
Find the name of projects that require between 100 and 300 hours of work.
Additional table information: table: scientist_1
SQL: SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
What are the names of projects that require between 100 and 300 hours?
Additional table information: table: scientist_1
SQL: SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.
Additional table information: table: scientist_1
SQL: SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax'
What are the names of any scientists who worked on projects named 'Matter of Time' and 'A Puzzling Pattern'?
Additional table information: table: scientist_1
SQL: SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Puzzling Parallax'
List the names of all scientists sorted in alphabetical order.
Additional table information: table: scientist_1
SQL: SELECT name FROM scientists ORDER BY name NULLS FIRST
What are the names of all the scientists in alphabetical order?
Additional table information: table: scientist_1
SQL: SELECT name FROM scientists ORDER BY name NULLS FIRST
Find the number of scientists involved for each project name.
Additional table information: table: scientist_1
SQL: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name
What are the naems of all the projects, and how many scientists were assigned to each of them?
Additional table information: table: scientist_1
SQL: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name
Find the number of scientists involved for the projects that require more than 300 hours.
Additional table information: table: scientist_1
SQL: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name
What are the names of projects that require more than 300 hours, and how many scientists are assigned to each?
Additional table information: table: scientist_1
SQL: SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name
Find the number of projects which each scientist is working on and scientist's name.
Additional table information: table: scientist_1
SQL: SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
What are the names of the scientists, and how many projects are each of them working on?
Additional table information: table: scientist_1
SQL: SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
Find the SSN and name of scientists who are assigned to the project with the longest hours.
Additional table information: table: scientist_1
SQL: SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
What are the SSN and names of scientists working on the project with the most hours?
Additional table information: table: scientist_1
SQL: SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
Find the name of scientists who are assigned to some project.
Additional table information: table: scientist_1
SQL: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
What are the names of scientists who are assigned to any project?
Additional table information: table: scientist_1
SQL: SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
Select the project names which are not assigned yet.
Additional table information: table: scientist_1
SQL: SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)
What are the names of projects that have not been assigned?
Additional table information: table: scientist_1
SQL: SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)
Find the name of scientists who are not assigned to any project.
Additional table information: table: scientist_1
SQL: SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
What are the names of scientists who have not been assigned a project?
Additional table information: table: scientist_1
SQL: SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
Find the number of scientists who are not assigned to any project.
Additional table information: table: scientist_1
SQL: SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
How many scientists do not have any projects assigned to them?
Additional table information: table: scientist_1
SQL: SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
Find the names of scientists who are not working on the project with the highest hours.
Additional table information: table: scientist_1
SQL: SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
What are the names of scientists who are not working on the project with the most hours?
Additional table information: table: scientist_1
SQL: SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
Additional table information: table: scientist_1
SQL: SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name NULLS FIRST, T1.Name NULLS FIRST
What are the names of each scientist, the names of the projects that they work on, and the hours for each of those projects, listed in alphabetical order by project name, then scientist name.
Additional table information: table: scientist_1
SQL: SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name NULLS FIRST, T1.Name NULLS FIRST
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
Additional table information: table: scientist_1
SQL: SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)
What is the name of the project that requires the fewest number of hours, and the names of the scientists assigned to it?
Additional table information: table: scientist_1
SQL: SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)
What is the name of the highest rated wine?
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE ORDER BY Score NULLS FIRST LIMIT 1
Give the name of the wine with the highest score.
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE ORDER BY Score NULLS FIRST LIMIT 1
Which winery is the wine that has the highest score from?
Additional table information: table: wine_1
SQL: SELECT Winery FROM WINE ORDER BY SCORE NULLS FIRST LIMIT 1
What is the winery at which the wine with the highest score was made?
Additional table information: table: wine_1
SQL: SELECT Winery FROM WINE ORDER BY SCORE NULLS FIRST LIMIT 1
Find the names of all wines produced in 2008.
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE YEAR = '2008'
What are the names of all wines produced in 2008?
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE YEAR = '2008'
List the grapes and appelations of all wines.
Additional table information: table: wine_1
SQL: SELECT Grape, Appelation FROM WINE
What are the grapes and appelations of each wine?
Additional table information: table: wine_1
SQL: SELECT Grape, Appelation FROM WINE
List the names and scores of all wines.
Additional table information: table: wine_1
SQL: SELECT Name, Score FROM WINE
What are the names and scores of all wines?
Additional table information: table: wine_1
SQL: SELECT Name, Score FROM WINE
List the area and county of all appelations.
Additional table information: table: wine_1
SQL: SELECT Area, County FROM APPELLATIONS
What are the areas and counties for all appelations?
Additional table information: table: wine_1
SQL: SELECT Area, County FROM APPELLATIONS
What are the prices of wines produced before the year of 2010?
Additional table information: table: wine_1
SQL: SELECT Price FROM WINE WHERE YEAR < 2010
Return the prices of wines produced before 2010.
Additional table information: table: wine_1
SQL: SELECT Price FROM WINE WHERE YEAR < 2010
List the names of all distinct wines that have scores higher than 90.
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE score > 90
What are the names of wines with scores higher than 90?
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE score > 90
List the names of all distinct wines that are made of red color grape.
Additional table information: table: wine_1
SQL: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red'
What are the names of wines made from red grapes?
Additional table information: table: wine_1
SQL: SELECT DISTINCT T2.Name FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red'
Find the names of all distinct wines that have appellations in North Coast area.
Additional table information: table: wine_1
SQL: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast'
What are the distinct names of wines that have appellations in the North Coast area?
Additional table information: table: wine_1
SQL: SELECT DISTINCT T2.Name FROM APPELLATIONs AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'North Coast'
How many wines are produced at Robert Biale winery?
Additional table information: table: wine_1
SQL: SELECT COUNT(*) FROM WINE WHERE Winery = 'Robert Biale'
Count the number of wines produced at Robert Biale winery.
Additional table information: table: wine_1
SQL: SELECT COUNT(*) FROM WINE WHERE Winery = 'Robert Biale'
How many appelations are in Napa Country?
Additional table information: table: wine_1
SQL: SELECT COUNT(*) FROM APPELLATIONS WHERE County = 'Napa'
Count the number of appelations in Napa County.
Additional table information: table: wine_1
SQL: SELECT COUNT(*) FROM APPELLATIONS WHERE County = 'Napa'
Give me the average prices of wines that are produced by appelations in Sonoma County.
Additional table information: table: wine_1
SQL: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'
What is the average price of wines produced in appelations in Sonoma County?
Additional table information: table: wine_1
SQL: SELECT AVG(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma'
What are the names and scores of wines that are made of white color grapes?
Additional table information: table: wine_1
SQL: SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White'
Give the names and scores of wines made from white grapes.
Additional table information: table: wine_1
SQL: SELECT T2.Name, T2.Score FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White'
Find the maximum price of wins from the appelations in Central Coast area and produced before the year of 2005.
Additional table information: table: wine_1
SQL: SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'Central Coast' AND T2.year < 2005
What is the maximum price of wines from the appelation in the Central Coast area, which was produced before 2005?
Additional table information: table: wine_1
SQL: SELECT MAX(T2.Price) FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.Area = 'Central Coast' AND T2.year < 2005
Find the the grape whose white color grapes are used to produce wines with scores higher than 90.
Additional table information: table: wine_1
SQL: SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' AND T2.score > 90
Find the white grape used to produce wines with scores above 90.
Additional table information: table: wine_1
SQL: SELECT DISTINCT T1.Grape FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'White' AND T2.score > 90
What are the wines that have prices higher than 50 and made of Red color grapes?
Additional table information: table: wine_1
SQL: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red' AND T2.price > 50
What are the names of wines made from red grapes and with prices above 50?
Additional table information: table: wine_1
SQL: SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = 'Red' AND T2.price > 50
What are the wines that have prices lower than 50 and have appelations in Monterey county?
Additional table information: table: wine_1
SQL: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Monterey' AND T2.price < 50
Give the neames of wines with prices below 50 and with appelations in Monterey county.
Additional table information: table: wine_1
SQL: SELECT T2.Name FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Monterey' AND T2.price < 50
What are the numbers of wines for different grapes?
Additional table information: table: wine_1
SQL: SELECT COUNT(*), Grape FROM WINE GROUP BY Grape
How many wines are there for each grape?
Additional table information: table: wine_1
SQL: SELECT COUNT(*), Grape FROM WINE GROUP BY Grape
What are the average prices of wines for different years?
Additional table information: table: wine_1
SQL: SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR
What is the average prices of wines for each each?
Additional table information: table: wine_1
SQL: SELECT AVG(Price), YEAR FROM WINE GROUP BY YEAR
Find the distinct names of all wines that have prices higher than some wines from John Anthony winery.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = 'John Anthony')
What are the distinct names of wines with prices higher than any wine from John Anthony winery.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE WHERE Price > (SELECT MIN(Price) FROM wine WHERE Winery = 'John Anthony')
List the names of all distinct wines in alphabetical order.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE ORDER BY Name NULLS FIRST
What are the names of wines, sorted in alphabetical order?
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE ORDER BY Name NULLS FIRST
List the names of all distinct wines ordered by price.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE ORDER BY price NULLS FIRST
What are the names of wines, sorted by price ascending?
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE ORDER BY price NULLS FIRST
What is the area of the appelation that produces the highest number of wines before the year of 2010?
Additional table information: table: wine_1
SQL: SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1
What is the area for the appelation which produced the most wines prior to 2010?
Additional table information: table: wine_1
SQL: SELECT T1.Area FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING T2.year < 2010 ORDER BY COUNT(*) DESC LIMIT 1
What is the color of the grape whose wine products has the highest average price?
Additional table information: table: wine_1
SQL: SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1
Give the color of the grape whose wine products have the highest average price?
Additional table information: table: wine_1
SQL: SELECT T1.Color FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape GROUP BY T2.Grape ORDER BY AVG(Price) DESC LIMIT 1
Find the distinct names of wines produced before the year of 2000 or after the year of 2010.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
Give the distinct names of wines made before 2000 or after 2010.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Name FROM WINE WHERE YEAR < 2000 OR YEAR > 2010
Find the distinct winery of wines having price between 50 and 100.
Additional table information: table: wine_1
SQL: SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
What are the distinct wineries which produce wines costing between 50 and 100?
Additional table information: table: wine_1
SQL: SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100
What are the average prices and cases of wines produced in the year of 2009 and made of Zinfandel grape?
Additional table information: table: wine_1
SQL: SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = 'Zinfandel'
Give the average price and case of wines made from Zinfandel grapes in the year 2009.
Additional table information: table: wine_1
SQL: SELECT AVG(Price), AVG(Cases) FROM WINE WHERE YEAR = 2009 AND Grape = 'Zinfandel'
What are the maximum price and score of wines produced by St. Helena appelation?
Additional table information: table: wine_1
SQL: SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = 'St. Helena'
Give the maximum price and score for wines produced in the appelation St. Helena.
Additional table information: table: wine_1
SQL: SELECT MAX(Price), MAX(Score) FROM WINE WHERE Appelation = 'St. Helena'
What are the maximum price and score of wines in each year?
Additional table information: table: wine_1
SQL: SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR
What are the maximum price and score of wines for each year?
Additional table information: table: wine_1
SQL: SELECT MAX(Price), MAX(Score), YEAR FROM WINE GROUP BY YEAR
What are the average price and score of wines grouped by appelation?
Additional table information: table: wine_1
SQL: SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation
What are the average price and score of wines for each appelation?
Additional table information: table: wine_1
SQL: SELECT AVG(Price), AVG(Score), Appelation FROM WINE GROUP BY Appelation
Find the wineries that have at least four wines.
Additional table information: table: wine_1
SQL: SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4
Which wineries produce at least four wines?
Additional table information: table: wine_1
SQL: SELECT Winery FROM WINE GROUP BY Winery HAVING COUNT(*) >= 4
Find the country of all appelations who have at most three wines.
Additional table information: table: wine_1
SQL: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3
What are the countries for appelations with at most 3 wines?
Additional table information: table: wine_1
SQL: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation GROUP BY T2.Appelation HAVING COUNT(*) <= 3
What are the names of wines whose production year are before the year of all wines by Brander winery?
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = 'Brander')
What are the names of wines produced before any wine from the Brander winery?
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE YEAR < (SELECT MIN(YEAR) FROM WINE WHERE Winery = 'Brander')
What are the names of wines that are more expensive then all wines made in the year 2006?
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)
Give the names of wines with prices above any wine produced in 2006.
Additional table information: table: wine_1
SQL: SELECT Name FROM WINE WHERE Price > (SELECT MAX(Price) FROM WINE WHERE YEAR = 2006)
Find the top 3 wineries with the greatest number of wines made of white color grapes.
Additional table information: table: wine_1
SQL: SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = 'White' GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3
Which 3 wineries produce the most wines made from white grapes?
Additional table information: table: wine_1
SQL: SELECT T2.Winery FROM GRAPES AS T1 JOIN WINE AS T2 ON T1.GRAPE = T2.GRAPE WHERE T1.Color = 'White' GROUP BY T2.Winery ORDER BY COUNT(*) DESC LIMIT 3
List the grape, winery and year of the wines whose price is bigger than 100 ordered by year.
Additional table information: table: wine_1
SQL: SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR NULLS FIRST
What are the grapes, wineries and years for wines with price higher than 100, sorted by year?
Additional table information: table: wine_1
SQL: SELECT Grape, Winery, YEAR FROM WINE WHERE Price > 100 ORDER BY YEAR NULLS FIRST
List the grape, appelation and name of wines whose score is higher than 93 ordered by Name.
Additional table information: table: wine_1
SQL: SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name NULLS FIRST
What are the grapes, appelations, and wines with scores above 93, sorted by Name?
Additional table information: table: wine_1
SQL: SELECT Grape, Appelation, Name FROM WINE WHERE Score > 93 ORDER BY Name NULLS FIRST
Find the appelations that produce wines after the year of 2008 but not in Central Coast area.
Additional table information: table: wine_1
SQL: SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = 'Central Coast'
What are the appelations for wines produced after 2008 but not in the Central Coast area?
Additional table information: table: wine_1
SQL: SELECT Appelation FROM WINE WHERE YEAR > 2008 EXCEPT SELECT Appelation FROM APPELLATIONS WHERE Area = 'Central Coast'
Find the average price of wines that are not produced from Sonoma county.
Additional table information: table: wine_1
SQL: SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')
What is the average price for wines not produced in Sonoma county?
Additional table information: table: wine_1
SQL: SELECT AVG(price) FROM wine WHERE NOT Appelation IN (SELECT T1.Appelation FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = 'Sonoma')
Find the county where produces the most number of wines with score higher than 90.
Additional table information: table: wine_1
SQL: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1
What is the county that produces the most wines scoring higher than 90?
Additional table information: table: wine_1
SQL: SELECT T1.County FROM APPELLATIONS AS T1 JOIN WINE AS T2 ON T1.Appelation = T2.Appelation WHERE T2.Score > 90 GROUP BY T1.County ORDER BY COUNT(*) DESC LIMIT 1
How many train stations are there?
Additional table information: table: train_station
SQL: SELECT COUNT(*) FROM station
Show the name, location, and number of platforms for all stations.
Additional table information: table: train_station
SQL: SELECT name, LOCATION, number_of_platforms FROM station
What are all locations of train stations?
Additional table information: table: train_station
SQL: SELECT DISTINCT LOCATION FROM station
Show the names and total passengers for all train stations not in London.
Additional table information: table: train_station
SQL: SELECT name, total_passengers FROM station WHERE LOCATION <> 'London'
Show the names and main services for train stations that have the top three total number of passengers.
Additional table information: table: train_station
SQL: SELECT name, main_services FROM station ORDER BY total_passengers DESC LIMIT 3
What is the average and maximum number of total passengers for train stations in London or Glasgow?
Additional table information: table: train_station
SQL: SELECT AVG(total_passengers), MAX(total_passengers) FROM station WHERE LOCATION = 'London' OR LOCATION = 'Glasgow'
Show all locations and the total number of platforms and passengers for all train stations in each location.
Additional table information: table: train_station
SQL: SELECT LOCATION, SUM(number_of_platforms), SUM(total_passengers) FROM station GROUP BY LOCATION
Show all locations that have train stations with at least 15 platforms and train stations with more than 25 total passengers.
Additional table information: table: train_station
SQL: SELECT DISTINCT LOCATION FROM station WHERE number_of_platforms >= 15 AND total_passengers > 25
Show all locations which don't have a train station with at least 15 platforms.
Additional table information: table: train_station
SQL: SELECT LOCATION FROM station EXCEPT SELECT LOCATION FROM station WHERE number_of_platforms >= 15
Show the location with most number of train stations.
Additional table information: table: train_station
SQL: SELECT LOCATION FROM station GROUP BY LOCATION ORDER BY COUNT(*) DESC LIMIT 1
Show the name, time, and service for all trains.
Additional table information: table: train_station
SQL: SELECT name, TIME, service FROM train
Show the number of trains
Additional table information: table: train_station
SQL: SELECT COUNT(*) FROM train
Show the name and service for all trains in order by time.
Additional table information: table: train_station
SQL: SELECT name, service FROM train ORDER BY TIME NULLS FIRST
Show the station name and number of trains in each station.
Additional table information: table: train_station
SQL: SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id
show the train name and station name for each train.
Additional table information: table: train_station
SQL: SELECT T2.name, T3.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id
Show all train names and times in stations in London in descending order by train time.
Additional table information: table: train_station
SQL: SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC
Show the station name with greatest number of trains.
Additional table information: table: train_station
SQL: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id ORDER BY COUNT(*) DESC LIMIT 1
Show the station name with at least two trains.
Additional table information: table: train_station
SQL: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id HAVING COUNT(*) >= 2
Show all locations with only 1 station.
Additional table information: table: train_station
SQL: SELECT LOCATION FROM station GROUP BY LOCATION HAVING COUNT(*) = 1
Show station names without any trains.
Additional table information: table: train_station
SQL: SELECT name FROM station WHERE NOT station_id IN (SELECT station_id FROM train_station)
What are the names of the stations which serve both 'Ananthapuri Express' and 'Guruvayur Express' trains?
Additional table information: table: train_station
SQL: SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = 'Ananthapuri Express' INTERSECT SELECT T2.name FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T3.Name = 'Guruvayur Express'
Find the names of the trains that do not pass any station located in London.
Additional table information: table: train_station
SQL: SELECT T2.name FROM train_station AS T1 JOIN train AS T2 ON T1.train_id = T2.train_id WHERE NOT T1.station_id IN (SELECT T4.station_id FROM train_station AS T3 JOIN station AS T4 ON T3.station_id = T4.station_id WHERE t4.location = 'London')
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
Additional table information: table: train_station
SQL: SELECT name, LOCATION FROM station ORDER BY Annual_entry_exit NULLS FIRST, Annual_interchanges NULLS FIRST
List all vehicle id
Additional table information: table: driving_school
SQL: SELECT vehicle_id FROM Vehicles
What are the ids of all vehicles?
Additional table information: table: driving_school
SQL: SELECT vehicle_id FROM Vehicles
How many vehicle in total?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Vehicles
How many vehicles exist?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Vehicles
Show the detail of vehicle with id 1.
Additional table information: table: driving_school
SQL: SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1
What are the details of the car with id 1?
Additional table information: table: driving_school
SQL: SELECT vehicle_details FROM Vehicles WHERE vehicle_id = 1
List the first name middle name and last name of all staff.
Additional table information: table: driving_school
SQL: SELECT first_name, middle_name, last_name FROM Staff
What are the first, middle, and last names of all staff?
Additional table information: table: driving_school
SQL: SELECT first_name, middle_name, last_name FROM Staff
What is the birthday of the staff member with first name as Janessa and last name as Sawayn?
Additional table information: table: driving_school
SQL: SELECT date_of_birth FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
What is the date of birth for the staff member named Janessa Sawayn?
Additional table information: table: driving_school
SQL: SELECT date_of_birth FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
When did the staff member with first name as Janessa and last name as Sawayn join the company?
Additional table information: table: driving_school
SQL: SELECT date_joined_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
When did the staff member named Janessa Sawayn join the company?
Additional table information: table: driving_school
SQL: SELECT date_joined_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
When did the staff member with first name as Janessa and last name as Sawayn leave the company?
Additional table information: table: driving_school
SQL: SELECT date_left_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
When did the staff member Janessa Sawayn leave the company?
Additional table information: table: driving_school
SQL: SELECT date_left_staff FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
How many staff have the first name Ludie?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Staff WHERE first_name = 'Ludie'
How many employees have a first name of Ludie?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Staff WHERE first_name = 'Ludie'
What is the nickname of staff with first name as Janessa and last name as Sawayn?
Additional table information: table: driving_school
SQL: SELECT nickname FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
What is the nickname of the employee named Janessa Sawayn?
Additional table information: table: driving_school
SQL: SELECT nickname FROM Staff WHERE first_name = 'Janessa' AND last_name = 'Sawayn'
How many staff in total?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Staff
How many employees are there?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Staff
Which city does staff with first name as Janessa and last name as Sawayn live?
Additional table information: table: driving_school
SQL: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'
In what city does Janessa Sawayn live?
Additional table information: table: driving_school
SQL: SELECT T1.city FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'
Which country and state does staff with first name as Janessa and last name as Sawayn lived?
Additional table information: table: driving_school
SQL: SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'
In which country and state does Janessa Sawayn live?
Additional table information: table: driving_school
SQL: SELECT T1.country, T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'
How long is the total lesson time took by customer with first name as Rylan and last name as Goodwin?
Additional table information: table: driving_school
SQL: SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Rylan' AND T2.last_name = 'Goodwin'
How long is the total lesson time took by the customer named Rylan Goodwin?
Additional table information: table: driving_school
SQL: SELECT SUM(T1.lesson_time) FROM Lessons AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Rylan' AND T2.last_name = 'Goodwin'
What is the zip code of staff with first name as Janessa and last name as Sawayn lived?
Additional table information: table: driving_school
SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'
What is the zip code of the hosue of the employee named Janessa Sawayn?
Additional table information: table: driving_school
SQL: SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = 'Janessa' AND T2.last_name = 'Sawayn'
How many staff live in state Georgia?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Addresses WHERE state_province_county = 'Georgia'
How many employees live in Georgia?
Additional table information: table: driving_school
SQL: SELECT COUNT(*) FROM Addresses WHERE state_province_county = 'Georgia'
Find out the first name and last name of staff lived in city Damianfort.
Additional table information: table: driving_school
SQL: SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = 'Damianfort'
What is the first and last name of all employees who live in the city Damianfort?
Additional table information: table: driving_school
SQL: SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T1.city = 'Damianfort'
Which city lives most of staffs? List the city name and number of staffs.
Additional table information: table: driving_school
SQL: SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1
In which city do the most employees live and how many of them live there?
Additional table information: table: driving_school
SQL: SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1
List the states which have between 2 to 4 staffs living there.
Additional table information: table: driving_school
SQL: SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING COUNT(*) BETWEEN 2 AND 4