messages
list |
---|
[
{
"content": "What is the maximum and minimum market value of companies?",
"role": "user"
},
{
"content": "SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company",
"role": "assistant"
}
]
|
[
{
"content": "What is the headquarter of the company with the largest sales?",
"role": "user"
},
{
"content": "SELECT Headquarters FROM company ORDER BY Sales_in_Billion DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "Show the different headquarters and number of companies at each headquarter.",
"role": "user"
},
{
"content": "SELECT Headquarters , COUNT(*) FROM company GROUP BY Headquarters",
"role": "assistant"
}
]
|
[
{
"content": "Show the most common headquarter for companies.",
"role": "user"
},
{
"content": "SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "Show the headquarters that have at least two companies.",
"role": "user"
},
{
"content": "SELECT Headquarters FROM company GROUP BY Headquarters HAVING COUNT(*) >= 2",
"role": "assistant"
}
]
|
[
{
"content": "Show the headquarters that have both companies in banking industry and companies in oil and gas industry.",
"role": "user"
},
{
"content": "SELECT Headquarters FROM company WHERE Industry = \"Banking\" INTERSECT SELECT Headquarters FROM company WHERE Industry = \"Oil and gas\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of companies and of employees.",
"role": "user"
},
{
"content": "SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID",
"role": "assistant"
}
]
|
[
{
"content": "Show names of companies and that of employees in descending order of number of years working for that employee.",
"role": "user"
},
{
"content": "SELECT T3.Name , T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID ORDER BY T1.Year_working",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of employees that work for companies with sales bigger than 200.",
"role": "user"
},
{
"content": "SELECT T2.Name FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID WHERE T3.Sales_in_Billion > 200",
"role": "assistant"
}
]
|
[
{
"content": "Show the names of companies and the number of employees they have",
"role": "user"
},
{
"content": "SELECT T3.Name , COUNT(*) FROM employment AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID JOIN company AS T3 ON T1.Company_ID = T3.Company_ID GROUP BY T3.Name",
"role": "assistant"
}
]
|
[
{
"content": "List the names of people that are not employed by any company",
"role": "user"
},
{
"content": "SELECT Name FROM people WHERE People_ID NOT IN (SELECT People_ID FROM employment)",
"role": "assistant"
}
]
|
[
{
"content": "list the names of the companies with more than 200 sales in the descending order of sales and profits.",
"role": "user"
},
{
"content": "SELECT name FROM company WHERE Sales_in_Billion > 200 ORDER BY Sales_in_Billion , Profits_in_Billion DESC",
"role": "assistant"
}
]
|
[
{
"content": "How many film are there?",
"role": "user"
},
{
"content": "SELECT count(*) FROM film",
"role": "assistant"
}
]
|
[
{
"content": "Count the number of films.",
"role": "user"
},
{
"content": "SELECT count(*) FROM film",
"role": "assistant"
}
]
|
[
{
"content": "List the distinct director of all films.",
"role": "user"
},
{
"content": "SELECT DISTINCT Director FROM film",
"role": "assistant"
}
]
|
[
{
"content": "What are the different film Directors?",
"role": "user"
},
{
"content": "SELECT DISTINCT Director FROM film",
"role": "assistant"
}
]
|
[
{
"content": "What is the average ticket sales gross in dollars of films?",
"role": "user"
},
{
"content": "SELECT avg(Gross_in_dollar) FROM film",
"role": "assistant"
}
]
|
[
{
"content": "Return the average gross sales in dollars across all films.",
"role": "user"
},
{
"content": "SELECT avg(Gross_in_dollar) FROM film",
"role": "assistant"
}
]
|
[
{
"content": "What are the low and high estimates of film markets?",
"role": "user"
},
{
"content": "SELECT Low_Estimate , High_Estimate FROM film_market_estimation",
"role": "assistant"
}
]
|
[
{
"content": "Return the low and high estimates for all film markets.",
"role": "user"
},
{
"content": "SELECT Low_Estimate , High_Estimate FROM film_market_estimation",
"role": "assistant"
}
]
|
[
{
"content": "What are the types of film market estimations in year 1995?",
"role": "user"
},
{
"content": "SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995",
"role": "assistant"
}
]
|
[
{
"content": "Return the types of film market estimations in 1995.",
"role": "user"
},
{
"content": "SELECT TYPE FROM film_market_estimation WHERE YEAR = 1995",
"role": "assistant"
}
]
|
[
{
"content": "What are the maximum and minimum number of cities in all markets.",
"role": "user"
},
{
"content": "SELECT max(Number_cities) , min(Number_cities) FROM market",
"role": "assistant"
}
]
|
[
{
"content": "Return the maximum and minimum number of cities across all markets.",
"role": "user"
},
{
"content": "SELECT max(Number_cities) , min(Number_cities) FROM market",
"role": "assistant"
}
]
|
[
{
"content": "How many markets have number of cities smaller than 300?",
"role": "user"
},
{
"content": "SELECT count(*) FROM market WHERE Number_cities < 300",
"role": "assistant"
}
]
|
[
{
"content": "Count the number of markets that have a number of cities lower than 300.",
"role": "user"
},
{
"content": "SELECT count(*) FROM market WHERE Number_cities < 300",
"role": "assistant"
}
]
|
[
{
"content": "List all countries of markets in ascending alphabetical order.",
"role": "user"
},
{
"content": "SELECT Country FROM market ORDER BY Country ASC",
"role": "assistant"
}
]
|
[
{
"content": "What are the countries for each market, ordered alphabetically?",
"role": "user"
},
{
"content": "SELECT Country FROM market ORDER BY Country ASC",
"role": "assistant"
}
]
|
[
{
"content": "List all countries of markets in descending order of number of cities.",
"role": "user"
},
{
"content": "SELECT Country FROM market ORDER BY Number_cities DESC",
"role": "assistant"
}
]
|
[
{
"content": "What are the countries for each market ordered by decreasing number of cities?",
"role": "user"
},
{
"content": "SELECT Country FROM market ORDER BY Number_cities DESC",
"role": "assistant"
}
]
|
[
{
"content": "Please show the titles of films and the types of market estimations.",
"role": "user"
},
{
"content": "SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID",
"role": "assistant"
}
]
|
[
{
"content": "What are the titles of films and corresponding types of market estimations?",
"role": "user"
},
{
"content": "SELECT T1.Title , T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID",
"role": "assistant"
}
]
|
[
{
"content": "Show the distinct director of films with market estimation in the year of 1995.",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995",
"role": "assistant"
}
]
|
[
{
"content": "Who are the different directors of films which had market estimation in 1995?",
"role": "user"
},
{
"content": "SELECT DISTINCT T1.Director FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID WHERE T2.Year = 1995",
"role": "assistant"
}
]
|
[
{
"content": "What is the average number of cities of markets with low film market estimate bigger than 10000?",
"role": "user"
},
{
"content": "SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000",
"role": "assistant"
}
]
|
[
{
"content": "Give the average number of cities within markets that had a low market estimation larger than 10000?",
"role": "user"
},
{
"content": "SELECT avg(T2.Number_cities) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T1.Low_Estimate > 10000",
"role": "assistant"
}
]
|
[
{
"content": "Please list the countries and years of film market estimations.",
"role": "user"
},
{
"content": "SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID",
"role": "assistant"
}
]
|
[
{
"content": "What are the countries of markets and their corresponding years of market estimation?",
"role": "user"
},
{
"content": "SELECT T2.Country , T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID",
"role": "assistant"
}
]
|
[
{
"content": "Please list the years of film market estimations when the market is in country \"Japan\" in descending order.",
"role": "user"
},
{
"content": "SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = \"Japan\" ORDER BY T1.Year DESC",
"role": "assistant"
}
]
|
[
{
"content": "What are the years of film market estimation for the market of Japan, ordered by year descending?",
"role": "user"
},
{
"content": "SELECT T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = \"Japan\" ORDER BY T1.Year DESC",
"role": "assistant"
}
]
|
[
{
"content": "List the studios of each film and the number of films produced by that studio.",
"role": "user"
},
{
"content": "SELECT Studio , COUNT(*) FROM film GROUP BY Studio",
"role": "assistant"
}
]
|
[
{
"content": "How films are produced by each studio?",
"role": "user"
},
{
"content": "SELECT Studio , COUNT(*) FROM film GROUP BY Studio",
"role": "assistant"
}
]
|
[
{
"content": "List the name of film studio that have the most number of films.",
"role": "user"
},
{
"content": "SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "What is the name of teh studio that created the most films?",
"role": "user"
},
{
"content": "SELECT Studio FROM film GROUP BY Studio ORDER BY COUNT(*) DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "List the names of studios that have at least two films.",
"role": "user"
},
{
"content": "SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of studios that have made two or more films?",
"role": "user"
},
{
"content": "SELECT Studio FROM film GROUP BY Studio HAVING COUNT(*) >= 2",
"role": "assistant"
}
]
|
[
{
"content": "List the title of films that do not have any market estimation.",
"role": "user"
},
{
"content": "SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)",
"role": "assistant"
}
]
|
[
{
"content": "What are the titles of films that do not have a film market estimation?",
"role": "user"
},
{
"content": "SELECT Title FROM film WHERE Film_ID NOT IN (SELECT Film_ID FROM film_market_estimation)",
"role": "assistant"
}
]
|
[
{
"content": "Show the studios that have produced films with director \"Nicholas Meyer\" and \"Walter Hill\".",
"role": "user"
},
{
"content": "SELECT Studio FROM film WHERE Director = \"Nicholas Meyer\" INTERSECT SELECT Studio FROM film WHERE Director = \"Walter Hill\"",
"role": "assistant"
}
]
|
[
{
"content": "What are the names of studios that have produced films with both Nicholas Meyer and Walter Hill?",
"role": "user"
},
{
"content": "SELECT Studio FROM film WHERE Director = \"Nicholas Meyer\" INTERSECT SELECT Studio FROM film WHERE Director = \"Walter Hill\"",
"role": "assistant"
}
]
|
[
{
"content": "Find the titles and studios of the films that are produced by some film studios that contained the word \"Universal\".",
"role": "user"
},
{
"content": "SELECT title , Studio FROM film WHERE Studio LIKE \"%Universal%\"",
"role": "assistant"
}
]
|
[
{
"content": "What are the titles and studios of films that have been produced by a studio whose name contains \"Universal\"?",
"role": "user"
},
{
"content": "SELECT title , Studio FROM film WHERE Studio LIKE \"%Universal%\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the studios that have not produced films with director \"Walter Hill\".",
"role": "user"
},
{
"content": "SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = \"Walter Hill\"",
"role": "assistant"
}
]
|
[
{
"content": "Which studios have never worked with the director Walter Hill?",
"role": "user"
},
{
"content": "SELECT Studio FROM film EXCEPT SELECT Studio FROM film WHERE Director = \"Walter Hill\"",
"role": "assistant"
}
]
|
[
{
"content": "List the studios which average gross is above 4500000.",
"role": "user"
},
{
"content": "SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000",
"role": "assistant"
}
]
|
[
{
"content": "Which studios have an average gross of over 4500000?",
"role": "user"
},
{
"content": "SELECT Studio FROM film GROUP BY Studio HAVING avg(Gross_in_dollar) >= 4500000",
"role": "assistant"
}
]
|
[
{
"content": "What is the title of the film that has the highest high market estimation.",
"role": "user"
},
{
"content": "SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "Return the title of the film with the highest high estimate?",
"role": "user"
},
{
"content": "SELECT t1.title FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID ORDER BY high_estimate DESC LIMIT 1",
"role": "assistant"
}
]
|
[
{
"content": "What are the titles and directors of the films were never presented in China?",
"role": "user"
},
{
"content": "SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')",
"role": "assistant"
}
]
|
[
{
"content": "Return the titles and directors of films that were never in the market of China.",
"role": "user"
},
{
"content": "SELECT title , director FROM film WHERE film_id NOT IN (SELECT film_id FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.market_id = T2.Market_ID WHERE country = 'China')",
"role": "assistant"
}
]
|
[
{
"content": "How many calendar items do we have?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Ref_calendar",
"role": "assistant"
}
]
|
[
{
"content": "Count the number of all the calendar items.",
"role": "user"
},
{
"content": "SELECT count(*) FROM Ref_calendar",
"role": "assistant"
}
]
|
[
{
"content": "Show all calendar dates and day Numbers.",
"role": "user"
},
{
"content": "SELECT calendar_date , day_Number FROM Ref_calendar",
"role": "assistant"
}
]
|
[
{
"content": "What are all the calendar dates and day Numbers?",
"role": "user"
},
{
"content": "SELECT calendar_date , day_Number FROM Ref_calendar",
"role": "assistant"
}
]
|
[
{
"content": "Show the number of document types.",
"role": "user"
},
{
"content": "SELECT count(*) FROM Ref_document_types",
"role": "assistant"
}
]
|
[
{
"content": "How many document types are there?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Ref_document_types",
"role": "assistant"
}
]
|
[
{
"content": "List all document type codes and document type names.",
"role": "user"
},
{
"content": "SELECT document_type_code , document_type_name FROM Ref_document_types",
"role": "assistant"
}
]
|
[
{
"content": "What are all the document type codes and document type names?",
"role": "user"
},
{
"content": "SELECT document_type_code , document_type_name FROM Ref_document_types",
"role": "assistant"
}
]
|
[
{
"content": "What is the name and description for document type code RV?",
"role": "user"
},
{
"content": "SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = \"RV\"",
"role": "assistant"
}
]
|
[
{
"content": "Give me the name and description of the document type code RV.",
"role": "user"
},
{
"content": "SELECT document_type_name , document_type_description FROM Ref_document_types WHERE document_type_code = \"RV\"",
"role": "assistant"
}
]
|
[
{
"content": "What is the document type code for document type \"Paper\"?",
"role": "user"
},
{
"content": "SELECT document_type_code FROM Ref_document_types WHERE document_type_name = \"Paper\"",
"role": "assistant"
}
]
|
[
{
"content": "Find the code of the document type \"Paper\".",
"role": "user"
},
{
"content": "SELECT document_type_code FROM Ref_document_types WHERE document_type_name = \"Paper\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the number of documents with document type code CV or BK.",
"role": "user"
},
{
"content": "SELECT count(*) FROM All_documents WHERE document_type_code = \"CV\" OR document_type_code = \"BK\"",
"role": "assistant"
}
]
|
[
{
"content": "How many documents have document type code CV or BK?",
"role": "user"
},
{
"content": "SELECT count(*) FROM All_documents WHERE document_type_code = \"CV\" OR document_type_code = \"BK\"",
"role": "assistant"
}
]
|
[
{
"content": "What is the date when the document \"Marry CV\" was stored?",
"role": "user"
},
{
"content": "SELECT date_stored FROM All_documents WHERE Document_name = \"Marry CV\"",
"role": "assistant"
}
]
|
[
{
"content": "When was the document named \"Marry CV\" stored? Give me the date.",
"role": "user"
},
{
"content": "SELECT date_stored FROM All_documents WHERE Document_name = \"Marry CV\"",
"role": "assistant"
}
]
|
[
{
"content": "What is the day Number and date of all the documents?",
"role": "user"
},
{
"content": "SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date",
"role": "assistant"
}
]
|
[
{
"content": "Return the day Number and stored date for all the documents.",
"role": "user"
},
{
"content": "SELECT T2.day_Number , T1.Date_Stored FROM All_documents AS T1 JOIN Ref_calendar AS T2 ON T1.date_stored = T2.calendar_date",
"role": "assistant"
}
]
|
[
{
"content": "What is the document type name for the document with name \"How to read a book\"?",
"role": "user"
},
{
"content": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = \"How to read a book\"",
"role": "assistant"
}
]
|
[
{
"content": "Find the document type name of the document named \"How to read a book\".",
"role": "user"
},
{
"content": "SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = \"How to read a book\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the number of locations.",
"role": "user"
},
{
"content": "SELECT count(*) FROM Ref_locations",
"role": "assistant"
}
]
|
[
{
"content": "How many locations are listed in the database?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Ref_locations",
"role": "assistant"
}
]
|
[
{
"content": "List all location codes and location names.",
"role": "user"
},
{
"content": "SELECT location_code , location_name FROM Ref_locations",
"role": "assistant"
}
]
|
[
{
"content": "What are all the location codes and location names?",
"role": "user"
},
{
"content": "SELECT location_code , location_name FROM Ref_locations",
"role": "assistant"
}
]
|
[
{
"content": "What are the name and description for location code x?",
"role": "user"
},
{
"content": "SELECT location_name , location_description FROM Ref_locations WHERE location_code = \"x\"",
"role": "assistant"
}
]
|
[
{
"content": "Give me the name and description of the location with code x.",
"role": "user"
},
{
"content": "SELECT location_name , location_description FROM Ref_locations WHERE location_code = \"x\"",
"role": "assistant"
}
]
|
[
{
"content": "What is the location code for the country \"Canada\"?",
"role": "user"
},
{
"content": "SELECT location_code FROM Ref_locations WHERE location_name = \"Canada\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the location code of the country \"Canada\".",
"role": "user"
},
{
"content": "SELECT location_code FROM Ref_locations WHERE location_name = \"Canada\"",
"role": "assistant"
}
]
|
[
{
"content": "How many roles are there?",
"role": "user"
},
{
"content": "SELECT count(*) FROM ROLES",
"role": "assistant"
}
]
|
[
{
"content": "Count the total number of roles listed.",
"role": "user"
},
{
"content": "SELECT count(*) FROM ROLES",
"role": "assistant"
}
]
|
[
{
"content": "List all role codes, role names, and role descriptions.",
"role": "user"
},
{
"content": "SELECT role_code , role_name , role_description FROM ROLES",
"role": "assistant"
}
]
|
[
{
"content": "What are all the role codes, role names, and role descriptions?",
"role": "user"
},
{
"content": "SELECT role_code , role_name , role_description FROM ROLES",
"role": "assistant"
}
]
|
[
{
"content": "What are the name and description for role code \"MG\"?",
"role": "user"
},
{
"content": "SELECT role_name , role_description FROM ROLES WHERE role_code = \"MG\"",
"role": "assistant"
}
]
|
[
{
"content": "Find the name and description of the role with code \"MG\".",
"role": "user"
},
{
"content": "SELECT role_name , role_description FROM ROLES WHERE role_code = \"MG\"",
"role": "assistant"
}
]
|
[
{
"content": "Show the description for role name \"Proof Reader\".",
"role": "user"
},
{
"content": "SELECT role_description FROM ROLES WHERE role_name = \"Proof Reader\"",
"role": "assistant"
}
]
|
[
{
"content": "What is the description of the role named \"Proof Reader\"?",
"role": "user"
},
{
"content": "SELECT role_description FROM ROLES WHERE role_name = \"Proof Reader\"",
"role": "assistant"
}
]
|
[
{
"content": "How many employees do we have?",
"role": "user"
},
{
"content": "SELECT count(*) FROM Employees",
"role": "assistant"
}
]
|
[
{
"content": "Find the number of employees we have.",
"role": "user"
},
{
"content": "SELECT count(*) FROM Employees",
"role": "assistant"
}
]
|
[
{
"content": "Show the name, role code, and date of birth for the employee with name 'Armani'.",
"role": "user"
},
{
"content": "SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'",
"role": "assistant"
}
]
|
[
{
"content": "What are the name, role code, and date of birth of the employee named 'Armani'?",
"role": "user"
},
{
"content": "SELECT employee_name , role_code , date_of_birth FROM Employees WHERE employee_Name = 'Armani'",
"role": "assistant"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.