db_id
stringclasses 31
values | schema
stringclasses 22
values | schemaComEx
stringclasses 22
values | question
stringlengths 18
181
| query
stringlengths 20
577
| answer
stringlengths 14
41.7k
⌀ | complexity
stringclasses 4
values | distinct
bool 2
classes | like
bool 2
classes | between
bool 2
classes | order_by
bool 2
classes | limit
bool 2
classes | grouby_by
bool 2
classes | having
bool 2
classes | single_join
bool 2
classes | multiple_join
bool 2
classes | multiple_select
bool 2
classes | intersect
bool 2
classes | except
bool 2
classes | union
bool 2
classes |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
car_1 |
CREATE TABLE car_makers (
"Id" INTEGER,
"Maker" TEXT,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY("Country") REFERENCES countries ("CountryId")
)
CREATE TABLE car_names (
"MakeId" INTEGER,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY("Model") REFERENCES model_list ("Model")
)
CREATE TABLE cars_data (
"Id" INTEGER,
"MPG" TEXT,
"Cylinders" INTEGER,
"Edispl" REAL,
"Horsepower" TEXT,
"Weight" INTEGER,
"Accelerate" REAL,
"Year" INTEGER,
PRIMARY KEY ("Id"),
FOREIGN KEY("Id") REFERENCES car_names ("MakeId")
)
CREATE TABLE continents (
"ContId" INTEGER,
"Continent" TEXT,
PRIMARY KEY ("ContId")
)
CREATE TABLE countries (
"CountryId" INTEGER,
"CountryName" TEXT,
"Continent" INTEGER,
PRIMARY KEY ("CountryId"),
FOREIGN KEY("Continent") REFERENCES continents ("ContId")
)
CREATE TABLE model_list (
"ModelId" INTEGER,
"Maker" INTEGER,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY("Maker") REFERENCES car_makers ("Id"),
UNIQUE ("Model")
) |
CREATE TABLE car_makers (
"Id" INTEGER,
"Maker" TEXT,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY("Country") REFERENCES countries ("CountryId")
)
/*
2 rows from car_makers table:
Id Maker FullName Country
1 amc American Motor Company 1
2 volkswagen Volkswagen 2
*/
CREATE TABLE car_names (
"MakeId" INTEGER,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY("Model") REFERENCES model_list ("Model")
)
/*
2 rows from car_names table:
MakeId Model Make
1 chevrolet chevrolet chevelle malibu
2 buick buick skylark 320
*/
CREATE TABLE cars_data (
"Id" INTEGER,
"MPG" TEXT,
"Cylinders" INTEGER,
"Edispl" REAL,
"Horsepower" TEXT,
"Weight" INTEGER,
"Accelerate" REAL,
"Year" INTEGER,
PRIMARY KEY ("Id"),
FOREIGN KEY("Id") REFERENCES car_names ("MakeId")
)
/*
2 rows from cars_data table:
Id MPG Cylinders Edispl Horsepower Weight Accelerate Year
1 18 8 307.0 130 3504 12.0 1970
2 15 8 350.0 165 3693 11.5 1970
*/
CREATE TABLE continents (
"ContId" INTEGER,
"Continent" TEXT,
PRIMARY KEY ("ContId")
)
/*
2 rows from continents table:
ContId Continent
1 america
2 europe
*/
CREATE TABLE countries (
"CountryId" INTEGER,
"CountryName" TEXT,
"Continent" INTEGER,
PRIMARY KEY ("CountryId"),
FOREIGN KEY("Continent") REFERENCES continents ("ContId")
)
/*
2 rows from countries table:
CountryId CountryName Continent
1 usa 1
2 germany 2
*/
CREATE TABLE model_list (
"ModelId" INTEGER,
"Maker" INTEGER,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY("Maker") REFERENCES car_makers ("Id"),
UNIQUE ("Model")
)
/*
2 rows from model_list table:
ModelId Maker Model
1 1 amc
2 2 audi
*/ | What is the number of carsw ith over 6 cylinders? | SELECT COUNT(*) FROM CARS_DATA WHERE Cylinders > 6; | [{'COUNT(*)': 108}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
car_1 |
CREATE TABLE car_makers (
"Id" INTEGER,
"Maker" TEXT,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY("Country") REFERENCES countries ("CountryId")
)
CREATE TABLE car_names (
"MakeId" INTEGER,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY("Model") REFERENCES model_list ("Model")
)
CREATE TABLE cars_data (
"Id" INTEGER,
"MPG" TEXT,
"Cylinders" INTEGER,
"Edispl" REAL,
"Horsepower" TEXT,
"Weight" INTEGER,
"Accelerate" REAL,
"Year" INTEGER,
PRIMARY KEY ("Id"),
FOREIGN KEY("Id") REFERENCES car_names ("MakeId")
)
CREATE TABLE continents (
"ContId" INTEGER,
"Continent" TEXT,
PRIMARY KEY ("ContId")
)
CREATE TABLE countries (
"CountryId" INTEGER,
"CountryName" TEXT,
"Continent" INTEGER,
PRIMARY KEY ("CountryId"),
FOREIGN KEY("Continent") REFERENCES continents ("ContId")
)
CREATE TABLE model_list (
"ModelId" INTEGER,
"Maker" INTEGER,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY("Maker") REFERENCES car_makers ("Id"),
UNIQUE ("Model")
) |
CREATE TABLE car_makers (
"Id" INTEGER,
"Maker" TEXT,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY("Country") REFERENCES countries ("CountryId")
)
/*
2 rows from car_makers table:
Id Maker FullName Country
1 amc American Motor Company 1
2 volkswagen Volkswagen 2
*/
CREATE TABLE car_names (
"MakeId" INTEGER,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY("Model") REFERENCES model_list ("Model")
)
/*
2 rows from car_names table:
MakeId Model Make
1 chevrolet chevrolet chevelle malibu
2 buick buick skylark 320
*/
CREATE TABLE cars_data (
"Id" INTEGER,
"MPG" TEXT,
"Cylinders" INTEGER,
"Edispl" REAL,
"Horsepower" TEXT,
"Weight" INTEGER,
"Accelerate" REAL,
"Year" INTEGER,
PRIMARY KEY ("Id"),
FOREIGN KEY("Id") REFERENCES car_names ("MakeId")
)
/*
2 rows from cars_data table:
Id MPG Cylinders Edispl Horsepower Weight Accelerate Year
1 18 8 307.0 130 3504 12.0 1970
2 15 8 350.0 165 3693 11.5 1970
*/
CREATE TABLE continents (
"ContId" INTEGER,
"Continent" TEXT,
PRIMARY KEY ("ContId")
)
/*
2 rows from continents table:
ContId Continent
1 america
2 europe
*/
CREATE TABLE countries (
"CountryId" INTEGER,
"CountryName" TEXT,
"Continent" INTEGER,
PRIMARY KEY ("CountryId"),
FOREIGN KEY("Continent") REFERENCES continents ("ContId")
)
/*
2 rows from countries table:
CountryId CountryName Continent
1 usa 1
2 germany 2
*/
CREATE TABLE model_list (
"ModelId" INTEGER,
"Maker" INTEGER,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY("Maker") REFERENCES car_makers ("Id"),
UNIQUE ("Model")
)
/*
2 rows from model_list table:
ModelId Maker Model
1 1 amc
2 2 audi
*/ | What is the maximum miles per gallon of the car with 8 cylinders or produced before 1980 ? | SELECT max(mpg) FROM cars_data WHERE cylinders = 8 OR YEAR < 1980 | [{'max(mpg)': 'null'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
car_1 |
CREATE TABLE car_makers (
"Id" INTEGER,
"Maker" TEXT,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY("Country") REFERENCES countries ("CountryId")
)
CREATE TABLE car_names (
"MakeId" INTEGER,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY("Model") REFERENCES model_list ("Model")
)
CREATE TABLE cars_data (
"Id" INTEGER,
"MPG" TEXT,
"Cylinders" INTEGER,
"Edispl" REAL,
"Horsepower" TEXT,
"Weight" INTEGER,
"Accelerate" REAL,
"Year" INTEGER,
PRIMARY KEY ("Id"),
FOREIGN KEY("Id") REFERENCES car_names ("MakeId")
)
CREATE TABLE continents (
"ContId" INTEGER,
"Continent" TEXT,
PRIMARY KEY ("ContId")
)
CREATE TABLE countries (
"CountryId" INTEGER,
"CountryName" TEXT,
"Continent" INTEGER,
PRIMARY KEY ("CountryId"),
FOREIGN KEY("Continent") REFERENCES continents ("ContId")
)
CREATE TABLE model_list (
"ModelId" INTEGER,
"Maker" INTEGER,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY("Maker") REFERENCES car_makers ("Id"),
UNIQUE ("Model")
) |
CREATE TABLE car_makers (
"Id" INTEGER,
"Maker" TEXT,
"FullName" TEXT,
"Country" TEXT,
PRIMARY KEY ("Id"),
FOREIGN KEY("Country") REFERENCES countries ("CountryId")
)
/*
2 rows from car_makers table:
Id Maker FullName Country
1 amc American Motor Company 1
2 volkswagen Volkswagen 2
*/
CREATE TABLE car_names (
"MakeId" INTEGER,
"Model" TEXT,
"Make" TEXT,
PRIMARY KEY ("MakeId"),
FOREIGN KEY("Model") REFERENCES model_list ("Model")
)
/*
2 rows from car_names table:
MakeId Model Make
1 chevrolet chevrolet chevelle malibu
2 buick buick skylark 320
*/
CREATE TABLE cars_data (
"Id" INTEGER,
"MPG" TEXT,
"Cylinders" INTEGER,
"Edispl" REAL,
"Horsepower" TEXT,
"Weight" INTEGER,
"Accelerate" REAL,
"Year" INTEGER,
PRIMARY KEY ("Id"),
FOREIGN KEY("Id") REFERENCES car_names ("MakeId")
)
/*
2 rows from cars_data table:
Id MPG Cylinders Edispl Horsepower Weight Accelerate Year
1 18 8 307.0 130 3504 12.0 1970
2 15 8 350.0 165 3693 11.5 1970
*/
CREATE TABLE continents (
"ContId" INTEGER,
"Continent" TEXT,
PRIMARY KEY ("ContId")
)
/*
2 rows from continents table:
ContId Continent
1 america
2 europe
*/
CREATE TABLE countries (
"CountryId" INTEGER,
"CountryName" TEXT,
"Continent" INTEGER,
PRIMARY KEY ("CountryId"),
FOREIGN KEY("Continent") REFERENCES continents ("ContId")
)
/*
2 rows from countries table:
CountryId CountryName Continent
1 usa 1
2 germany 2
*/
CREATE TABLE model_list (
"ModelId" INTEGER,
"Maker" INTEGER,
"Model" TEXT,
PRIMARY KEY ("ModelId"),
FOREIGN KEY("Maker") REFERENCES car_makers ("Id"),
UNIQUE ("Model")
)
/*
2 rows from model_list table:
ModelId Maker Model
1 1 amc
2 2 audi
*/ | What is the maximum mpg of the cars that had 8 cylinders or that were produced before 1980 ? | SELECT max(mpg) FROM cars_data WHERE cylinders = 8 OR YEAR < 1980 | [{'max(mpg)': 'null'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which country does Airline "JetBlue Airways" belong to? | SELECT Country FROM AIRLINES WHERE Airline = "JetBlue Airways" | [{'Country': 'USA'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What country is Jetblue Airways affiliated with? | SELECT Country FROM AIRLINES WHERE Airline = "JetBlue Airways" | [{'Country': 'USA'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What is the abbreviation of Airline "JetBlue Airways"? | SELECT Abbreviation FROM AIRLINES WHERE Airline = "JetBlue Airways" | [{'Abbreviation': 'JetBlue'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which abbreviation corresponds to Jetblue Airways? | SELECT Abbreviation FROM AIRLINES WHERE Airline = "JetBlue Airways" | [{'Abbreviation': 'JetBlue'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | List all airline names and their abbreviations in "USA". | SELECT Airline , Abbreviation FROM AIRLINES WHERE Country = "USA" | [{'Airline': 'United Airlines', 'Abbreviation': 'UAL'}, {'Airline': 'US Airways', 'Abbreviation': 'USAir'}, {'Airline': 'Delta Airlines', 'Abbreviation': 'Delta'}, {'Airline': 'Southwest Airlines', 'Abbreviation': 'Southwest'}, {'Airline': 'American Airlines', 'Abbreviation': 'American'}, {'Airline': 'Northwest Airlines', 'Abbreviation': 'Northwest'}, {'Airline': 'Continental Airlines', 'Abbreviation': 'Continental'}, {'Airline': 'JetBlue Airways', 'Abbreviation': 'JetBlue'}, {'Airline': 'Frontier Airlines', 'Abbreviation': 'Frontier'}, {'Airline': 'AirTran Airways', 'Abbreviation': 'AirTran'}, {'Airline': 'Allegiant Air', 'Abbreviation': 'Allegiant'}, {'Airline': 'Virgin America', 'Abbreviation': 'Virgin'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are the airline names and abbreviations for airlines in the USA? | SELECT Airline , Abbreviation FROM AIRLINES WHERE Country = "USA" | [{'Airline': 'United Airlines', 'Abbreviation': 'UAL'}, {'Airline': 'US Airways', 'Abbreviation': 'USAir'}, {'Airline': 'Delta Airlines', 'Abbreviation': 'Delta'}, {'Airline': 'Southwest Airlines', 'Abbreviation': 'Southwest'}, {'Airline': 'American Airlines', 'Abbreviation': 'American'}, {'Airline': 'Northwest Airlines', 'Abbreviation': 'Northwest'}, {'Airline': 'Continental Airlines', 'Abbreviation': 'Continental'}, {'Airline': 'JetBlue Airways', 'Abbreviation': 'JetBlue'}, {'Airline': 'Frontier Airlines', 'Abbreviation': 'Frontier'}, {'Airline': 'AirTran Airways', 'Abbreviation': 'AirTran'}, {'Airline': 'Allegiant Air', 'Abbreviation': 'Allegiant'}, {'Airline': 'Virgin America', 'Abbreviation': 'Virgin'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | List the airport code and name in the city of Anthony. | SELECT AirportCode , AirportName FROM AIRPORTS WHERE city = "Anthony" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the airport code and airport name corresonding to the city Anthony. | SELECT AirportCode , AirportName FROM AIRPORTS WHERE city = "Anthony" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many airlines do we have? | SELECT count(*) FROM AIRLINES | [{'count(*)': 12}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What is the total number of airlines? | SELECT count(*) FROM AIRLINES | [{'count(*)': 12}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many airports do we have? | SELECT count(*) FROM AIRPORTS | [{'count(*)': 100}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Return the number of airports. | SELECT count(*) FROM AIRPORTS | [{'count(*)': 100}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many flights do we have? | SELECT count(*) FROM FLIGHTS | [{'count(*)': 1200}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Return the number of flights. | SELECT count(*) FROM FLIGHTS | [{'count(*)': 1200}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which airline has abbreviation 'UAL'? | SELECT Airline FROM AIRLINES WHERE Abbreviation = "UAL" | [{'Airline': 'United Airlines'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the airline with abbreviation 'UAL'. | SELECT Airline FROM AIRLINES WHERE Abbreviation = "UAL" | [{'Airline': 'United Airlines'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many airlines are from USA? | SELECT count(*) FROM AIRLINES WHERE Country = "USA" | [{'count(*)': 12}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Return the number of airlines in the USA. | SELECT count(*) FROM AIRLINES WHERE Country = "USA" | [{'count(*)': 12}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Which city and country is the Alton airport at? | SELECT City , Country FROM AIRPORTS WHERE AirportName = "Alton" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the city and country for the Alton airport. | SELECT City , Country FROM AIRPORTS WHERE AirportName = "Alton" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What is the airport name for airport 'AKO'? | SELECT AirportName FROM AIRPORTS WHERE AirportCode = "AKO" | [{'AirportName': 'Colorado Plains Regional Airport '}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Return the name of the airport with code 'AKO'. | SELECT AirportName FROM AIRPORTS WHERE AirportCode = "AKO" | [{'AirportName': 'Colorado Plains Regional Airport '}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are airport names at City 'Aberdeen'? | SELECT AirportName FROM AIRPORTS WHERE City = "Aberdeen" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are the names of airports in Aberdeen? | SELECT AirportName FROM AIRPORTS WHERE City = "Aberdeen" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many flights depart from 'APG'? | SELECT count(*) FROM FLIGHTS WHERE SourceAirport = "APG" | [{'count(*)': 0}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Count the number of flights departing from 'APG'. | SELECT count(*) FROM FLIGHTS WHERE SourceAirport = "APG" | [{'count(*)': 0}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | How many flights have destination ATO? | SELECT count(*) FROM FLIGHTS WHERE DestAirport = "ATO" | [{'count(*)': 0}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Count the number of flights into ATO. | SELECT count(*) FROM FLIGHTS WHERE DestAirport = "ATO" | [{'count(*)': 0}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are flight numbers of flights departing from Airport "APG"? | SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the flight numbers of flights leaving from APG. | SELECT FlightNo FROM FLIGHTS WHERE SourceAirport = "APG" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | What are flight numbers of flights arriving at Airport "APG"? | SELECT FlightNo FROM FLIGHTS WHERE DestAirport = "APG" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
flight_2 |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
) |
CREATE TABLE airlines (
uid INTEGER,
"Airline" TEXT,
"Abbreviation" TEXT,
"Country" TEXT,
PRIMARY KEY (uid)
)
/*
2 rows from airlines table:
uid Airline Abbreviation Country
1 United Airlines UAL USA
2 US Airways USAir USA
*/
CREATE TABLE airports (
"City" TEXT,
"AirportCode" TEXT,
"AirportName" TEXT,
"Country" TEXT,
"CountryAbbrev" TEXT,
PRIMARY KEY ("AirportCode")
)
/*
2 rows from airports table:
City AirportCode AirportName Country CountryAbbrev
Aberdeen APG Phillips AAF United States US
Aberdeen ABR Municipal United States US
*/
CREATE TABLE flights (
"Airline" INTEGER,
"FlightNo" INTEGER,
"SourceAirport" TEXT,
"DestAirport" TEXT,
PRIMARY KEY ("Airline", "FlightNo"),
FOREIGN KEY("SourceAirport") REFERENCES airports ("AirportCode"),
FOREIGN KEY("DestAirport") REFERENCES airports ("AirportCode")
)
/*
2 rows from flights table:
Airline FlightNo SourceAirport DestAirport
1 28 APG ASY
1 29 ASY APG
*/ | Give the flight numbers of flights landing at APG. | SELECT FlightNo FROM FLIGHTS WHERE DestAirport = "APG" | [{'Nenhum': 'Nenhum resultado encontrado'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | How many employees are there? | SELECT count(*) FROM employee | [{'count(*)': 10}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Count the number of employees | SELECT count(*) FROM employee | [{'count(*)': 10}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Sort employee names by their age in ascending order. | SELECT name FROM employee ORDER BY age | [{'Name': 'George Chuter'}, {'Name': 'Andrew Sheridan'}, {'Name': 'Lee Mears'}, {'Name': 'Tim Payne'}, {'Name': 'Matt Stevens'}, {'Name': 'Jason Hobson'}, {'Name': 'Steve Borthwick'}, {'Name': 'Louis Deacon'}, {'Name': 'Phil Vickery'}, {'Name': 'Mark Regan'}] | Easy | false | false | false | true | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | List the names of employees and sort in ascending order of age. | SELECT name FROM employee ORDER BY age | [{'Name': 'George Chuter'}, {'Name': 'Andrew Sheridan'}, {'Name': 'Lee Mears'}, {'Name': 'Tim Payne'}, {'Name': 'Matt Stevens'}, {'Name': 'Jason Hobson'}, {'Name': 'Steve Borthwick'}, {'Name': 'Louis Deacon'}, {'Name': 'Phil Vickery'}, {'Name': 'Mark Regan'}] | Easy | false | false | false | true | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What is the number of employees from each city? | SELECT count(*) , city FROM employee GROUP BY city | [{'count(*)': 3, 'City': 'Bath'}, {'count(*)': 3, 'City': 'Bristol'}, {'count(*)': 1, 'City': 'Leicester'}, {'count(*)': 1, 'City': 'Sale'}, {'count(*)': 2, 'City': 'Wasps'}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Count the number of employees for each city. | SELECT count(*) , city FROM employee GROUP BY city | [{'count(*)': 3, 'City': 'Bath'}, {'count(*)': 3, 'City': 'Bristol'}, {'count(*)': 1, 'City': 'Leicester'}, {'count(*)': 1, 'City': 'Sale'}, {'count(*)': 2, 'City': 'Wasps'}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Which cities do more than one employee under age 30 come from? | SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1 | [{'City': 'Bath'}] | Easy | false | false | false | false | false | true | true | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the cities that have more than one employee under age 30. | SELECT city FROM employee WHERE age < 30 GROUP BY city HAVING count(*) > 1 | [{'City': 'Bath'}] | Easy | false | false | false | false | false | true | true | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the number of shops in each location. | SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION | [{'count(*)': 1, 'Location': 'Espoo'}, {'count(*)': 1, 'Location': 'Helsinki'}, {'count(*)': 1, 'Location': 'Jakobstad'}, {'count(*)': 1, 'Location': 'Kotka'}, {'count(*)': 1, 'Location': 'Kuopio'}, {'count(*)': 1, 'Location': 'Lahti'}, {'count(*)': 1, 'Location': 'Mariehamn'}, {'count(*)': 1, 'Location': 'Turku'}, {'count(*)': 1, 'Location': 'Valkeakoski'}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | How many shops are there in each location? | SELECT count(*) , LOCATION FROM shop GROUP BY LOCATION | [{'count(*)': 1, 'Location': 'Espoo'}, {'count(*)': 1, 'Location': 'Helsinki'}, {'count(*)': 1, 'Location': 'Jakobstad'}, {'count(*)': 1, 'Location': 'Kotka'}, {'count(*)': 1, 'Location': 'Kuopio'}, {'count(*)': 1, 'Location': 'Lahti'}, {'count(*)': 1, 'Location': 'Mariehamn'}, {'count(*)': 1, 'Location': 'Turku'}, {'count(*)': 1, 'Location': 'Valkeakoski'}] | Easy | false | false | false | false | false | true | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the manager name and district of the shop whose number of products is the largest. | SELECT manager_name , district FROM shop ORDER BY number_products DESC LIMIT 1 | [{'Manager_name': 'Ilkka Mäkelä', 'District': 'Lahden Stadion'}] | Easy | false | false | false | true | true | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What are the manager name and district of the shop that sells the largest number of products? | SELECT manager_name , district FROM shop ORDER BY number_products DESC LIMIT 1 | [{'Manager_name': 'Ilkka Mäkelä', 'District': 'Lahden Stadion'}] | Easy | false | false | false | true | true | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | find the minimum and maximum number of products of all stores. | SELECT min(Number_products) , max(Number_products) FROM shop | [{'min(Number_products)': 1600, 'max(Number_products)': 15000}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What are the minimum and maximum number of products across all the shops? | SELECT min(Number_products) , max(Number_products) FROM shop | [{'min(Number_products)': 1600, 'max(Number_products)': 15000}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Return the name, location and district of all shops in descending order of number of products. | SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC | [{'Name': 'FC Lahti', 'Location': 'Lahti', 'District': 'Lahden Stadion'}, {'Name': 'HJK', 'Location': 'Helsinki', 'District': 'Finnair Stadium'}, {'Name': 'FC Inter', 'Location': 'Turku', 'District': 'Veritas Stadion'}, {'Name': 'FC Honka', 'Location': 'Espoo', 'District': 'Tapiolan Urheilupuisto'}, {'Name': 'FF Jaro', 'Location': 'Jakobstad', 'District': 'Jakobstads Centralplan'}, {'Name': 'FC KooTeePee', 'Location': 'Kotka', 'District': 'Arto Tolsa Areena'}, {'Name': 'FC Haka', 'Location': 'Valkeakoski', 'District': 'Tehtaan kenttä'}, {'Name': 'KuPS', 'Location': 'Kuopio', 'District': 'Magnum Areena'}, {'Name': 'IFK Mariehamn', 'Location': 'Mariehamn', 'District': 'Wiklöf Holding Arena'}] | Easy | false | false | false | true | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Sort all the shops by number products in descending order, and return the name, location and district of each shop. | SELECT name , LOCATION , district FROM shop ORDER BY number_products DESC | [{'Name': 'FC Lahti', 'Location': 'Lahti', 'District': 'Lahden Stadion'}, {'Name': 'HJK', 'Location': 'Helsinki', 'District': 'Finnair Stadium'}, {'Name': 'FC Inter', 'Location': 'Turku', 'District': 'Veritas Stadion'}, {'Name': 'FC Honka', 'Location': 'Espoo', 'District': 'Tapiolan Urheilupuisto'}, {'Name': 'FF Jaro', 'Location': 'Jakobstad', 'District': 'Jakobstads Centralplan'}, {'Name': 'FC KooTeePee', 'Location': 'Kotka', 'District': 'Arto Tolsa Areena'}, {'Name': 'FC Haka', 'Location': 'Valkeakoski', 'District': 'Tehtaan kenttä'}, {'Name': 'KuPS', 'Location': 'Kuopio', 'District': 'Magnum Areena'}, {'Name': 'IFK Mariehamn', 'Location': 'Mariehamn', 'District': 'Wiklöf Holding Arena'}] | Easy | false | false | false | true | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the names of stores whose number products is more than the average number of products. | SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop) | [{'Name': 'HJK'}, {'Name': 'FC Inter'}, {'Name': 'FC Lahti'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Which shops' number products is above the average? Give me the shop names. | SELECT name FROM shop WHERE number_products > (SELECT avg(number_products) FROM shop) | [{'Name': 'HJK'}, {'Name': 'FC Inter'}, {'Name': 'FC Lahti'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the names of employees who never won any award in the evaluation. | SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation) | [{'Name': 'Mark Regan'}, {'Name': 'Tim Payne'}, {'Name': 'Andrew Sheridan'}, {'Name': 'Phil Vickery'}, {'Name': 'Steve Borthwick'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What are the names of the employees who never received any evaluation? | SELECT name FROM employee WHERE Employee_ID NOT IN (SELECT Employee_ID FROM evaluation) | [{'Name': 'Mark Regan'}, {'Name': 'Tim Payne'}, {'Name': 'Andrew Sheridan'}, {'Name': 'Phil Vickery'}, {'Name': 'Steve Borthwick'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the name of the shops that do not hire any employee. | SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring) | [{'Name': 'FC Honka'}, {'Name': 'KuPS'}, {'Name': 'IFK Mariehamn'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Which shops run with no employees? Find the shop names | SELECT name FROM shop WHERE shop_id NOT IN (SELECT shop_id FROM hiring) | [{'Name': 'FC Honka'}, {'Name': 'KuPS'}, {'Name': 'IFK Mariehamn'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What is total bonus given in all evaluations? | SELECT sum(bonus) FROM evaluation | [{'sum(bonus)': 19500.0}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Find the total amount of bonus given in all the evaluations. | SELECT sum(bonus) FROM evaluation | [{'sum(bonus)': 19500.0}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Give me all the information about hiring. | SELECT * FROM hiring | [{'Shop_ID': 1, 'Employee_ID': 1, 'Start_from': '2009', 'Is_full_time': 'T'}, {'Shop_ID': 1, 'Employee_ID': 2, 'Start_from': '2003', 'Is_full_time': 'T'}, {'Shop_ID': 8, 'Employee_ID': 3, 'Start_from': '2011', 'Is_full_time': 'F'}, {'Shop_ID': 4, 'Employee_ID': 4, 'Start_from': '2012', 'Is_full_time': 'T'}, {'Shop_ID': 5, 'Employee_ID': 5, 'Start_from': '2013', 'Is_full_time': 'T'}, {'Shop_ID': 2, 'Employee_ID': 6, 'Start_from': '2010', 'Is_full_time': 'F'}, {'Shop_ID': 6, 'Employee_ID': 7, 'Start_from': '2008', 'Is_full_time': 'T'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | What is all the information about hiring? | SELECT * FROM hiring | [{'Shop_ID': 1, 'Employee_ID': 1, 'Start_from': '2009', 'Is_full_time': 'T'}, {'Shop_ID': 1, 'Employee_ID': 2, 'Start_from': '2003', 'Is_full_time': 'T'}, {'Shop_ID': 8, 'Employee_ID': 3, 'Start_from': '2011', 'Is_full_time': 'F'}, {'Shop_ID': 4, 'Employee_ID': 4, 'Start_from': '2012', 'Is_full_time': 'T'}, {'Shop_ID': 5, 'Employee_ID': 5, 'Start_from': '2013', 'Is_full_time': 'T'}, {'Shop_ID': 2, 'Employee_ID': 6, 'Start_from': '2010', 'Is_full_time': 'F'}, {'Shop_ID': 6, 'Employee_ID': 7, 'Start_from': '2008', 'Is_full_time': 'T'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | How many different store locations are there? | SELECT count(DISTINCT LOCATION) FROM shop | [{'count(DISTINCT LOCATION)': 9}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
employee_hire_evaluation |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
) |
CREATE TABLE employee (
"Employee_ID" INTEGER,
"Name" TEXT,
"Age" INTEGER,
"City" TEXT,
PRIMARY KEY ("Employee_ID")
)
/*
2 rows from employee table:
Employee_ID Name Age City
1 George Chuter 23 Bristol
2 Lee Mears 29 Bath
*/
CREATE TABLE evaluation (
"Employee_ID" TEXT,
"Year_awarded" TEXT,
"Bonus" REAL,
PRIMARY KEY ("Employee_ID", "Year_awarded"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID")
)
/*
2 rows from evaluation table:
Employee_ID Year_awarded Bonus
1 2011 3000.0
2 2015 3200.0
*/
CREATE TABLE hiring (
"Shop_ID" INTEGER,
"Employee_ID" INTEGER,
"Start_from" TEXT,
"Is_full_time" BOOLEAN,
PRIMARY KEY ("Employee_ID"),
FOREIGN KEY("Employee_ID") REFERENCES employee ("Employee_ID"),
FOREIGN KEY("Shop_ID") REFERENCES shop ("Shop_ID")
)
/*
2 rows from hiring table:
Shop_ID Employee_ID Start_from Is_full_time
1 1 2009 True
1 2 2003 True
*/
CREATE TABLE shop (
"Shop_ID" INTEGER,
"Name" TEXT,
"Location" TEXT,
"District" TEXT,
"Number_products" INTEGER,
"Manager_name" TEXT,
PRIMARY KEY ("Shop_ID")
)
/*
2 rows from shop table:
Shop_ID Name Location District Number_products Manager_name
1 FC Haka Valkeakoski Tehtaan kenttä 3516 Olli Huttunen
2 HJK Helsinki Finnair Stadium 10770 Antti Muurinen
*/ | Count the number of distinct store locations. | SELECT count(DISTINCT LOCATION) FROM shop | [{'count(DISTINCT LOCATION)': 9}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | How many documents do we have? | SELECT count(*) FROM Documents | [{'count(*)': 15}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Count the number of documents. | SELECT count(*) FROM Documents | [{'count(*)': 15}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | List document IDs, document names, and document descriptions for all documents. | SELECT document_id , document_name , document_description FROM Documents | [{'Document_ID': 0, 'Document_Name': 'Introduction of OS', 'Document_Description': 'n'}, {'Document_ID': 1, 'Document_Name': 'Understanding DB', 'Document_Description': 'y'}, {'Document_ID': 3, 'Document_Name': 'Summer Show', 'Document_Description': 'u'}, {'Document_ID': 76, 'Document_Name': 'Robbin CV', 'Document_Description': 'y'}, {'Document_ID': 80, 'Document_Name': 'Welcome to NY', 'Document_Description': 'h'}, {'Document_ID': 82, 'Document_Name': 'Data base', 'Document_Description': 'w'}, {'Document_ID': 2394, 'Document_Name': 'Customer reviews', 'Document_Description': 'y'}, {'Document_ID': 3830, 'Document_Name': 'Do not panic', 'Document_Description': 'k'}, {'Document_ID': 33930, 'Document_Name': 'How Google people work', 'Document_Description': 'z'}, {'Document_ID': 50123, 'Document_Name': 'Learning French', 'Document_Description': 'r'}, {'Document_ID': 651512, 'Document_Name': 'How to write a CV', 'Document_Description': 'f'}, {'Document_ID': 801801, 'Document_Name': 'How to read a book', 'Document_Description': 'w'}, {'Document_ID': 3540024, 'Document_Name': 'Palm reading', 'Document_Description': 'y'}, {'Document_ID': 16514113, 'Document_Name': 'A history of Arts', 'Document_Description': 'h'}, {'Document_ID': 385906526, 'Document_Name': 'About Korea', 'Document_Description': 'b'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What are the ids, names, and descriptions for all documents? | SELECT document_id , document_name , document_description FROM Documents | [{'Document_ID': 0, 'Document_Name': 'Introduction of OS', 'Document_Description': 'n'}, {'Document_ID': 1, 'Document_Name': 'Understanding DB', 'Document_Description': 'y'}, {'Document_ID': 3, 'Document_Name': 'Summer Show', 'Document_Description': 'u'}, {'Document_ID': 76, 'Document_Name': 'Robbin CV', 'Document_Description': 'y'}, {'Document_ID': 80, 'Document_Name': 'Welcome to NY', 'Document_Description': 'h'}, {'Document_ID': 82, 'Document_Name': 'Data base', 'Document_Description': 'w'}, {'Document_ID': 2394, 'Document_Name': 'Customer reviews', 'Document_Description': 'y'}, {'Document_ID': 3830, 'Document_Name': 'Do not panic', 'Document_Description': 'k'}, {'Document_ID': 33930, 'Document_Name': 'How Google people work', 'Document_Description': 'z'}, {'Document_ID': 50123, 'Document_Name': 'Learning French', 'Document_Description': 'r'}, {'Document_ID': 651512, 'Document_Name': 'How to write a CV', 'Document_Description': 'f'}, {'Document_ID': 801801, 'Document_Name': 'How to read a book', 'Document_Description': 'w'}, {'Document_ID': 3540024, 'Document_Name': 'Palm reading', 'Document_Description': 'y'}, {'Document_ID': 16514113, 'Document_Name': 'A history of Arts', 'Document_Description': 'h'}, {'Document_ID': 385906526, 'Document_Name': 'About Korea', 'Document_Description': 'b'}] | Easy | false | false | false | false | false | false | false | false | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | What is the document name and template id for document with description with the letter 'w' in it? | SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE "%w%" | [{'Document_Name': 'Data base', 'Template_ID': 11}, {'Document_Name': 'How to read a book', 'Template_ID': 4}] | Easy | false | true | false | false | false | false | false | false | false | false | false | false | false |
cre_Doc_Template_Mgt |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
) |
CREATE TABLE "Documents" (
"Document_ID" INTEGER NOT NULL,
"Template_ID" INTEGER,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY("Template_ID") REFERENCES "Templates" ("Template_ID")
)
/*
2 rows from Documents table:
Document_ID Template_ID Document_Name Document_Description Other_Details
0 7 Introduction of OS n None
1 25 Understanding DB y None
*/
CREATE TABLE "Paragraphs" (
"Paragraph_ID" INTEGER NOT NULL,
"Document_ID" INTEGER NOT NULL,
"Paragraph_Text" VARCHAR(255),
"Other_Details" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY("Document_ID") REFERENCES "Documents" ("Document_ID")
)
/*
2 rows from Paragraphs table:
Paragraph_ID Document_ID Paragraph_Text Other_Details
7 2394 Korea None
9 3 Somalia None
*/
CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) NOT NULL,
"Template_Type_Description" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_Type_Code")
)
/*
2 rows from Ref_Template_Types table:
Template_Type_Code Template_Type_Description
PPT Presentation
CV CV
*/
CREATE TABLE "Templates" (
"Template_ID" INTEGER NOT NULL,
"Version_Number" INTEGER NOT NULL,
"Template_Type_Code" CHAR(15) NOT NULL,
"Date_Effective_From" DATETIME,
"Date_Effective_To" DATETIME,
"Template_Details" VARCHAR(255) NOT NULL,
PRIMARY KEY ("Template_ID"),
FOREIGN KEY("Template_Type_Code") REFERENCES "Ref_Template_Types" ("Template_Type_Code")
)
/*
2 rows from Templates table:
Template_ID Version_Number Template_Type_Code Date_Effective_From Date_Effective_To Template_Details
0 5 PP 2005-11-12 07:09:48 2008-01-05 14:19:28
1 9 PP 2010-09-24 01:15:11 1999-07-08 03:31:04
*/ | Return the names and template ids for documents that contain the letter w in their description. | SELECT document_name , template_id FROM Documents WHERE Document_Description LIKE "%w%" | [{'Document_Name': 'Data base', 'Template_ID': 11}, {'Document_Name': 'How to read a book', 'Template_ID': 4}] | Easy | false | true | false | false | false | false | false | false | false | false | false | false | false |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 36