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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T2.year FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY T1.stars 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.stars , T2.director , max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director != "null" GROUP BY director |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.stars , T2.director , max(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director != "null" GROUP BY director |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.rID , T1.stars , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.rID , T1.stars , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.rID |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.stars , T2.director , min(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title , T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars > 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT mID , avg(stars) FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT mID , avg(stars) FROM Rating WHERE mID NOT IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris" |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT mID FROM Rating EXCEPT SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris" |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT mID , avg(stars) FROM Rating GROUP BY mID 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT mID , avg(stars) FROM Rating GROUP BY mID 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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT rID FROM Rating EXCEPT SELECT rID FROM Rating WHERE stars = 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT rID FROM Rating WHERE stars != 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT rID FROM Rating WHERE stars != 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT DISTINCT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID JOIN Reviewer AS T3 ON T1.rID = T3.rID WHERE T3.name = 'Brittany Harris' OR T2.year > 2000 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT title FROM Movie WHERE director = "James Cameron" OR YEAR < 1980 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT title FROM Movie WHERE director = "James Cameron" OR YEAR < 1980 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 3 INTERSECT SELECT T2.name FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T1.stars = 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4 |
[
{
"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 Movie(\n\tmID int primary key, \n\ttitle text, \... | You 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 Movie(
mID int primary key,
title text,
year int,
director text
)
CREATE TABLE Reviewer(
rID int primary key,
name text)
CREATE TABLE Rating(
rID int,
mID int,
stars int,
ratingDate date,
FOREIGN KEY (mID) references Movie(mID),
FOREIGN KEY (rID) references Reviewer... | SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 3 INTERSECT SELECT T2.title FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars = 4 |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT count(*) FROM county_public_safety |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT count(*) FROM county_public_safety |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM county_public_safety ORDER BY Population 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM county_public_safety ORDER BY Population 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION != "East" |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT DISTINCT Police_force FROM county_public_safety WHERE LOCATION != "East" |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT min(Crime_rate) , max(Crime_rate) FROM county_public_safety |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT min(Crime_rate) , max(Crime_rate) FROM county_public_safety |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Crime_rate FROM county_public_safety ORDER BY Police_officers 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM city ORDER BY Name 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM city ORDER BY Name 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Hispanic FROM city WHERE Black > 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Hispanic FROM city WHERE Black > 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM county_public_safety ORDER BY Population 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM county_public_safety ORDER BY Population 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM city ORDER BY White DESC LIMIT 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM city ORDER BY White DESC LIMIT 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT T1.Name , T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT T1.Name , T2.Name FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT T1.White , T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT T1.White , T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT name FROM city WHERE county_ID = (SELECT county_ID FROM county_public_safety ORDER BY Police_officers 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000) |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT count(*) FROM city WHERE county_ID IN (SELECT county_ID FROM county_public_safety WHERE population > 20000) |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90 |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT T2.Crime_rate FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID WHERE T1.White > 90 |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Police_force , COUNT(*) FROM county_public_safety GROUP BY Police_force |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Police_force , COUNT(*) FROM county_public_safety GROUP BY Police_force |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT LOCATION FROM county_public_safety 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT LOCATION FROM county_public_safety 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city) |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Name FROM county_public_safety WHERE County_ID NOT IN (SELECT County_ID FROM city) |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West" |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Police_force FROM county_public_safety WHERE LOCATION = "East" INTERSECT SELECT Police_force FROM county_public_safety WHERE LOCATION = "West" |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100) |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT name FROM city WHERE county_id IN (SELECT county_id FROM county_public_safety WHERE Crime_rate < 100) |
[
{
"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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Case_burden FROM county_public_safety ORDER BY Population 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 \"county_public_safety\" (\n\"County_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 "county_public_safety" (
"County_ID" int,
"Name" text,
"Population" int,
"Police_officers" int,
"Residents_per_officer" int,
"Case_burden" int,
"Crime_rate" real,
"Police_force" text,
"Location" text,
PRIMARY KEY ("County_ID")
)
CREATE TABLE "city" (
"City_ID" int,
"County_ID" int,
"Na... | SELECT Case_burden FROM county_public_safety ORDER BY Population 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern'; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName , RoomId FROM Rooms WHERE basePrice > 160 AND maxOccupancy > 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT T2.roomName FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT kids FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT count(*) FROM Reservations WHERE FirstName = "ROY" AND LastName = "SWEAZY"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT T2.roomName , T1.Rate , T1.CheckIn , T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT T2.roomName , T1.Rate , T1.CheckIn , T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT Adults FROM Reservations WHERE CheckIn = "2010-10-23" AND FirstName = "CONRAD" AND LastName = "SELBIG"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT Adults FROM Reservations WHERE CheckIn = "2010-10-23" AND FirstName = "CONRAD" AND LastName = "SELBIG"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT sum(beds) FROM Rooms WHERE bedtype = 'King'; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT sum(beds) FROM Rooms WHERE bedtype = 'King'; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName , basePrice FROM Rooms ORDER BY basePrice 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT roomName , basePrice FROM Rooms ORDER BY basePrice 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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT decor FROM Rooms WHERE roomName = "Recluse and defiance"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT decor FROM Rooms WHERE roomName = "Recluse and defiance"; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT bedType , avg(basePrice) FROM Rooms GROUP BY bedType; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT sum(maxOccupancy) FROM Rooms WHERE decor = 'modern'; |
[
{
"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 \"Rooms\" ( \n\t\"RoomId\" TEXT PRIMARY KEY,\n\t... | You 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 "Rooms" (
"RoomId" TEXT PRIMARY KEY,
"roomName" TEXT,
"beds" INTEGER,
"bedType" TEXT,
"maxOccupancy" INTEGER,
"basePrice" INTEGER,
"decor" TEXT
)
CREATE TABLE "Reservations" (
"Code" INTEGER PRIMARY KEY,
"Room" TEXT,
"CheckIn" TEXT,
"CheckOut" TEXT,
"Rate" REAL,... | SELECT sum(maxOccupancy) FROM Rooms WHERE decor = 'modern'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.