messages
listlengths
3
3
system
stringclasses
1 value
user
stringlengths
473
37.6k
assistant
stringlengths
23
804
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(CASE WHEN Region = 'Midwest' THEN 1 ELSE 0 END) FROM `Sales Team`
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT DISTINCT T FROM ( SELECT CASE WHEN OrderDate > '1/1/18' THEN OrderNumber ELSE NULL END AS T FROM `Sales Orders` ) WHERE T IS NOT NULL
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT COUNT(T1.`Sales Channel`) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.Region = 'Midwest'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE REPLACE(T1.`Unit Price`, ',', '') = ( SELECT REPLACE(T1.`Unit Price`, ',', '') FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID ORDER BY REPLACE(T1.`Unit Pr...
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T2.Region FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.`Sales Channel` = 'Online' ORDER BY T1.`Discount Applied` DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T1.OrderNumber, T1.OrderDate FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Apollo Ltd' ORDER BY T1.`Unit Price` DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT DISTINCT T1.OrderNumber, T1.WarehouseCode FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Elorac, Corp'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T FROM ( SELECT DISTINCT CASE WHEN T3.`Product Name` = 'Cocktail Glasses' AND T2.`Sales Channel` = 'Online' THEN T1.`Customer Names` END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID INNER JOIN Products T3 ON T3.ProductID = T2._ProductID ) WHERE T IS NOT NULL
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T2.StoreID FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID WHERE T2.State = 'Arizona' ORDER BY T1.`Unit Price` - T1.`Unit Cost` DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(CASE WHEN T3.State = 'Florida' THEN T2.`Unit Price` ELSE 0 END) - SUM(CASE WHEN T3.State = 'Texas' THEN T2.`Unit Price` ELSE 0 END) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T1.`Product Name` = 'Com...
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT DISTINCT T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T2.Region = 'Midwest' AND T1.`Order Quantity` > 5
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.State = 'California' AND T1.`Sales Channel` = 'In-Store' AND T1.`Discount Applied` = 0.2 THEN T2.StoreID END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID WHERE T2.OrderDate LIKE '%/%/18' OR T2.OrderDate LIKE '%/%/19' OR T2.OrderDate LIKE '%/%/20' ORDER BY T2.`Order Quantity` DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END), CAST(SUM(CASE WHEN T1.`Product Name` = 'Candles' THEN T2.`Order Quantity` ELSE 0 END) AS REAL) * 100 / SUM(T2.`Order Quantity`) FROM Products AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._ProductID = T1.ProductID INNER JOIN `Store L...
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T FROM ( SELECT DISTINCT CASE WHEN `Sales Team` = 'Joshua Bennett' THEN Region ELSE NULL END AS T FROM `Sales Team` ) WHERE T IS NOT NULL
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT CASE WHEN MAX(Population) THEN StoreID END FROM `Store Locations`
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(CASE WHEN Region = 'Midwest' THEN 1 ELSE 0 END) FROM `Sales Team`
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT CASE WHEN MAX(`Water Area`) THEN Type END FROM `Store Locations`
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(IIF(ShipDate LIKE '6/%/18' AND `Sales Channel` = 'Online', 1, 0)) FROM `Sales Orders`
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT `Discount Applied` FROM `Sales Orders` WHERE REPLACE(`Unit Price`, ',', '') = ( SELECT REPLACE(`Unit Price`, ',', '') FROM `Sales Orders` ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1 ) ORDER BY REPLACE(`Unit Price`, ',', '') DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT AVG(T2.`Household Income`) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode WHERE T1.Region = 'Northeast' GROUP BY T2.State ORDER BY COUNT(T2.StoreID) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.`Median Income` < 30000 THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode ) WHERE T IS NOT NULL
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(CASE WHEN T1.Region = 'West' AND T2.`Land Area` < 20000000 THEN 1 ELSE 0 END) FROM Regions AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StateCode = T1.StateCode
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT `Customer Names` FROM ( SELECT T1.`Customer Names`, T2.`Unit Price` - T2.`Unit Cost` AS "net profit" FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY `net profit` DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.OrderDate LIKE '%/%/19' AND T1.ShipDate LIKE '%/%/19' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T1.`Order Quantity` > 5 AND ShipDate LIKE '5/%/19' ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') ASC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T2.Latitude, T2.Longitude FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 3, 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT COUNT(T1.OrderNumber), T2.`Sales Team` FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE T1.ShipDate LIKE '%/%/20' GROUP BY T2.`Sales Team` ORDER BY COUNT(T1.OrderNumber) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT CAST(COUNT(T1.OrderNumber) AS REAL) / 3 FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID WHERE (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/18') OR (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate LIKE '%/%/19') OR (T2.`Sales Team` = 'Carl Nguyen' AND ShipDate L...
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T1.`Unit Price` * T1.`Discount Applied`, T2.`Product Name` FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID ORDER BY REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '') DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT `Customer Names` FROM ( SELECT T1.`Customer Names` , REPLACE(T2.`Unit Price`, ',', '') * T2.`Order Quantity` - REPLACE(T2.`Unit Price`, ',', '') * T2.`Discount Applied` AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY T DESC LIMIT 3
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT `Sales Channel` FROM `Sales Orders` WHERE OrderDate LIKE '1/%/20' GROUP BY `Sales Channel` ORDER BY COUNT(`Sales Channel`) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T FROM ( SELECT DISTINCT CASE WHEN T2.OrderNumber = 'SO - 0005951' THEN T1.`Product Name` ELSE NULL END AS T FROM Products T1 INNER JOIN `Sales Orders` T2 ON T2._ProductID = T1.ProductID ) WHERE T IS NOT NULL
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T3.`Sales Team`, T1.`City Name` FROM `Store Locations` AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._StoreID = T1.StoreID INNER JOIN `Sales Team` AS T3 ON T3.SalesTeamID = T2._SalesTeamID WHERE T2.OrderNumber = 'SO - 0001004'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT T1.`Customer Names` FROM Customers AS T1 INNER JOIN `Sales Orders` AS T2 ON T2._CustomerID = T1.CustomerID INNER JOIN `Store Locations` AS T3 ON T3.StoreID = T2._StoreID WHERE T3.`City Name` = 'Gilbert' AND T2.ProcuredDate LIKE '%/%/19' ORDER BY REPLACE(T2.`Unit Price`, ',', '') - REPLACE(T2.`Unit Cost`, ',', ''...
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT SUM(CASE WHEN T2.`City Name` = 'Chandler' AND T1.OrderDate LIKE '%/%/20' THEN 1 ELSE 0 END) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT AVG(`Household Income`) FROM `Store Locations` WHERE `City Name` = 'Glendale'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE Customers\n(\n CustomerID INTEGER\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE Customers ( CustomerID INTEGER constraint Customers_pk primary key, "Customer Names" TEXT ) CREATE TABLE Products ( ProductID INTEGER constraint Products_pk primary key, "Product Name" TEXT ) CREATE TABLE Regions ( ...
SELECT MAX(`Discount Applied`) FROM `Sales Orders` WHERE OrderDate LIKE '%/%/20'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(*) FROM matchs WHERE season = 2008 AND AwayTeam = 'Ebbsfleet' AND FTR = 'D'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(COUNT(CASE WHEN country = 'England' THEN division ELSE NULL END) AS REAL) * 100 / COUNT(division) FROM divisions
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) / COUNT(HomeTeam) AS REAL) * 100, CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam), CAST(COUNT(CASE WHEN FTR = 'D' THEN 1 ELSE NULL END) AS REAL) / COUNT(HomeTeam) FROM matchs WHERE HomeTeam = 'Cittadella'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT AwayTeam FROM matchs WHERE HomeTeam = 'Caen' AND season = 2010 AND FTR = 'A' GROUP BY AwayTeam ORDER BY COUNT(AwayTeam) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(SUM(CASE WHEN Div = 'F1' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Div) FROM matchs WHERE Date = '2005-07-30'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(SUM(CASE WHEN HomeTeam = 'Sassuolo' OR AwayTeam = 'Sassuolo' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(FTR) FROM matchs WHERE FTR = 'D'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.HomeTeam,T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'EFL League One' and T1.Div = 'E2'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(DISTINCT CASE WHEN T1.FTHG >= 4 THEN HomeTeam ELSE NULL end) + COUNT(DISTINCT CASE WHEN T1.FTAG >= 4 THEN AwayTeam ELSE NULL end) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T2.name = 'Scottish Championship' AND T1.FTAG = 2 AND T1.FTHG = 2
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Scotland' AND T1.FTHG = 10
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.HomeTeam HWHT , CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T2.country = 'Spain' AND T1.season = 2017
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT ( SELECT COUNT(T1.Div) AS total FROM matchs T1 INNER JOIN divisions T2 ON T2.division = T1.Div WHERE T2.country = 'England' AND T1.season = 2012 ) AS num , CASE WHEN 1 THEN T.result END AS percentage FROM ( SELECT 100.0 * COUNT(T1.Div) / ( SELECT COUNT(T1.Div) FROM matchs T1 INNER JOIN divisions T2 ON T2.divisio...
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT ( SELECT MAX(MAX(FTAG), MAX(FTHG)) FROM matchs WHERE season = 2021 ) AS T1, AwayTeam FROM matchs WHERE season = 2021 AND FTHG = T1 OR FTAG = T1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT HomeTeam FROM matchs WHERE Div = 'P1' AND season = 2021 ORDER BY FTHG DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(COUNT(CASE WHEN FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) - CAST(COUNT(CASE WHEN FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(FTR) DIFFERENCE FROM matchs WHERE season = 2010
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT Div FROM matchs WHERE season = 2008 AND FTR = 'D' GROUP BY Div ORDER BY COUNT(FTR) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT HomeTeam FROM matchs WHERE Div = 'EC' AND Date = '2008-01-20' AND FTR = 'H'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2009-09-13' and T1.HomeTeam = 'Club Brugge' AND T1.AwayTeam = 'Genk'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish Premiership' AND (T1.season BETWEEN 2006 AND 2008)
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT DISTINCT T2.division,T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Hearts' AND T1.AwayTeam = 'Hibernian'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.name = 'Bundesliga' ORDER BY T1.FTAG DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.AwayTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div=T2.division WHERE T2.country = 'Italy' LIMIT 3
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2019 AND T1.FTR = 'D' GROUP BY T2.division ORDER BY COUNT(FTR) LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga' AND T1.HomeTeam = 'Valencia' AND T1.FTR = 'H'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(division) FROM divisions WHERE country = 'England'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT name FROM divisions WHERE country = 'Netherlands'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CASE WHEN FTR = 'H' THEN 'East Fife' ELSE 'Dumbarton' END WINNER FROM matchs WHERE Date = '2009-10-10' AND HomeTeam = 'East Fife' AND AwayTeam = 'Dumbarton'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT FTHG, FTAG FROM matchs WHERE Date = '2009-04-26' AND HomeTeam = 'Bursaspor' AND AwayTeam = 'Denizlispor'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT MIN(Date) FROM matchs WHERE FTHG + FTAG > 10
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam ELSE T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Ligue 2' ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'LaLiga 2' AND T1.Date = '2016-03-27' AND T1.FTR = 'A'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'National League' AND T1.Date = '2018-08-07' AND T1.FTR = 'D'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division GROUP BY T2.country ORDER BY SUM(T1.FTAG) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2011 AND T1.FTHG = 1 AND T1.FTAG = 8
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T2.division, T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-02-22' AND T1.FTAG + T1.FTHG > 5 ORDER BY T1.FTAG + T1.FTHG DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T2.name FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTAG = 0 AND T1.FTHG = 0 GROUP BY T2.division ORDER BY COUNT(T1.FTAG) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Date) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Scottish League One' AND T1.Date = ( SELECT Date FROM matchs WHERE FTHG = 5 AND FTAG = 2 AND HomeTeam = 'Pro Vercelli' AND AwayTeam = 'Pescara' )
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.country = 'Greece' AND T1.FTHG = 5 AND T1.FTAG = 0
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT DISTINCT T2.country FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.HomeTeam = 'Bradford' OR T1.AwayTeam = 'Bradford'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(DISTINCT T1.HomeTeam) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Eredivisie' AND T1.season = 2008
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Bundesliga'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(COUNT(CASE WHEN T2.name = 'Liga NOS' THEN T1.Div ELSE NULL END) AS REAL) * 100 / COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.FTHG = 1 AND FTAG = 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T2.name = 'Premier League'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CASE WHEN T1.FTR = 'H' THEN T1.HomeTeam WHEN T1.FTR = 'A' THEN T1.AwayTeam END WINNER FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.Date = '2020-10-02' AND T2.name = 'Bundesliga'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'H' GROUP BY T1.HomeTeam ORDER BY COUNT(T1.FTR) DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.AwayTeam = 'Werder Bremen' AND T1.FTR = 'A'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'A' AND T1.season = 2021
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(T1.Div) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.FTR = 'D'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT COUNT(CASE WHEN T2.name = 'Bundesliga' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T2.name = 'Premier League' THEN 1 ELSE NULL END) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT DISTINCT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H' AND T2.name = 'Bundesliga'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CASE WHEN COUNT(CASE WHEN T1.HomeTeam = 'Augsburg' THEN 1 ELSE NULL END) - COUNT(CASE WHEN T1.HomeTeam = ' Mainz' THEN 1 ELSE NULL END) > 0 THEN 'Augsburg' ELSE 'Mainz' END FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.FTR = 'H'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT T1.HomeTeam FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021 ORDER BY T1.FTHG DESC LIMIT 1
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT SUM(T1.FTHG) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Bundesliga' AND T1.season = 2021
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE divisions\n(\n division TEXT not null\n ...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE divisions ( division TEXT not null primary key, name TEXT, country TEXT ) CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, ...
SELECT CAST(COUNT(CASE WHEN T1.FTR = 'H' THEN 1 ELSE NULL END) + COUNT(CASE WHEN T1.FTR = 'A' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(t1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T1.season = 2021 AND T1.AwayTeam = 'Club Brugge' OR T1.HomeTeam = 'Club Brugge'
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE awards_players\n(\n playerID TEXT not null,\n...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) ...
SELECT CAST(homeWon AS REAL) * 100 / won FROM teams
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE awards_players\n(\n playerID TEXT not null,\n...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) ...
SELECT name FROM teams WHERE CAST(lost AS REAL) * 100 / games > 75
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE awards_players\n(\n playerID TEXT not null,\n...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) ...
SELECT T1.name, T1.won FROM teams AS T1 INNER JOIN ( SELECT * FROM teams WHERE year = 2004 ) AS T2 on T1.tmID = T2.tmID WHERE T1.year = 2005 and T1.won > T2.won
[ { "role": "system", "content": "You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE awards_players\n(\n playerID TEXT not null,\n...
You are an expert SQL assistant. Given a database schema and a question, generate the correct SQL query. Output only the SQL query, no explanation.
### Database Schema CREATE TABLE awards_players ( playerID TEXT not null, award TEXT not null, year INTEGER not null, lgID TEXT null, note TEXT null, pos TEXT null, primary key (playerID, year, award), foreign key (playerID) references players (playerID) ...
SELECT name, o_pts FROM teams WHERE CAST((homeWon - homeLost) AS REAL) * 100 / games > 80