answer
stringlengths 18
557
| context
stringlengths 27
489
| question
stringlengths 12
244
| text
stringlengths 275
1.7k
|
---|---|---|---|
SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE Participants_in_Events (Event_ID VARCHAR)
|
What is the id of the event with the most participants?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Participants_in_Events (Event_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id of the event with the most participants? The answer to your question is: SELECT Event_ID FROM Participants_in_Events GROUP BY Event_ID ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'
|
CREATE TABLE Participants (Participant_ID VARCHAR); CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR)
|
Which events id does not have any participant with detail 'Kenyatta Kuhn'?
|
<s>[INST] Given the following SQL query and context: Query: SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn' Context: CREATE TABLE Participants (Participant_ID VARCHAR); CREATE TABLE EVENTS (event_id VARCHAR, Participant_Details VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR, Participant_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which events id does not have any participant with detail 'Kenyatta Kuhn'? The answer to your question is: SELECT event_id FROM EVENTS EXCEPT SELECT T1.event_id FROM Participants_in_Events AS T1 JOIN Participants AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE Participant_Details = 'Kenyatta Kuhn'. [/s>
|
SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'
|
CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR); CREATE TABLE services (service_type_code VARCHAR, service_id VARCHAR)
|
Which services type had both successful and failure event details?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail' Context: CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR); CREATE TABLE services (service_type_code VARCHAR, service_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which services type had both successful and failure event details? The answer to your question is: SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Success' INTERSECT SELECT T1.service_type_code FROM services AS T1 JOIN EVENTS AS T2 ON T1.service_id = T2.service_id WHERE T2.event_details = 'Fail'. [/s>
|
SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events)
|
CREATE TABLE EVENTS (event_id VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR)
|
How many events did not have any participants?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events) Context: CREATE TABLE EVENTS (event_id VARCHAR); CREATE TABLE Participants_in_Events (event_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many events did not have any participants? The answer to your question is: SELECT COUNT(*) FROM EVENTS WHERE NOT event_id IN (SELECT event_id FROM Participants_in_Events). [/s>
|
SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events
|
CREATE TABLE participants_in_Events (participant_id VARCHAR)
|
What are all the distinct participant ids who attended any events?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events Context: CREATE TABLE participants_in_Events (participant_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the distinct participant ids who attended any events? The answer to your question is: SELECT COUNT(DISTINCT participant_id) FROM participants_in_Events. [/s>
|
SELECT name FROM races ORDER BY date DESC LIMIT 1
|
CREATE TABLE races (name VARCHAR, date VARCHAR)
|
What is the name of the race held most recently?
|
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM races ORDER BY date DESC LIMIT 1 Context: CREATE TABLE races (name VARCHAR, date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the race held most recently? The answer to your question is: SELECT name FROM races ORDER BY date DESC LIMIT 1. [/s>
|
SELECT name, date FROM races ORDER BY date DESC LIMIT 1
|
CREATE TABLE races (name VARCHAR, date VARCHAR)
|
What is the name and date of the most recent race?
|
<s>[INST] Given the following SQL query and context: Query: SELECT name, date FROM races ORDER BY date DESC LIMIT 1 Context: CREATE TABLE races (name VARCHAR, date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name and date of the most recent race? The answer to your question is: SELECT name, date FROM races ORDER BY date DESC LIMIT 1. [/s>
|
SELECT name FROM races WHERE YEAR = 2017
|
CREATE TABLE races (name VARCHAR, YEAR VARCHAR)
|
Find the names of all races held in 2017.
|
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM races WHERE YEAR = 2017 Context: CREATE TABLE races (name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all races held in 2017. The answer to your question is: SELECT name FROM races WHERE YEAR = 2017. [/s>
|
SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017
|
CREATE TABLE races (name VARCHAR, YEAR INTEGER)
|
Find the distinct names of all races held between 2014 and 2017?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017 Context: CREATE TABLE races (name VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the distinct names of all races held between 2014 and 2017? The answer to your question is: SELECT DISTINCT name FROM races WHERE YEAR BETWEEN 2014 AND 2017. [/s>
|
SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
|
CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER)
|
List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000 Context: CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds? The answer to your question is: SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000. [/s>
|
SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000
|
CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER); CREATE TABLE drivers (driverid VARCHAR, nationality VARCHAR)
|
Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000 Context: CREATE TABLE laptimes (driverid VARCHAR, milliseconds INTEGER); CREATE TABLE drivers (driverid VARCHAR, nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all the distinct id and nationality of drivers who have had laptime more than 100000 milliseconds? The answer to your question is: SELECT DISTINCT T1.driverid, T1.nationality FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds > 100000. [/s>
|
SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1
|
CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR)
|
What are the forename and surname of the driver who has the smallest laptime?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1 Context: CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the forename and surname of the driver who has the smallest laptime? The answer to your question is: SELECT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds LIMIT 1. [/s>
|
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1
|
CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR)
|
What is the id and family name of the driver who has the longest laptime?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1 Context: CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR, milliseconds VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id and family name of the driver who has the longest laptime? The answer to your question is: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid ORDER BY T2.milliseconds DESC LIMIT 1. [/s>
|
SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2
|
CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR)
|
What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2 Context: CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR, surname VARCHAR); CREATE TABLE laptimes (driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id, forname and surname of the driver who had the first position in terms of laptime at least twice? The answer to your question is: SELECT T1.driverid, T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE POSITION = '1' GROUP BY T1.driverid HAVING COUNT(*) >= 2. [/s>
|
SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009
|
CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (raceid VARCHAR)
|
How many drivers participated in the race Australian Grand Prix held in 2009?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009 Context: CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many drivers participated in the race Australian Grand Prix held in 2009? The answer to your question is: SELECT COUNT(*) FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid WHERE T2.name = "Australian Grand Prix" AND YEAR = 2009. [/s>
|
SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009)
|
CREATE TABLE races (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR); CREATE TABLE results (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR)
|
How many drivers did not participate in the races held in 2009?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009) Context: CREATE TABLE races (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR); CREATE TABLE results (driverId VARCHAR, raceId VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many drivers did not participate in the races held in 2009? The answer to your question is: SELECT COUNT(DISTINCT driverId) FROM results WHERE NOT raceId IN (SELECT raceId FROM races WHERE YEAR <> 2009). [/s>
|
SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis"
|
CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (name VARCHAR, year VARCHAR, raceid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR)
|
Give me a list of names and years of races that had any driver whose forename is Lewis?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis" Context: CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (name VARCHAR, year VARCHAR, raceid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Give me a list of names and years of races that had any driver whose forename is Lewis? The answer to your question is: SELECT T2.name, T2.year FROM results AS T1 JOIN races AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T1.driverid = T3.driverid WHERE T3.forename = "Lewis". [/s>
|
SELECT forename, surname FROM drivers WHERE nationality = "German"
|
CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, nationality VARCHAR)
|
Find the forename and surname of drivers whose nationality is German?
|
<s>[INST] Given the following SQL query and context: Query: SELECT forename, surname FROM drivers WHERE nationality = "German" Context: CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the forename and surname of drivers whose nationality is German? The answer to your question is: SELECT forename, surname FROM drivers WHERE nationality = "German". [/s>
|
SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
|
CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR)
|
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix" Context: CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix? The answer to your question is: SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix". [/s>
|
SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix"
|
CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR)
|
What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix" Context: CREATE TABLE races (raceid VARCHAR, name VARCHAR); CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (raceid VARCHAR, driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the forenames and surnames of drivers who participated in the races named Australian Grand Prix but not the races named Chinese Grand Prix? The answer to your question is: SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" EXCEPT SELECT T3.forename, T3.surname FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Chinese Grand Prix". [/s>
|
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1
|
CREATE TABLE driverstandings (driverid VARCHAR, position VARCHAR, wins VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR)
|
Find all the forenames of distinct drivers who was in position 1 as standing and won?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 Context: CREATE TABLE driverstandings (driverid VARCHAR, position VARCHAR, wins VARCHAR); CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all the forenames of distinct drivers who was in position 1 as standing and won? The answer to your question is: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1. [/s>
|
SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20
|
CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR); CREATE TABLE driverstandings (driverid VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR)
|
Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20 Context: CREATE TABLE drivers (forename VARCHAR, driverid VARCHAR); CREATE TABLE driverstandings (driverid VARCHAR, points VARCHAR, position VARCHAR, wins VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all the forenames of distinct drivers who won in position 1 as driver standing and had more than 20 points? The answer to your question is: SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 AND T2.points > 20. [/s>
|
SELECT COUNT(*), nationality FROM constructors GROUP BY nationality
|
CREATE TABLE constructors (nationality VARCHAR)
|
What are the numbers of constructors for different nationalities?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), nationality FROM constructors GROUP BY nationality Context: CREATE TABLE constructors (nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the numbers of constructors for different nationalities? The answer to your question is: SELECT COUNT(*), nationality FROM constructors GROUP BY nationality. [/s>
|
SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid
|
CREATE TABLE constructorStandings (constructorid VARCHAR)
|
What are the numbers of races for each constructor id?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid Context: CREATE TABLE constructorStandings (constructorid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the numbers of races for each constructor id? The answer to your question is: SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid. [/s>
|
SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017
|
CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR)
|
What are the names of races that were held after 2017 and the circuits were in the country of Spain?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017 Context: CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of races that were held after 2017 and the circuits were in the country of Spain? The answer to your question is: SELECT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2017. [/s>
|
SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000
|
CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR)
|
What are the unique names of races that held after 2000 and the circuits were in Spain?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000 Context: CREATE TABLE races (name VARCHAR, circuitid VARCHAR, year VARCHAR); CREATE TABLE circuits (circuitid VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the unique names of races that held after 2000 and the circuits were in Spain? The answer to your question is: SELECT DISTINCT T1.name FROM races AS T1 JOIN circuits AS T2 ON T1.circuitid = T2.circuitid WHERE T2.country = "Spain" AND T1.year > 2000. [/s>
|
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)
|
CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR)
|
Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841.
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841) Context: CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841. The answer to your question is: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841). [/s>
|
SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841)
|
CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR)
|
Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841) Context: CREATE TABLE pitstops (driverid VARCHAR, STOP VARCHAR, duration INTEGER, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the distinct driver id of all drivers that have a longer stop duration than some drivers in the race whose id is 841? The answer to your question is: SELECT DISTINCT driverid, STOP FROM pitstops WHERE duration > (SELECT MIN(duration) FROM pitstops WHERE raceid = 841). [/s>
|
SELECT DISTINCT forename FROM drivers ORDER BY forename
|
CREATE TABLE drivers (forename VARCHAR)
|
List the forenames of all distinct drivers in alphabetical order?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT forename FROM drivers ORDER BY forename Context: CREATE TABLE drivers (forename VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the forenames of all distinct drivers in alphabetical order? The answer to your question is: SELECT DISTINCT forename FROM drivers ORDER BY forename. [/s>
|
SELECT DISTINCT name FROM races ORDER BY name DESC
|
CREATE TABLE races (name VARCHAR)
|
List the names of all distinct races in reversed lexicographic order?
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT name FROM races ORDER BY name DESC Context: CREATE TABLE races (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of all distinct races in reversed lexicographic order? The answer to your question is: SELECT DISTINCT name FROM races ORDER BY name DESC. [/s>
|
SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011
|
CREATE TABLE races (name VARCHAR, YEAR INTEGER)
|
What are the names of races held between 2009 and 2011?
|
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011 Context: CREATE TABLE races (name VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: What are the names of races held between 2009 and 2011? The answer to your question is: SELECT name FROM races WHERE YEAR BETWEEN 2009 AND 2011. [/s>
|
SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00"
|
CREATE TABLE races (name VARCHAR, TIME VARCHAR)
|
What are the names of races held after 12:00:00 or before 09:00:00?
|
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00" Context: CREATE TABLE races (name VARCHAR, TIME VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of races held after 12:00:00 or before 09:00:00? The answer to your question is: SELECT name FROM races WHERE TIME > "12:00:00" OR TIME < "09:00:00". [/s>
|
SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5
|
CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR)
|
What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5 Context: CREATE TABLE drivers (forename VARCHAR, surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results? The answer to your question is: SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5. [/s>
|
SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5
|
CREATE TABLE drivers (surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR)
|
What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5 Context: CREATE TABLE drivers (surname VARCHAR, driverid VARCHAR); CREATE TABLE results (driverid VARCHAR); CREATE TABLE pitstops (driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the drivers' last names and id who had 11 pit stops and participated in more than 5 race results? The answer to your question is: SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) = 11 INTERSECT SELECT T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5. [/s>
|
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR, year INTEGER); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)
|
What is the id and last name of the driver who participated in the most races after 2010?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR, year INTEGER); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the id and last name of the driver who participated in the most races after 2010? The answer to your question is: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid WHERE T3.year > 2010 GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia"
|
CREATE TABLE circuits (name VARCHAR, country VARCHAR)
|
What are the names of circuits that belong to UK or Malaysia?
|
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia" Context: CREATE TABLE circuits (name VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of circuits that belong to UK or Malaysia? The answer to your question is: SELECT name FROM circuits WHERE country = "UK" OR country = "Malaysia". [/s>
|
SELECT circuitid, LOCATION FROM circuits WHERE country = "France" OR country = "Belgium"
|
CREATE TABLE circuits (circuitid VARCHAR, LOCATION VARCHAR, country VARCHAR)
|
Find the id and location of circuits that belong to France or Belgium?
|
<s>[INST] Given the following SQL query and context: Query: SELECT circuitid, LOCATION FROM circuits WHERE country = "France" OR country = "Belgium" Context: CREATE TABLE circuits (circuitid VARCHAR, LOCATION VARCHAR, country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id and location of circuits that belong to France or Belgium? The answer to your question is: SELECT circuitid, LOCATION FROM circuits WHERE country = "France" OR country = "Belgium". [/s>
|
SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5
|
CREATE TABLE constructorstandings (constructorid VARCHAR, points VARCHAR); CREATE TABLE constructors (name VARCHAR, constructorid VARCHAR, nationality VARCHAR)
|
Find the names of Japanese constructors that have once earned more than 5 points?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5 Context: CREATE TABLE constructorstandings (constructorid VARCHAR, points VARCHAR); CREATE TABLE constructors (name VARCHAR, constructorid VARCHAR, nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of Japanese constructors that have once earned more than 5 points? The answer to your question is: SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5. [/s>
|
SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
|
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR)
|
What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
|
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix" Context: CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average fastest lap speed in race named 'Monaco Grand Prix' in 2008 ? The answer to your question is: SELECT AVG(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix". [/s>
|
SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix"
|
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR)
|
What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ?
|
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix" Context: CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (raceid VARCHAR, year VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the maximum fastest lap speed in race named 'Monaco Grand Prix' in 2008 ? The answer to your question is: SELECT MAX(T2.fastestlapspeed) FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year = 2008 AND T1.name = "Monaco Grand Prix". [/s>
|
SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
|
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR)
|
What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year?
|
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year Context: CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the maximum fastest lap speed in races held after 2004 grouped by race name and ordered by year? The answer to your question is: SELECT MAX(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year. [/s>
|
SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year
|
CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR)
|
What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year?
|
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year Context: CREATE TABLE results (fastestlapspeed INTEGER, raceid VARCHAR); CREATE TABLE races (name VARCHAR, year INTEGER, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the average fastest lap speed in races held after 2004 grouped by race name and ordered by year? The answer to your question is: SELECT AVG(T2.fastestlapspeed), T1.name, T1.year FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid WHERE T1.year > 2014 GROUP BY T1.name ORDER BY T1.year. [/s>
|
SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2
|
CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)
|
Find the id, forename and number of races of all drivers who have at least participated in two races?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2 Context: CREATE TABLE drivers (driverid VARCHAR, forename VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id, forename and number of races of all drivers who have at least participated in two races? The answer to your question is: SELECT T1.driverid, T1.forename, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) >= 2. [/s>
|
SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30
|
CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (driverid VARCHAR)
|
Find the driver id and number of races of all drivers who have at most participated in 30 races?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30 Context: CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR); CREATE TABLE drivers (driverid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the driver id and number of races of all drivers who have at most participated in 30 races? The answer to your question is: SELECT T1.driverid, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid HAVING COUNT(*) <= 30. [/s>
|
SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR)
|
Find the id and surname of the driver who participated the most number of races?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE drivers (driverid VARCHAR, surname VARCHAR); CREATE TABLE races (raceid VARCHAR); CREATE TABLE results (driverid VARCHAR, raceid VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the id and surname of the driver who participated the most number of races? The answer to your question is: SELECT T1.driverid, T1.surname FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid JOIN races AS T3 ON T2.raceid = T3.raceid GROUP BY T1.driverid ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT COUNT(*) FROM technician
|
CREATE TABLE technician (Id VARCHAR)
|
How many technicians are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM technician Context: CREATE TABLE technician (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many technicians are there? The answer to your question is: SELECT COUNT(*) FROM technician. [/s>
|
SELECT Name FROM technician ORDER BY Age
|
CREATE TABLE technician (Name VARCHAR, Age VARCHAR)
|
List the names of technicians in ascending order of age.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM technician ORDER BY Age Context: CREATE TABLE technician (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of technicians in ascending order of age. The answer to your question is: SELECT Name FROM technician ORDER BY Age. [/s>
|
SELECT Team, Starting_Year FROM technician
|
CREATE TABLE technician (Team VARCHAR, Starting_Year VARCHAR)
|
What are the team and starting year of technicians?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Team, Starting_Year FROM technician Context: CREATE TABLE technician (Team VARCHAR, Starting_Year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the team and starting year of technicians? The answer to your question is: SELECT Team, Starting_Year FROM technician. [/s>
|
SELECT Name FROM technician WHERE Team <> "NYY"
|
CREATE TABLE technician (Name VARCHAR, Team VARCHAR)
|
List the name of technicians whose team is not "NYY".
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM technician WHERE Team <> "NYY" Context: CREATE TABLE technician (Name VARCHAR, Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the name of technicians whose team is not "NYY". The answer to your question is: SELECT Name FROM technician WHERE Team <> "NYY". [/s>
|
SELECT Name FROM technician WHERE Age = 36 OR Age = 37
|
CREATE TABLE technician (Name VARCHAR, Age VARCHAR)
|
Show the name of technicians aged either 36 or 37
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM technician WHERE Age = 36 OR Age = 37 Context: CREATE TABLE technician (Name VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the name of technicians aged either 36 or 37 The answer to your question is: SELECT Name FROM technician WHERE Age = 36 OR Age = 37. [/s>
|
SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1
|
CREATE TABLE technician (Starting_Year VARCHAR, Age VARCHAR)
|
What is the starting year of the oldest technicians?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1 Context: CREATE TABLE technician (Starting_Year VARCHAR, Age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the starting year of the oldest technicians? The answer to your question is: SELECT Starting_Year FROM technician ORDER BY Age DESC LIMIT 1. [/s>
|
SELECT Team, COUNT(*) FROM technician GROUP BY Team
|
CREATE TABLE technician (Team VARCHAR)
|
Show different teams of technicians and the number of technicians in each team.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Team, COUNT(*) FROM technician GROUP BY Team Context: CREATE TABLE technician (Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show different teams of technicians and the number of technicians in each team. The answer to your question is: SELECT Team, COUNT(*) FROM technician GROUP BY Team. [/s>
|
SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE technician (Team VARCHAR)
|
Please show the team that has the most number of technicians.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE technician (Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Please show the team that has the most number of technicians. The answer to your question is: SELECT Team FROM technician GROUP BY Team ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2
|
CREATE TABLE technician (Team VARCHAR)
|
Show the team that have at least two technicians.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2 Context: CREATE TABLE technician (Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the team that have at least two technicians. The answer to your question is: SELECT Team FROM technician GROUP BY Team HAVING COUNT(*) >= 2. [/s>
|
SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID
|
CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
|
Show names of technicians and series of machines they are assigned to repair.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID Context: CREATE TABLE machine (Machine_series VARCHAR, machine_id VARCHAR); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of technicians and series of machines they are assigned to repair. The answer to your question is: SELECT T3.Name, T2.Machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID. [/s>
|
SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank
|
CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE machine (machine_id VARCHAR, quality_rank VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
|
Show names of technicians in ascending order of quality rank of the machine they are assigned.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank Context: CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE machine (machine_id VARCHAR, quality_rank VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of technicians in ascending order of quality rank of the machine they are assigned. The answer to your question is: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID ORDER BY T2.quality_rank. [/s>
|
SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70
|
CREATE TABLE machine (machine_id VARCHAR, value_points INTEGER); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
|
Show names of technicians who are assigned to repair machines with value point more than 70.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70 Context: CREATE TABLE machine (machine_id VARCHAR, value_points INTEGER); CREATE TABLE repair_assignment (machine_id VARCHAR, technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of technicians who are assigned to repair machines with value point more than 70. The answer to your question is: SELECT T3.Name FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_ID = T3.technician_ID WHERE T2.value_points > 70. [/s>
|
SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name
|
CREATE TABLE repair_assignment (technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR)
|
Show names of technicians and the number of machines they are assigned to repair.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name Context: CREATE TABLE repair_assignment (technician_ID VARCHAR); CREATE TABLE technician (Name VARCHAR, technician_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of technicians and the number of machines they are assigned to repair. The answer to your question is: SELECT T2.Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_ID = T2.technician_ID GROUP BY T2.Name. [/s>
|
SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment)
|
CREATE TABLE technician (Name VARCHAR, technician_id VARCHAR); CREATE TABLE repair_assignment (Name VARCHAR, technician_id VARCHAR)
|
List the names of technicians who have not been assigned to repair machines.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment) Context: CREATE TABLE technician (Name VARCHAR, technician_id VARCHAR); CREATE TABLE repair_assignment (Name VARCHAR, technician_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of technicians who have not been assigned to repair machines. The answer to your question is: SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment). [/s>
|
SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS"
|
CREATE TABLE technician (Starting_Year VARCHAR, Team VARCHAR)
|
Show the starting years shared by technicians from team "CLE" and "CWS".
|
<s>[INST] Given the following SQL query and context: Query: SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS" Context: CREATE TABLE technician (Starting_Year VARCHAR, Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the starting years shared by technicians from team "CLE" and "CWS". The answer to your question is: SELECT Starting_Year FROM technician WHERE Team = "CLE" INTERSECT SELECT Starting_Year FROM technician WHERE Team = "CWS". [/s>
|
SELECT COUNT(*) FROM entrepreneur
|
CREATE TABLE entrepreneur (Id VARCHAR)
|
How many entrepreneurs are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM entrepreneur Context: CREATE TABLE entrepreneur (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many entrepreneurs are there? The answer to your question is: SELECT COUNT(*) FROM entrepreneur. [/s>
|
SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC
|
CREATE TABLE entrepreneur (Company VARCHAR, Money_Requested VARCHAR)
|
List the companies of entrepreneurs in descending order of money requested.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC Context: CREATE TABLE entrepreneur (Company VARCHAR, Money_Requested VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the companies of entrepreneurs in descending order of money requested. The answer to your question is: SELECT Company FROM entrepreneur ORDER BY Money_Requested DESC. [/s>
|
SELECT Company, Investor FROM entrepreneur
|
CREATE TABLE entrepreneur (Company VARCHAR, Investor VARCHAR)
|
List the companies and the investors of entrepreneurs.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Company, Investor FROM entrepreneur Context: CREATE TABLE entrepreneur (Company VARCHAR, Investor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the companies and the investors of entrepreneurs. The answer to your question is: SELECT Company, Investor FROM entrepreneur. [/s>
|
SELECT AVG(Money_Requested) FROM entrepreneur
|
CREATE TABLE entrepreneur (Money_Requested INTEGER)
|
What is the average money requested by all entrepreneurs?
|
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Money_Requested) FROM entrepreneur Context: CREATE TABLE entrepreneur (Money_Requested INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average money requested by all entrepreneurs? The answer to your question is: SELECT AVG(Money_Requested) FROM entrepreneur. [/s>
|
SELECT Name FROM People ORDER BY Weight
|
CREATE TABLE People (Name VARCHAR, Weight VARCHAR)
|
What are the names of people in ascending order of weight?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM People ORDER BY Weight Context: CREATE TABLE People (Name VARCHAR, Weight VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of people in ascending order of weight? The answer to your question is: SELECT Name FROM People ORDER BY Weight. [/s>
|
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
|
CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR)
|
What are the names of entrepreneurs?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID Context: CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of entrepreneurs? The answer to your question is: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID. [/s>
|
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> "Rachel Elnaugh"
|
CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> "Rachel Elnaugh" Context: CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of entrepreneurs whose investor is not "Rachel Elnaugh"? The answer to your question is: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor <> "Rachel Elnaugh". [/s>
|
SELECT Weight FROM people ORDER BY Height LIMIT 1
|
CREATE TABLE people (Weight VARCHAR, Height VARCHAR)
|
What is the weight of the shortest person?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Weight FROM people ORDER BY Height LIMIT 1 Context: CREATE TABLE people (Weight VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the weight of the shortest person? The answer to your question is: SELECT Weight FROM people ORDER BY Height LIMIT 1. [/s>
|
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
|
CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR)
|
What is the name of the entrepreneur with the greatest weight?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1 Context: CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR); CREATE TABLE entrepreneur (People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the entrepreneur with the greatest weight? The answer to your question is: SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1. [/s>
|
SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85
|
CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE entrepreneur (Money_Requested INTEGER, People_ID VARCHAR)
|
What is the total money requested by entrepreneurs with height more than 1.85?
|
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85 Context: CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE entrepreneur (Money_Requested INTEGER, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total money requested by entrepreneurs with height more than 1.85? The answer to your question is: SELECT SUM(T1.Money_Requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 1.85. [/s>
|
SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
|
CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Date_of_Birth VARCHAR, People_ID VARCHAR)
|
What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" Context: CREATE TABLE entrepreneur (People_ID VARCHAR, Investor VARCHAR); CREATE TABLE people (Date_of_Birth VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the dates of birth of entrepreneurs with investor "Simon Woodroffe" or "Peter Jones"? The answer to your question is: SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones". [/s>
|
SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC
|
CREATE TABLE entrepreneur (People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Weight VARCHAR, People_ID VARCHAR)
|
What are the weights of entrepreneurs in descending order of money requested?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC Context: CREATE TABLE entrepreneur (People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Weight VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the weights of entrepreneurs in descending order of money requested? The answer to your question is: SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC. [/s>
|
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
|
CREATE TABLE entrepreneur (Investor VARCHAR)
|
What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor Context: CREATE TABLE entrepreneur (Investor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor? The answer to your question is: SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor. [/s>
|
SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE entrepreneur (Investor VARCHAR)
|
What is the investor that has invested in the most number of entrepreneurs?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE entrepreneur (Investor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the investor that has invested in the most number of entrepreneurs? The answer to your question is: SELECT Investor FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
|
CREATE TABLE entrepreneur (Investor VARCHAR)
|
What are the investors that have invested in at least two entrepreneurs?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2 Context: CREATE TABLE entrepreneur (Investor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the investors that have invested in at least two entrepreneurs? The answer to your question is: SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2. [/s>
|
SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested
|
CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
List the names of entrepreneurs and their companies in descending order of money requested?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested Context: CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR, Money_Requested VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of entrepreneurs and their companies in descending order of money requested? The answer to your question is: SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested. [/s>
|
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur)
|
CREATE TABLE entrepreneur (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
List the names of people that are not entrepreneurs.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur) Context: CREATE TABLE entrepreneur (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of people that are not entrepreneurs. The answer to your question is: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM entrepreneur). [/s>
|
SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000
|
CREATE TABLE entrepreneur (Investor VARCHAR, Money_Requested INTEGER)
|
Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000 Context: CREATE TABLE entrepreneur (Investor VARCHAR, Money_Requested INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the investors shared by entrepreneurs that requested more than 140000 and entrepreneurs that requested less than 120000. The answer to your question is: SELECT Investor FROM entrepreneur WHERE Money_Requested > 140000 INTERSECT SELECT Investor FROM entrepreneur WHERE Money_Requested < 120000. [/s>
|
SELECT COUNT(DISTINCT Company) FROM entrepreneur
|
CREATE TABLE entrepreneur (Company VARCHAR)
|
How many distinct companies are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT Company) FROM entrepreneur Context: CREATE TABLE entrepreneur (Company VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many distinct companies are there? The answer to your question is: SELECT COUNT(DISTINCT Company) FROM entrepreneur. [/s>
|
SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1
|
CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR)
|
Show the company of the tallest entrepreneur.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1 Context: CREATE TABLE entrepreneur (Company VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the company of the tallest entrepreneur. The answer to your question is: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Height DESC LIMIT 1. [/s>
|
SELECT COUNT(*) FROM perpetrator
|
CREATE TABLE perpetrator (Id VARCHAR)
|
How many perpetrators are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM perpetrator Context: CREATE TABLE perpetrator (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many perpetrators are there? The answer to your question is: SELECT COUNT(*) FROM perpetrator. [/s>
|
SELECT Date FROM perpetrator ORDER BY Killed DESC
|
CREATE TABLE perpetrator (Date VARCHAR, Killed VARCHAR)
|
List the date of perpetrators in descending order of the number of people killed.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Date FROM perpetrator ORDER BY Killed DESC Context: CREATE TABLE perpetrator (Date VARCHAR, Killed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the date of perpetrators in descending order of the number of people killed. The answer to your question is: SELECT Date FROM perpetrator ORDER BY Killed DESC. [/s>
|
SELECT Injured FROM perpetrator ORDER BY Injured
|
CREATE TABLE perpetrator (Injured VARCHAR)
|
List the number of people injured by perpetrators in ascending order.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Injured FROM perpetrator ORDER BY Injured Context: CREATE TABLE perpetrator (Injured VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the number of people injured by perpetrators in ascending order. The answer to your question is: SELECT Injured FROM perpetrator ORDER BY Injured. [/s>
|
SELECT AVG(Injured) FROM perpetrator
|
CREATE TABLE perpetrator (Injured INTEGER)
|
What is the average number of people injured by all perpetrators?
|
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(Injured) FROM perpetrator Context: CREATE TABLE perpetrator (Injured INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average number of people injured by all perpetrators? The answer to your question is: SELECT AVG(Injured) FROM perpetrator. [/s>
|
SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1
|
CREATE TABLE perpetrator (LOCATION VARCHAR, Killed VARCHAR)
|
What is the location of the perpetrator with the largest kills.
|
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1 Context: CREATE TABLE perpetrator (LOCATION VARCHAR, Killed VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the location of the perpetrator with the largest kills. The answer to your question is: SELECT LOCATION FROM perpetrator ORDER BY Killed DESC LIMIT 1. [/s>
|
SELECT Name FROM People ORDER BY Height
|
CREATE TABLE People (Name VARCHAR, Height VARCHAR)
|
What are the names of people in ascending order of height?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM People ORDER BY Height Context: CREATE TABLE People (Name VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of people in ascending order of height? The answer to your question is: SELECT Name FROM People ORDER BY Height. [/s>
|
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID
|
CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
What are the names of perpetrators?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID Context: CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of perpetrators? The answer to your question is: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID. [/s>
|
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> "China"
|
CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
What are the names of perpetrators whose country is not "China"?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> "China" Context: CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of perpetrators whose country is not "China"? The answer to your question is: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country <> "China". [/s>
|
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1
|
CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR)
|
What is the name of the perpetrator with the biggest weight.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1 Context: CREATE TABLE perpetrator (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR, Weight VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the perpetrator with the biggest weight. The answer to your question is: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Weight DESC LIMIT 1. [/s>
|
SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84
|
CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE perpetrator (Killed INTEGER, People_ID VARCHAR)
|
What is the total kills of the perpetrators with height more than 1.84.
|
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84 Context: CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE perpetrator (Killed INTEGER, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total kills of the perpetrators with height more than 1.84. The answer to your question is: SELECT SUM(T2.Killed) FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 1.84. [/s>
|
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan"
|
CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
What are the names of perpetrators in country "China" or "Japan"?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan" Context: CREATE TABLE perpetrator (People_ID VARCHAR, Country VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of perpetrators in country "China" or "Japan"? The answer to your question is: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Country = "China" OR T2.Country = "Japan". [/s>
|
SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC
|
CREATE TABLE perpetrator (People_ID VARCHAR, Injured VARCHAR); CREATE TABLE people (Height VARCHAR, People_ID VARCHAR)
|
What are the heights of perpetrators in descending order of the number of people they injured?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC Context: CREATE TABLE perpetrator (People_ID VARCHAR, Injured VARCHAR); CREATE TABLE people (Height VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the heights of perpetrators in descending order of the number of people they injured? The answer to your question is: SELECT T1.Height FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Injured DESC. [/s>
|
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country
|
CREATE TABLE perpetrator (Country VARCHAR)
|
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country Context: CREATE TABLE perpetrator (Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there. The answer to your question is: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country. [/s>
|
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE perpetrator (Country VARCHAR)
|
What is the country that has the most perpetrators?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE perpetrator (Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the country that has the most perpetrators? The answer to your question is: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2
|
CREATE TABLE perpetrator (Country VARCHAR)
|
What are the countries that have at least two perpetrators?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2 Context: CREATE TABLE perpetrator (Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the countries that have at least two perpetrators? The answer to your question is: SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country HAVING COUNT(*) >= 2. [/s>
|
SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC
|
CREATE TABLE perpetrator (People_ID VARCHAR, Year VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR)
|
List the names of perpetrators in descending order of the year.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC Context: CREATE TABLE perpetrator (People_ID VARCHAR, Year VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of perpetrators in descending order of the year. The answer to your question is: SELECT T1.Name FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Year DESC. [/s>
|
SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator)
|
CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE perpetrator (Name VARCHAR, People_ID VARCHAR)
|
List the names of people that are not perpetrators.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator) Context: CREATE TABLE people (Name VARCHAR, People_ID VARCHAR); CREATE TABLE perpetrator (Name VARCHAR, People_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of people that are not perpetrators. The answer to your question is: SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM perpetrator). [/s>
|
SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20
|
CREATE TABLE perpetrator (Country VARCHAR, Injured INTEGER)
|
Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20 Context: CREATE TABLE perpetrator (Country VARCHAR, Injured INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the countries that have both perpetrators with injures more than 50 and perpetrators with injures smaller than 20. The answer to your question is: SELECT Country FROM perpetrator WHERE Injured > 50 INTERSECT SELECT Country FROM perpetrator WHERE Injured < 20. [/s>
|
SELECT COUNT(DISTINCT LOCATION) FROM perpetrator
|
CREATE TABLE perpetrator (LOCATION VARCHAR)
|
How many distinct locations of perpetrators are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT LOCATION) FROM perpetrator Context: CREATE TABLE perpetrator (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many distinct locations of perpetrators are there? The answer to your question is: SELECT COUNT(DISTINCT LOCATION) FROM perpetrator. [/s>
|
SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1
|
CREATE TABLE perpetrator (Date VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR)
|
Show the date of the tallest perpetrator.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1 Context: CREATE TABLE perpetrator (Date VARCHAR, People_ID VARCHAR); CREATE TABLE people (People_ID VARCHAR, Height VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the date of the tallest perpetrator. The answer to your question is: SELECT T2.Date FROM people AS T1 JOIN perpetrator AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1. [/s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.