messages
listlengths
3
3
system
stringclasses
1 value
user
stringlengths
326
8.38k
assistant
stringlengths
18
577
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT count(*) FROM budget WHERE budgeted > 3000 AND YEAR <= 2001
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT T2.school_name , T1.budgeted , T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.year >= 2002
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT DISTINCT donator_name FROM endowment
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT count(*) FROM budget WHERE budgeted < invested
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T2.school_name = 'Glenn'
[ { "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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id JOIN endowment AS T3 ON T2.school_id = T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted) > 100 OR sum(T3.amount) > 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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id WHERE T1.amount > 8.5 GROUP BY T1.school_id HAVING count(*) > 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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT count(*) FROM (SELECT * FROM endowment WHERE amount > 8.5 GROUP BY school_id HAVING count(*) > 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 \"School\" (\n\"School_id\" text,\n\"School_name...
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 "School" ( "School_id" text, "School_name" text, "Location" text, "Mascot" text, "Enrollment" int, "IHSAA_Class" text, "IHSAA_Football_Class" text, "County" text, PRIMARY KEY ("School_id") ) CREATE TABLE "budget" ( "School_id" int, "Year" int, "Budgeted" int, "total_budget_percent_budg...
SELECT T1.School_name , T1.Mascot , T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id = T2.school_id WHERE Budgeted > 6000 OR YEAR < 2003 ORDER BY T2.total_budget_percent_invested , T2.total_budget_percent_budgeted
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT count(*) FROM building
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT name , street_address , floors FROM building ORDER BY floors
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT name FROM building ORDER BY height_feet 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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT avg(floors) , max(floors) , min(floors) FROM building
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT count(*) FROM building WHERE height_feet > (SELECT avg(height_feet) FROM building) OR floors > (SELECT avg(floors) FROM building)
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT name FROM building WHERE height_feet >= 200 AND floors >= 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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT institution , LOCATION FROM institution WHERE founded > 1990 AND TYPE = 'Private'
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT TYPE , count(*) , sum(enrollment) FROM institution GROUP BY TYPE
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) 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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT TYPE FROM institution WHERE founded > 1990 AND enrollment >= 1000
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution)
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT T1.name , count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id GROUP BY T1.building_id
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING count(*) >= 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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT DISTINCT TYPE FROM institution
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT T1.institution , count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id GROUP BY T1.institution_id
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id WHERE T1.founded > 1880 OR T1.type = 'Private'
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT T2.protein_name , T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id
[ { "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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id = T2.institution_id JOIN building AS T3 ON T3.building_id = T1.building_id WHERE T3.floors >= 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 \"building\" (\n\"building_id\" text,\n\"Name\" ...
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 "building" ( "building_id" text, "Name" text, "Street_address" text, "Years_as_tallest" text, "Height_feet" int, "Floors" int, PRIMARY KEY("building_id") ) CREATE TABLE "Institution" ( "Institution_id" text, "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment...
SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein)
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity > 800
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema WHERE openning_year = 2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year = 2011
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT count(*) FROM cinema
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT count(*) FROM cinema
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT name , openning_year , capacity FROM cinema
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT name , LOCATION FROM cinema WHERE capacity > (SELECT avg(capacity) FROM cinema)
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT DISTINCT LOCATION FROM cinema
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT DISTINCT LOCATION FROM cinema
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT name , openning_year FROM cinema ORDER BY openning_year DESC
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT name , LOCATION FROM cinema ORDER BY capacity 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT avg(capacity) , min(capacity) , max(capacity) FROM cinema WHERE openning_year >= 2011
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION , count(*) FROM cinema GROUP BY LOCATION
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema WHERE openning_year >= 2010 GROUP BY LOCATION ORDER BY count(*) 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) >= 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT title , directed_by FROM film
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT title , directed_by FROM film
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT DISTINCT directed_by FROM film
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT DISTINCT directed_by FROM film
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT directed_by , count(*) FROM film GROUP BY directed_by
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT T2.name , sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id = T2.cinema_id GROUP BY T1.cinema_id
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT T2.title , max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT T3.name , T2.title , T1.date , T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT title , directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT LOCATION FROM cinema WHERE capacity > 300 GROUP BY LOCATION HAVING count(*) > 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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT count(*) FROM film WHERE title LIKE "%Dummy%"
[ { "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 \"film\" (\n\"Film_ID\" int,\n\"Rank_in_series\"...
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 "film" ( "Film_ID" int, "Rank_in_series" int, "Number_in_season" int, "Title" text, "Directed_by" text, "Original_air_date" text, "Production_code" text, PRIMARY KEY ("Film_ID") ) CREATE TABLE "cinema" ( "Cinema_ID" int, "Name" text, "Openning_year" int, "Capacity" int, "Location" text...
SELECT count(*) FROM film WHERE title LIKE "%Dummy%"
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T1.good_or_bad_customer FROM customers AS T1 JOIN discount_coupons AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.coupon_amount = 500
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T1.customer_id , T1.first_name , count(*) FROM Customers AS T1 JOIN bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT customer_id , sum(amount_paid) FROM Payments GROUP BY customer_id ORDER BY sum(amount_paid) 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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T1.booking_id , T1.amount_of_refund FROM Bookings AS T1 JOIN Payments AS T2 ON T1.booking_id = T2.booking_id GROUP BY T1.booking_id ORDER BY count(*) 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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT product_id FROM products_booked GROUP BY product_id HAVING count(*) = 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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T2.product_description FROM products_booked AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.booked_amount = 102.76
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T3.booking_start_date , T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection 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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T2.product_name FROM view_product_availability AS T1 JOIN products_for_hire AS T2 ON T1.product_id = T2.product_id WHERE T1.available_yn = 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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT count(DISTINCT product_type_code) FROM products_for_hire
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT first_name , last_name , gender_mf FROM customers WHERE good_or_bad_customer = 'good' ORDER BY last_name
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT avg(amount_due) FROM payments
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT max(booked_count) , min(booked_count) , avg(booked_count) FROM products_booked
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT DISTINCT payment_type_code FROM payments
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT daily_hire_cost FROM Products_for_hire WHERE product_name LIKE '%Book%'
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT count(*) FROM Products_for_hire WHERE product_id NOT IN ( SELECT product_id FROM products_booked WHERE booked_amount > 200 )
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'good' INTERSECT SELECT T1.coupon_amount FROM Discount_Coupons AS T1 JOIN customers AS T2 ON T1.coupon_id = T2.coupon_id WHERE T2.good_or_bad_customer = 'bad'
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check'
[ { "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 `Discount_Coupons` (\n`coupon_id` INTEGER PRIMAR...
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 `Discount_Coupons` ( `coupon_id` INTEGER PRIMARY KEY, `date_issued` DATETIME, `coupon_amount` DECIMAL(19,4) ) CREATE TABLE `Customers` ( `customer_id` INTEGER PRIMARY KEY, `coupon_id` INTEGER NOT NULL, `good_or_bad_customer` VARCHAR(4), `first_name` VARCHAR(80), `last_name` VARCHAR(80)...
SELECT product_name , product_description FROM products_for_hire WHERE product_type_code = 'Cutlery' AND daily_hire_cost < 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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT count(*) FROM phone
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Name FROM phone ORDER BY Price ASC
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Memory_in_G , Carrier FROM phone
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile"
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Carrier FROM phone ORDER BY 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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Carrier , COUNT(*) FROM phone GROUP BY Carrier
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) 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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT T3.Name , T2.District FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID ORDER BY T2.Ranking
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT T3.Name FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID WHERE T2.Num_of_shops > 50
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT T2.Name , sum(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT T2.Name FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name HAVING sum(T1.Num_of_stock) >= 2000 ORDER BY sum(T1.Num_of_stock) DESC
[ { "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 \"phone\" (\n\"Name\" text,\n\"Phone_ID\" int,\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 "phone" ( "Name" text, "Phone_ID" int, "Memory_in_G" int, "Carrier" text, "Price" real, PRIMARY KEY ("Phone_ID") ) CREATE TABLE "market" ( "Market_ID" int, "District" text, "Num_of_employees" int, "Num_of_shops" real, "Ranking" int, PRIMARY KEY ("Market_ID") ) CREATE TABLE "phone_mark...
SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market)
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT count(*) FROM company
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT count(*) FROM company
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT company , rank FROM company ORDER BY Sales_billion DESC
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT company , rank FROM company ORDER BY Sales_billion DESC
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT company , main_industry FROM company WHERE headquarters != 'USA'
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT company , main_industry FROM company WHERE headquarters != 'USA'
[ { "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 \"company\" (\n\"Company_ID\" int,\n\"Rank\" int...
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 "company" ( "Company_ID" int, "Rank" int, "Company" text, "Headquarters" text, "Main_Industry" text, "Sales_billion" real, "Profits_billion" real, "Assets_billion" real, "Market_Value" real, PRIMARY KEY ("Company_ID") ) CREATE TABLE "gas_station" ( "Station_ID" int, "Open_Year" int, "L...
SELECT company , headquarters FROM company ORDER BY market_value DESC