Chinastark/bird_dataset huggingface dataset:
Database: shakespeare
Question: In Shakespeare's works between 1600 to 1610, how many of these have a character as a "Third Servingman"?
Evidence: between 1600 to 1610 refers to DATE > = 1600 AND DATE < = 1610; "Third Servingman" refers to CharName = 'Third Servingman'
SQL: 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'
Database: shakespeare
Question: In the Venus and Adonis, what is the description of the last scene listed?
Evidence: Venus and Adonis refers to Title = 'Venus and Adonis'; last scene refers to max(Scene)
SQL: 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
Database: shakespeare
Question: In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by Viola?
Evidence: Twelfth Night refers to Title = 'Twelfth Night'; total number of lines said by Viola refers to count(character_id) where CharName = 'Viola'
SQL: 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'
Database: shakespeare
Question: What is the character and work ID of the text "Fear not thou, man, thou shalt lose nothing here."?
Evidence: 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.'
SQL: 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.'
Database: shakespeare
Question: What is the chapter description where the paragraph "What, wilt thou hear some music, my sweet love?" belongs?
Evidence: paragraph "What, wilt thou hear some music, my sweet love?" refers to  PlainText = 'What, wilt thou hear some music, my sweet love?'
SQL: SELECT T1.id, T1.Description FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'What, wilt thou hear some music, my sweet love?'
Database: shakespeare
Question: List the scene numbers involving the character named Sir Toby Belch in the Twelfth Night.
Evidence: 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'
SQL: 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'
Database: shakespeare
Question: In Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named "Tybalt".
Evidence: works before 1600 refers to DATE < 1600; tragic story refers to GenreType = 'Tragedy'; character named "Tybalt" refers to CharName = 'Tybalt'
SQL: 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'
Database: shakespeare
Question: List the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.
Evidence: a year greater than the 89% of average year refers to DATE > multiply(divide(SUM(DATE) , COUNT(DATE)), 0.89)
SQL: 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
Database: shakespeare
Question: Among the comedy works of Shakespeare, what is the percentage of his works with a character named "antonio"?
Evidence: comedy works refers to GenreType = 'Comedy'; a character named "antonio" refers to CharName = 'antonio'; percentage = divide(sum(CharName = 'Antonio'), count(CharName)) as percentage
SQL: SELECT CAST(SUM(IIF(T4.CharName = 'antonio', 1, 0)) AS REAL) * 100 / COUNT(T1.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.GenreType = 'Comedy'
Database: cars
Question: Among the cars with 8 cylinders, what is the name of the one that's the most expensive?
Evidence: with 8 cylinders refers to cylinders = 8; name of the car refers to car_name; the most expensive refers to max(price)
SQL: 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
Database: cars
Question: Among the cars over 3000lbs, how many of them cost less than $30000?
Evidence: over 3000lbs refers to weight > 3000; cost less than $30000 refers to price < 30000
SQL: 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
Database: cars
Question: What is the acceleration of the most expensive car?
Evidence: the most expensive refers to max(price)
SQL: SELECT T1.acceleration FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
Database: cars
Question: How much US dollars does a Ford Torino cost?
Evidence: cost refers to price; Ford Torino refers to car_name = 'ford torino'
SQL: SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford torino'
Database: cars
Question: What was the origin country of the car model ford torino produced in 1970?
Evidence: origin country refers to country; Ford Torino refers to car_name = 'ford torino'; produced in 1970 refers to model_year = 1970
SQL: 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
Database: cars
Question: Among the car models introduced in the market in 1970, how many of them have the USA as their origin country?
Evidence: introduced in the market in 1970 refers to model_year = 1970; have the USA as origin country refers to country = 'USA'
SQL: 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'
Database: cars
Question: Please list the names of all the car models whose origin country is the USA.
Evidence: name of car model refers to car_name; origin country is the USA refers to country = 'USA'
SQL: 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'
Database: cars
Question: Please list the names of the top 3 most expensive cars.
Evidence: name of the car refers to car_name; the most expensive refers to max(price)
SQL: 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
Database: cars
Question: Please list all the years in which the car model Chevrolet Impala was introduced in the market.
Evidence: year refers to model_year; Chevrolet Impala refers to car_name = 'chevrolet impala'
SQL: 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'
Database: cars
Question: 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?
Evidence: 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
SQL: 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
Database: cars
Question: Please list the weights of all the cars with the price over $40000.
Evidence: price over $40000 refers to price > 40000
SQL: SELECT T1.weight FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000
Database: cars
Question: What is the maximum acceleration of a car with price over $40000?
Evidence: the maximum acceleration refers to max(acceleration); price over $40000 refers to price > 40000
SQL: SELECT MAX(T1.acceleration) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000
Database: cars
Question: What is the average price of cars with 8 cylinders?
Evidence: with 8 cylinders refers to cylinders = 8; average price = avg(price) where cylinders = 8
SQL: SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8
Database: cars
Question: What is the maximum sweep volume of a car that costs less than $30000?
Evidence: cost less than $30000 refers to price < 30000; the maximum sweep volume = max(divide(displacement, cylinders)) where price < 30000
SQL: SELECT MAX(T1.displacement / T1.cylinders) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price < 30000
Database: cars
Question: How many cars in the database are originated from Europe?
Evidence: originated from Europe refers to country = 'Europe'
SQL: SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe'
Database: cars
Question: Show the origin country of Chevrolet Malibu.
Evidence: origin country refers to country; Chevrolet Malibu refers to car_name = 'chevrolet malibu'
SQL: 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'
Database: cars
Question: What are the miles per gallon of the most expensive car?
Evidence: miles per gallon refers to mpg; the most expensive refers to max(price)
SQL: SELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
Database: cars
Question: Tell the origin country of car no.382.
Evidence: origin country refers to country; car no.382 refers to ID = 382
SQL: SELECT DISTINCT T2.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382
Database: cars
Question: Which is the origin country of the $44274.40748 car?
Evidence: origin country refers to country; the $44274.40748 car refers to price = 44274.40748
SQL: 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 WHERE T1.price = 44274.40748
Database: cars
Question: How much is the Volkswagen Dasher with 14.1 mph acceleration?
Evidence: cost refers to price; Volkswagen Dasher refers to car_name = 'volkswagen dasher'; 14.1 mph acceleration refers to acceleration = 14.1
SQL: 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'
Database: cars
Question: Provide the engine displacement status of the $37443.85589 car.
Evidence: engine displacement status refers to displacement; the $37443.85589 car refers to price = 37443.85589
SQL: SELECT T1.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589'
Database: cars
Question: When was the $32650.65157 car introduced to the market? State the year.
Evidence: the $32650.65157 car refers to price = 32650.65157; year refers to model
SQL: SELECT T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157'
Database: cars
Question: Provide the price of the only Toyota Corona hardtop in the database.
Evidence: Toyota Corona hardtop refers to car_name = 'toyota corona hardtop'
SQL: SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop'
Database: cars
Question: How many cylinders does the cheapest car have?
Evidence: the cheapest car refers to min(price)
SQL: SELECT T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY price ASC LIMIT 1
Database: cars
Question: Which car in the database provides the best crash protection based on its weight? How much is it?
Evidence: the best crash protection refers to max(weight); cost refers to price
SQL: 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
Database: cars
Question: State the origin country of the fastest car in the database.
Evidence: origin country refers to country; the fastest refers to max(horsepower)
SQL: 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
Database: cars
Question: What is the percentage of Japanese cars in the database?
Evidence: Japanese car refers to country = 'Japan'; percentage = divide(count(ID where country = 'Japan'), count(ID)) * 100%
SQL: 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
Database: cars
Question: Calculate the swept volume of the $34538.97449 car.
Evidence: sweep volume = divide(displacement, cylinders); the $34538.97449 car refers to price = 34538.97449
SQL: SELECT T1.displacement / T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 34538.97449
Database: cars
Question: What is the name of the most expensive car?
Evidence: name of the car refers to car_name; the most expensive refers to max(price)
SQL: 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
Database: cars
Question: How many cars were released in the USA in 1981?
Evidence: in the USA refers to country = 'USA'; in 1981 refers to model_year = 1981
SQL: 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
Database: cars
Question: How much is the car with the highest sweep volume?
Evidence: cost refers to price; the highest sweep volume refers to max(divide(displacement, cylinders))
SQL: 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
Database: cars
Question: What is the fastest car made by Japan?
Evidence: the fastest refers to max(horsepower); made by Japan refers to country = 'Japan'; name of the car refers to car_name
SQL: 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
Database: cars
Question: How many times was Ford Maverick introduced to the market?
Evidence: Ford Maverick refers to car_name = 'ford maverick';
SQL: 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'
Database: cars
Question: Which country produced the most fuel-efficient car?
Evidence: the most fuel-efficient refers to max(mpg)
SQL: 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
Database: cars
Question: Which Dodge car is the cheapest?
Evidence: Dodge car refers to car_name LIKE 'dodge%'; the cheapest refers to min(price); name of the car refers to car_name
SQL: 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
Database: cars
Question: What is the name of the most expensive car that was produced by the USA?
Evidence: name of the car refers to car_name; the most expensive refers to max(price); produced by the USA refers to country = 'USA'
SQL: 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
Database: cars
Question: Among the cars with an engine displacement of no less than 400 cubic millimeter, how many cars cost at least 30,000?
Evidence: engine displacement of no less than 400 cubic millimeter refers to displacement > 400; cost at least 30,000 refers to price > 30000
SQL: SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.displacement > 400 AND T2.price > 30000
Database: cars
Question: Which year did Europe produce the most cars?
Evidence: year refers to model_year; Europe refers to country = 'Europe'; the most cars refers to max(model_year)
SQL: 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
Database: cars
Question: How much is the Peugeot 505s Turbo Diesel?
Evidence: cost refers to price; Peugeot 505s Turbo Diesel refers to car_name = 'peugeot 505s turbo diesel'
SQL: 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'
Database: cars
Question: What is the miles per square hour of the cheapest car produced by the USA?
Evidence: miles per square hour refers to acceleration; the cheapest refers to min(price); produced by the USA refers to country = 'USA'
SQL: 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
Database: cars
Question: 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.
Evidence: the highest number of cars refers to max(country); annual average number = divide(count(ID), count(model_year))
SQL: 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
Database: cars
Question: What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 30?
Evidence: 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
SQL: 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
Database: cars
Question: List the name of the cars with model year 1975.
Evidence: name of the car refers to car_name; model year 1975 refers to model_year = 1975
SQL: SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1975
Database: cars
Question: Calculate the average price of cars from Europe.
Evidence: from Europe refers to country = 'Europe'; average price = avg(price) where country = 'Europe'
SQL: 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'
Database: cars
Question: What is the price of the car ID 15?
SQL: SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.ID = 15
Database: cars
Question: How many of the cars from Japan weighed less than 3000?
Evidence: from Japan refers to country = 'Japan'; weighed less than 3000 refers to weight < 3000
SQL: 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
Database: cars
Question: Among the cars produced in year 1973, how many of the cars have horsepower less than 100?
Evidence: produced in year 1973 refers to model_year = 1973; have horsepower less than 100 refers to horsepower < 100
SQL: 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
Database: cars
Question: Provide the ID of cars from Japan worth greater than 35000 and have an acceleration of 14.
Evidence: from Japan refers to country = 'Japan'; worth greater than 35000 refers to price > 35000; have an acceleration of 14 refers to acceleration = 14
SQL: 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
Database: cars
Question: Give the model year of the heaviest car.
Evidence: the heaviest refers to max(weight)
SQL: 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
Database: cars
Question: What is the horsepower and model year of the car named Subaru Dl?
Evidence: the car named Subaru Dl refers to car_name = 'subaru dl'
SQL: 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'
Database: cars
Question: Among the cars originated from Japan, what is the name of the car with the highest price?
Evidence: from Japan refers to country = 'Japan'; name of the car refers to car_name; the highest price refers to max(price)
SQL: 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
Database: cars
Question: What are the names of the cars worth 20000?
Evidence: name of the car refers to car_name; worth 20000 refers to price = 20000
SQL: SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000
Database: cars
Question: How many cars worth greater than 40000 were from the USA?
Evidence: worth greater than 40000 refers to price > 40000; from the USA refers to country = 'USA'
SQL: 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
Database: cars
Question: Provide the price and country origin of the car named Ford Maverick.
Evidence: country origin refers to country; Ford Maverick refers to car_name = 'ford maverick'
SQL: 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'
Database: cars
Question: List the car's name with a price worth greater than 85% of the average price of all cars.
Evidence: 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)
SQL: 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 )
Database: cars
Question: Calculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976
Evidence: 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
SQL: 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
Database: cars
Question: Among the cars from Asia, list the IDs of cars that were introduced in 1979.
Evidence: from Asia refers to country = 'Japan'; introduced in 1979 refers to model_year = 1979
SQL: 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