db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
shakespeare
What is the long title of the Shakespeare's work with Act 4 Scene 5 described as "Mytilene. A street before the brothel."?
described as "Mytilene. A street before the brothel." refers to chapters.Description = 'Mytilene. A street before the brothel.'
SELECT T1.LongTitle FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.Description = 'Mytilene. A street before the brothel.'
shakespeare
Who is the character that said "This is Illyria, lady."?
character refers to CharName; "This is Illyria, lady." refers to PlainText = 'This is Illyria, lady.'
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'This is Illyria, lady.'
shakespeare
In Shakespeare's works between 1600 to 1610, how many of these have a character as a "Third Servingman"?
between 1600 to 1610 refers to DATE > = 1600 AND DATE < = 1610; "Third Servingman" refers to CharName = 'Third Servingman'
SELECT COUNT(DISTINCT T2.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE BETWEEN 1600 AND 1610 AND T4.CharName = 'Third Servingman'
shakespeare
In the Venus and Adonis, what is the description of the last scene listed?
Venus and Adonis refers to Title = 'Venus and Adonis'; last scene refers to max(Scene)
SELECT T2.Description FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Venus and Adonis' ORDER BY T2.Scene DESC LIMIT 1
shakespeare
In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by Viola?
Twelfth Night refers to Title = 'Twelfth Night'; total number of lines said by Viola refers to count(character_id) where CharName = 'Viola'
SELECT COUNT(T4.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T2.Act = 1 AND T2.Scene = 2 AND T4.id = 1238 AND T4.CharName = 'Viola' AND T1.Title = 'Twelfth Night'
shakespeare
What is the character and work ID of the text "Fear not thou, man, thou shalt lose nothing here."?
character refers to chapter_id; text "Fear not thou, man, thou shalt lose nothing here."  refers to PlainText = 'Fear not thou, man, thou shalt lose nothing here.'
SELECT T2.character_id, T1.work_id FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'Fear not thou, man, thou shalt lose nothing here.'
shakespeare
List the scene numbers involving the character named Sir Toby Belch in the Twelfth Night.
scene numbers refers to Scene; character named Sir Toby Belch refers to CharName = 'Sir Toby Belch'; in the Twelfth Night refers to Title = 'Twelfth Night'
SELECT DISTINCT T2.Scene FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night' AND T4.CharName = 'Sir Toby Belch'
shakespeare
In Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named "Tybalt".
works before 1600 refers to DATE < 1600; tragic story refers to GenreType = 'Tragedy'; character named "Tybalt" refers to CharName = 'Tybalt'
SELECT DISTINCT T1.title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE < 1600 AND T1.GenreType = 'Tragedy' AND T4.CharName = 'Tybalt'
shakespeare
List the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.
a year greater than the 89% of average year refers to DATE > multiply(divide(SUM(DATE) , COUNT(DATE)), 0.89)
SELECT T2.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.DATE > ( SELECT AVG(DATE) FROM works ) * 0.89
cars
Among the cars with 8 cylinders, what is the name of the one that's the most expensive?
with 8 cylinders refers to cylinders = 8; name of the car refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8 ORDER BY T2.price DESC LIMIT 1
cars
Among the cars over 3000lbs, how many of them cost less than $30000?
over 3000lbs refers to weight > 3000; cost less than $30000 refers to price < 30000
SELECT COUNT(T1.car_name) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.weight > 3000 AND T2.price < 30000
cars
What is the acceleration of the most expensive car?
the most expensive refers to max(price)
SELECT T1.acceleration FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
cars
How much US dollars does a Ford Torino cost?
cost refers to price; Ford Torino refers to car_name = 'ford torino'
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford torino'
cars
What was the origin country of the car model ford torino produced in 1970?
origin country refers to country; Ford Torino refers to car_name = 'ford torino'; produced in 1970 refers to model_year = 1970
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'ford torino' AND T2.model_year = 1970
cars
Among the car models introduced in the market in 1970, how many of them have the USA as their origin country?
introduced in the market in 1970 refers to model_year = 1970; have the USA as origin country refers to country = 'USA'
SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.model_year = 1970 AND T2.country = 'USA'
cars
Please list the names of all the car models whose origin country is the USA.
name of car model refers to car_name; origin country is the USA refers to country = 'USA'
SELECT DISTINCT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T2.country = T3.origin WHERE T3.country = 'USA'
cars
Please list the names of the top 3 most expensive cars.
name of the car refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 3
cars
Please list all the years in which the car model Chevrolet Impala was introduced in the market.
year refers to model_year; Chevrolet Impala refers to car_name = 'chevrolet impala'
SELECT DISTINCT T1.model_year FROM production AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.car_name = 'chevrolet impala'
cars
Among the cars with an acceleration of over 10 miles per squared hour, how many of them cost more than $20000 and less than $30000?
an acceleration of over 10 miles per squared hour refers to acceleration > 10; cost more than $20000 and less than $30000 refers to price < 30000 AND price > 20000
SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.acceleration > 10 AND T2.price BETWEEN 20000 AND 30000
cars
Please list the weights of all the cars with the price over $40000.
price over $40000 refers to price > 40000
SELECT T1.weight FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000
cars
What is the maximum acceleration of a car with price over $40000?
the maximum acceleration refers to max(acceleration); price over $40000 refers to price > 40000
SELECT MAX(T1.acceleration) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000
cars
What is the average price of cars with 8 cylinders?
with 8 cylinders refers to cylinders = 8; average price = avg(price) where cylinders = 8
SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8
cars
What is the maximum sweep volume of a car that costs less than $30000?
cost less than $30000 refers to price < 30000; the maximum sweep volume = max(divide(displacement, cylinders)) where price < 30000
SELECT MAX(T1.displacement / T1.cylinders) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price < 30000
cars
How many cars in the database are originated from Europe?
originated from Europe refers to country = 'Europe'
SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe'
cars
Show the origin country of Chevrolet Malibu.
origin country refers to country; Chevrolet Malibu refers to car_name = 'chevrolet malibu'
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevrolet malibu'
cars
What are the miles per gallon of the most expensive car?
miles per gallon refers to mpg; the most expensive refers to max(price)
SELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
cars
Tell the origin country of car no.382.
origin country refers to country; car no.382 refers to ID = 382
SELECT DISTINCT T2.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382
cars
How much is the Volkswagen Dasher with 14.1 mph acceleration?
cost refers to price; Volkswagen Dasher refers to car_name = 'volkswagen dasher'; 14.1 mph acceleration refers to acceleration = 14.1
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'volkswagen dasher' AND T1.acceleration = '14.1'
cars
Provide the engine displacement status of the $37443.85589 car.
engine displacement status refers to displacement; the $37443.85589 car refers to price = 37443.85589
SELECT T1.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589'
cars
When was the $32650.65157 car introduced to the market? State the year.
the $32650.65157 car refers to price = 32650.65157; year refers to model
SELECT T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157'
cars
Provide the price of the only Toyota Corona hardtop in the database.
Toyota Corona hardtop refers to car_name = 'toyota corona hardtop'
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop'
cars
How many cylinders does the cheapest car have?
the cheapest car refers to min(price)
SELECT T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY price ASC LIMIT 1
cars
Which car in the database provides the best crash protection based on its weight? How much is it?
the best crash protection refers to max(weight); cost refers to price
SELECT T1.ID, T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1
cars
State the origin country of the fastest car in the database.
origin country refers to country; the fastest refers to max(horsepower)
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.horsepower DESC LIMIT 1
cars
What is the percentage of Japanese cars in the database?
Japanese car refers to country = 'Japan'; percentage = divide(count(ID where country = 'Japan'), count(ID)) * 100%
SELECT CAST(SUM(CASE WHEN T2.country = 'Japan' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin
cars
What is the name of the most expensive car?
name of the car refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
cars
How many cars were released in the USA in 1981?
in the USA refers to country = 'USA'; in 1981 refers to model_year = 1981
SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'USA' AND T1.model_year = 1981
cars
How much is the car with the highest sweep volume?
cost refers to price; the highest sweep volume refers to max(divide(displacement, cylinders))
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.displacement / T1.cylinders DESC LIMIT 1
cars
What is the fastest car made by Japan?
the fastest refers to max(horsepower); made by Japan refers to country = 'Japan'; name of the car refers to car_name
SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan' ORDER BY T1.horsepower DESC LIMIT 1
cars
How many times was Ford Maverick introduced to the market?
Ford Maverick refers to car_name = 'ford maverick';
SELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'
cars
Which country produced the most fuel-efficient car?
the most fuel-efficient refers to max(mpg)
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg DESC LIMIT 1
cars
Which Dodge car is the cheapest?
Dodge car refers to car_name LIKE 'dodge%'; the cheapest refers to min(price); name of the car refers to car_name
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name LIKE 'dodge%' ORDER BY T2.price ASC LIMIT 1
cars
What is the name of the most expensive car that was produced by the USA?
name of the car refers to car_name; the most expensive refers to max(price); produced by the USA refers to country = 'USA'
SELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price DESC LIMIT 1
cars
Among the cars with an engine displacement of no less than 400 cubic millimeter, how many cars cost at least 30,000?
engine displacement of no less than 400 cubic millimeter refers to displacement > 400; cost at least 30,000 refers to price > 30000
SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.displacement > 400 AND T2.price > 30000
cars
Which year did Europe produce the most cars?
year refers to model_year; Europe refers to country = 'Europe'; the most cars refers to max(model_year)
SELECT T1.model_year FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe' GROUP BY T1.model_year ORDER BY COUNT(T1.model_year) DESC LIMIT 1
cars
How much is the Peugeot 505s Turbo Diesel?
cost refers to price; Peugeot 505s Turbo Diesel refers to car_name = 'peugeot 505s turbo diesel'
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'peugeot 505s turbo diesel'
cars
What is the miles per square hour of the cheapest car produced by the USA?
miles per square hour refers to acceleration; the cheapest refers to min(price); produced by the USA refers to country = 'USA'
SELECT T4.acceleration FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price ASC LIMIT 1
cars
Which country produced the highest number of cars? Calculate the annual average number of cars that the said country produced from the very start to the present.
the highest number of cars refers to max(country); annual average number = divide(count(ID), count(model_year))
SELECT T2.country, CAST(COUNT(T1.ID) AS REAL) / COUNT(DISTINCT T1.model_year) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin GROUP BY T2.country ORDER BY COUNT(T2.country) DESC LIMIT 1
cars
What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 30?
produced by Japan refers to country = 'Japan'; a sweep volume of no less than 30 refers to divide(displacement, cylinders) > 30; percentage = divide(count(ID where country = 'Japan'), count(ID)) * 100% where divide(displacement, cylinders) > 30
SELECT CAST(SUM(CASE WHEN T3.country = 'Japan' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.displacement / T1.cylinders > 30
cars
List the name of the cars with model year 1975.
name of the car refers to car_name; model year 1975 refers to model_year = 1975
SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1975
cars
Calculate the average price of cars from Europe.
from Europe refers to country = 'Europe'; average price = avg(price) where country = 'Europe'
SELECT AVG(T1.price) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Europe'
cars
What is the price of the car ID 15?
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.ID = 15
cars
How many of the cars from Japan weighed less than 3000?
from Japan refers to country = 'Japan'; weighed less than 3000 refers to weight < 3000
SELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T4.weight < 3000
cars
Among the cars produced in year 1973, how many of the cars have horsepower less than 100?
produced in year 1973 refers to model_year = 1973; have horsepower less than 100 refers to horsepower < 100
SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1973 AND T1.horsepower < 100
cars
Provide the ID of cars from Japan worth greater than 35000 and have an acceleration of 14.
from Japan refers to country = 'Japan'; worth greater than 35000 refers to price > 35000; have an acceleration of 14 refers to acceleration = 14
SELECT T4.ID FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T1.price > 3500 AND T4.acceleration = 14
cars
Give the model year of the heaviest car.
the heaviest refers to max(weight)
SELECT T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1
cars
What is the horsepower and model year of the car named Subaru Dl?
the car named Subaru Dl refers to car_name = 'subaru dl'
SELECT T1.horsepower, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'subaru dl'
cars
Among the cars originated from Japan, what is the name of the car with the highest price?
from Japan refers to country = 'Japan'; name of the car refers to car_name; the highest price refers to max(price)
SELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' ORDER BY T1.price DESC LIMIT 1
cars
What are the names of the cars worth 20000?
name of the car refers to car_name; worth 20000 refers to price = 20000
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000
cars
How many cars worth greater than 40000 were from the USA?
worth greater than 40000 refers to price > 40000; from the USA refers to country = 'USA'
SELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.price > 40000
cars
Provide the price and country origin of the car named Ford Maverick.
country origin refers to country; Ford Maverick refers to car_name = 'ford maverick'
SELECT DISTINCT T1.price, T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T4.car_name = 'ford maverick'
cars
List the car's name with a price worth greater than 85% of the average price of all cars.
car's name refers to car_name; a price worth greater than 85% of the average price of all cars refers to price > multiply(avg(price), 0.85)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price * 100 > ( SELECT AVG(price) * 85 FROM price )
cars
Calculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976
a horsepower of 130 refers to horsepower = 130; difference = subtract(count(ID where model_year = 1970), count(ID where model_year = 1976)) where horsepower = 130
SELECT SUM(CASE WHEN T2.model_year = 1970 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.model_year = 1976 THEN 1 ELSE 0 END) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower = 130
cars
Among the cars from Asia, list the IDs of cars that were introduced in 1979.
from Asia refers to country = 'Japan'; introduced in 1979 refers to model_year = 1979
SELECT T1.ID FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Japan' AND T1.model_year = 1979
cars
Which country produced the car with the lowest mileage per gallon?
the lowest mileage per gallon refers to min(mpg)
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg ASC LIMIT 1
cars
Provide the name, model, sweep volume, and introduced year of the car with the best crash protection.
car's name refers to car_name; sweep volume = divide(displacement, cylinders); introduced year refers to model_year; the best crash protection refers to max(weight)
SELECT T1.car_name, T1.model, T1.displacement / T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1
cars
Among the cars introduced in 1977, provide the names and the horse powers of cars from Europe.
introduced in 1977 refers to model_year = 1977; car's name refers to car_name; from Europe refers to country = 'Europe'
SELECT T1.car_name, T1.horsepower FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1977 AND T3.country = 'Europe'
cars
Provide the name and model of the car with the highest price.
car's name refers to car_name; the highest price refers to max(price)
SELECT T1.car_name, T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
cars
What is the price of a Chevrolet Bel Air?
Chevrolet Bel Air refers to car_name = 'chevrolet bel air'
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet bel air'
cars
What is the average price per car produced in Japan?
produced in Japan refers to country = 'Japan'; average price per car = avg(price) where country = 'Japan'
SELECT AVG(T1.price) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan'
cars
Which country produced the car with the lowest price?
the lowest price refers to min(price)
SELECT T3.country FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.price ASC LIMIT 1
cars
Among the cars produced in 1975, provide IDs, names, and producing countries of the cars with the maximum number of cylinders.
produced in 1975 refers to model_year = 1975; names refers to car_name; producing countries refers to country; the maximum number of cylinders refers to max(cylinders)
SELECT T1.ID, T1.car_name, T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1975 ORDER BY T1.cylinders DESC LIMIT 1
cars
Which car is the cheapest? Provide its acceleration, number of cylinders, and producing year.
the cheapest refers to min(price); number of cylinders refers to cylinders; producing year refers to model_year
SELECT T1.acceleration, T1.cylinders, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID ORDER BY T3.price ASC LIMIT 1
cars
List the names and prices of the cars with model 82 and mileage per gallon of greater than 30.
car's name refers to car_name; model 82 refers to model = 82; mileage per gallon of greater than 30 refers to mpg > 30
SELECT T2.car_name, T1.price FROM price AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.model = 82 AND T2.mpg > 30
cars
How many models of Ford Maverick were produced?
Ford Maverick refers to car_name = 'ford maverick'
SELECT COUNT(DISTINCT T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'
cars
Calculate the percentage of cars that belong to the USA.
belong to the USA refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%
SELECT CAST(SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin
cars
What is the average price of model 70 cars?
model 70 refers to model = 70; average price = avg(price) where model = 70
SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.model = 70
cars
What is the price of Chevrolet Vega 2300?
Chevrolet Vega 2300 refers to car_name = 'chevrolet vega 2300'
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet vega 2300'
cars
Which country does Chevy C20 come from?
Chevy C20 refers to car_name = 'chevy c20'
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevy c20'
cars
List the price of Ford cars from model 1970 to 1980.
Ford cars refers to car_name LIKE 'ford%'; from model 1970 to 1980 refers to model_year BETWEEN 1970 AND 1980
SELECT DISTINCT T3.price FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN price AS T3 ON T3.ID = T2.ID WHERE T1.car_name LIKE 'ford%' AND T2.model_year BETWEEN 1970 AND 1980
cars
Which is the most fuel efficient car in 1975?
car's name refers to car_name; the most fuel efficient refers to max(mpg); in 1975 refers to model_year = 1975
SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = '1975' ORDER BY T1.mpg DESC LIMIT 1
cars
Which car consumes fuel the most and has the highest price?
consumes fuel the most refers to min(mpg); has the highest price refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.mpg DESC, T2.price DESC LIMIT 1
cars
How many American cars have an acceleration time of less than 12 seconds?
American car refers to country = 'USA'; an acceleration time of less than 12 seconds refers to acceleration < 12
SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.acceleration < 12
cars
How many Japanese cars weigh more than 2000 lbs?
Japanese car refers to country = 'Japan'; weigh more than 2000 lbs refers to weight > 2000
SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Japan' AND T1.weight > 2000
cars
List the name of the most expensive car.
car's name refers to car_name; the most expensive refers to max(price)
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
cars
What years did the Buick Skylark 320 get in production?
year refers to model_year; Buick Skylark 320 refers to car_name = 'buick skylark 320'
SELECT T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'buick skylark 320'
cars
Which country produced the most expensive car in 1970?
the most expensive refers to max(price); in 1970 refers to model_year = 1970
SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN price AS T4 ON T4.ID = T1.ID WHERE T2.model_year = 1970 ORDER BY T4.price DESC LIMIT 1
cars
How many cars with horsepower greater than 200 were produced in 1975?
horsepower greater than 200 refers to horsepower > 200; in 1975 refers to model_year = 1975
SELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower > 200 AND T2.model_year = 1975
cars
Calculate the percentage of American cars among all cars.
American car refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%
SELECT CAST(SUM(CASE WHEN T3.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country
cars
What is the average weight of Japanese cars with 4 cylinders that were produced from 1975 to 1980?
Japanese car refers to country = 'Japan'; with 4 cylinders refers to cylinders = 4; produced from 1975 to 1980 refers to model_year BETWEEN 1975 AND 1980; average weight = avg(weight)
SELECT AVG(T1.weight) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year BETWEEN 1975 AND 1980 AND T1.cylinders = 4 AND T3.country = 'Japan'
donor
Name all the project titles whereby project materials are intended mainly for literary.
intended mainly for literary refers to primary_focus_subject = 'Literacy'
SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject = 'Literacy'
donor
Name the project titles meant for school whereby 65% of the students are on reduced lunch.
65% of the students are on reduced lunch refers to poverty_level = 'highest poverty'
SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.poverty_level LIKE 'highest%'
donor
For project titled 'Toot Your Flute!', what is the main subject of the project materials intended for? Name the other projects with the similar focus.
main subject refers to primary_focus_subject
SELECT T2.primary_focus_subject FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'Toot Your Flute!'
donor
What is the project in which 320 students will be impacted if the project is funded? Name the project and state the project cost.
320 students will be impacted refers to students_reached = 320; name the project refers to title; project cost refers tp total_price_excluding_optional_support
SELECT T1.title, T2.total_price_excluding_optional_support FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.students_reached = 320
donor
Name and describe all projects created by New York teachers.
project name refers to title; describe refers to short_description; New York teachers refers to teacher_ny_teaching_fellow = 't'
SELECT T1.title, T1.short_description FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_ny_teaching_fellow = 't'
donor
If funded, which are the projects that could impact at least 600 students for a school with moderate level of poverty? Name the projects and state the project cost.
impact at least 600 students refers to students_reached > = 600; moderate level of poverty refers to poverty_level = 'moderate poverty'; project name refers to title; project cost refers to total_price_excluding_optional_support
SELECT DISTINCT T2.title, T1.total_price_excluding_optional_support FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.students_reached >= 600 AND T1.poverty_level LIKE 'moderate poverty'
donor
How many schools in the West New York School District have the highest poverty level?
the highest poverty level refers to poverty_level = 'highest poverty'
SELECT COUNT(poverty_level) FROM projects WHERE school_district = 'West New York School District' AND poverty_level = 'highest poverty'
donor
How many donations from teachers were done in the state of Colorado?
from teachers refers to is_teacher_acct = 't'; the state of Colorado refers to donor_state = 'CO-Colorado'
SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_state = 'CO'
donor
Which project have the highest total price including optional support? Indicate the project id.
highest total price including optional support refers to max(total_price_including_optional_support)
SELECT projectid FROM projects ORDER BY total_price_including_optional_support DESC LIMIT 1
donor
What is the total price including optional support received by the teacher who posted the essay titled "Recording Rockin' Readers"?
SELECT SUM(T1.total_price_including_optional_support) FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title = 'Recording Rockin'' Readers'