problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: Who is the character that said "This is Illyria, lady."?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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.' |
Write SQL query to solve given problem: In Shakespeare's works between 1600 to 1610, how many of these have a character as a "Third Servingman"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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' |
Write SQL query to solve given problem: In the Venus and Adonis, what is the description of the last scene listed?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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 |
Write SQL query to solve given problem: In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by Viola?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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' |
Write SQL query to solve given problem: What is the character and work ID of the text "Fear not thou, man, thou shalt lose nothing here."?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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.' |
Write SQL query to solve given problem: What is the chapter description where the paragraph "What, wilt thou hear some music, my sweet love?" belongs?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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?' |
Write SQL query to solve given problem: List the scene numbers involving the character named Sir Toby Belch in the Twelfth Night.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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' |
Write SQL query to solve given problem: In Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named "Tybalt".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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' |
Write SQL query to solve given problem: List the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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 |
Write SQL query to solve given problem: Among the comedy works of Shakespeare, what is the percentage of his works with a character named "antonio"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | shakespeare | 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' |
Write SQL query to solve given problem: Among the cars with 8 cylinders, what is the name of the one that's the most expensive?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the cars over 3000lbs, how many of them cost less than $30000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the acceleration of the most expensive car?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.acceleration FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1 |
Write SQL query to solve given problem: How much US dollars does a Ford Torino cost?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford torino' |
Write SQL query to solve given problem: What was the origin country of the car model ford torino produced in 1970?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the car models introduced in the market in 1970, how many of them have the USA as their origin country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Please list the names of all the car models whose origin country is the USA.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Please list the names of the top 3 most expensive cars.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Please list all the years in which the car model Chevrolet Impala was introduced in the market.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Please list the weights of all the cars with the price over $40000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.weight FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000 |
Write SQL query to solve given problem: What is the maximum acceleration of a car with price over $40000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT MAX(T1.acceleration) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000 |
Write SQL query to solve given problem: What is the average price of cars with 8 cylinders?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8 |
Write SQL query to solve given problem: What is the maximum sweep volume of a car that costs less than $30000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT MAX(T1.displacement / T1.cylinders) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price < 30000 |
Write SQL query to solve given problem: How many cars in the database are originated from Europe?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe' |
Write SQL query to solve given problem: Show the origin country of Chevrolet Malibu.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: What are the miles per gallon of the most expensive car?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1 |
Write SQL query to solve given problem: Tell the origin country of car no.382.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT DISTINCT T2.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382 |
Write SQL query to solve given problem: Which is the origin country of the $44274.40748 car?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How much is the Volkswagen Dasher with 14.1 mph acceleration?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Provide the engine displacement status of the $37443.85589 car.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589' |
Write SQL query to solve given problem: When was the $32650.65157 car introduced to the market? State the year.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157' |
Write SQL query to solve given problem: Provide the price of the only Toyota Corona hardtop in the database.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop' |
Write SQL query to solve given problem: How many cylinders does the cheapest car have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY price ASC LIMIT 1 |
Write SQL query to solve given problem: Which car in the database provides the best crash protection based on its weight? How much is it?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: State the origin country of the fastest car in the database.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the percentage of Japanese cars in the database?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Calculate the swept volume of the $34538.97449 car.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.displacement / T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 34538.97449 |
Write SQL query to solve given problem: What is the name of the most expensive car?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How many cars were released in the USA in 1981?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How much is the car with the highest sweep volume?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the fastest car made by Japan?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How many times was Ford Maverick introduced to the market?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Which country produced the most fuel-efficient car?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Which Dodge car is the cheapest?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the name of the most expensive car that was produced by the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the cars with an engine displacement of no less than 400 cubic millimeter, how many cars cost at least 30,000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.displacement > 400 AND T2.price > 30000 |
Write SQL query to solve given problem: Which year did Europe produce the most cars?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How much is the Peugeot 505s Turbo Diesel?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: What is the miles per square hour of the cheapest car produced by the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: 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.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 30?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: List the name of the cars with model year 1975.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1975 |
Write SQL query to solve given problem: Calculate the average price of cars from Europe.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: What is the price of the car ID 15?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.ID = 15 |
Write SQL query to solve given problem: How many of the cars from Japan weighed less than 3000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the cars produced in year 1973, how many of the cars have horsepower less than 100?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Provide the ID of cars from Japan worth greater than 35000 and have an acceleration of 14.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Give the model year of the heaviest car.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the horsepower and model year of the car named Subaru Dl?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Among the cars originated from Japan, what is the name of the car with the highest price?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What are the names of the cars worth 20000?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000 |
Write SQL query to solve given problem: How many cars worth greater than 40000 were from the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Provide the price and country origin of the car named Ford Maverick.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: List the car's name with a price worth greater than 85% of the average price of all cars.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 ) |
Write SQL query to solve given problem: Calculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the cars from Asia, list the IDs of cars that were introduced in 1979.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Which country produced the car with the lowest mileage per gallon?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Provide the name, model, sweep volume, and introduced year of the car with the best crash protection.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the cars introduced in 1977, provide the names and the horse powers of cars from Europe.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Provide the name and model of the car with the highest price.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the price of a Chevrolet Bel Air?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet bel air' |
Write SQL query to solve given problem: What is the average price per car produced in Japan?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Which country produced the car with the lowest price?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Among the cars produced in 1975, provide IDs, names, and producing countries of the cars with the maximum number of cylinders.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Which car is the cheapest? Provide its acceleration, number of cylinders, and producing year.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: List the names and prices of the cars with model 82 and mileage per gallon of greater than 30.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How many models of Ford Maverick were produced?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Calculate the percentage of cars that belong to the USA.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Calculate the average production rate per year from 1971 to 1980. Among them, name the cars with a weight of fewer than 1800 lbs.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT CAST(COUNT(T1.ID) AS REAL) / 9 FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 UNION ALL SELECT DISTINCT T2.car_name FROM production AS T1 INNER JOIN data AS T2 ON T2.ID = T1.ID WHERE T1.model_year BETWEEN 1971 AND 1980 AND T2.weight < 1800 |
Write SQL query to solve given problem: What is the average price of model 70 cars?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.model = 70 |
Write SQL query to solve given problem: What is the price of Chevrolet Vega 2300?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'chevrolet vega 2300' |
Write SQL query to solve given problem: Which country does Chevy C20 come from?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: List the price of Ford cars from model 1970 to 1980.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Which is the most fuel efficient car in 1975?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Which car consumes fuel the most and has the highest price?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How many American cars have an acceleration time of less than 12 seconds?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How many Japanese cars weigh more than 2000 lbs?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: List the name of the most expensive car.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What years did the Buick Skylark 320 get in production?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: Which country produced the most expensive car in 1970?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: How many cars with horsepower greater than 200 were produced in 1975?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: Calculate the percentage of American cars among all cars.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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 |
Write SQL query to solve given problem: What is the average weight of Japanese cars with 4 cylinders that were produced from 1975 to 1980?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | cars | 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' |
Write SQL query to solve given problem: What is the total amount of donations in 2012.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | donor | SELECT SUM(donation_total) FROM donations WHERE donation_timestamp LIKE '2012%' |
Write SQL query to solve given problem: When was the highest amount of donated? How much was the amount?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | donor | SELECT donation_timestamp, donation_total FROM donations WHERE donation_total = ( SELECT donation_total FROM donations ORDER BY donation_total DESC LIMIT 1 ) |
Write SQL query to solve given problem: Calculate the total amount of donations made in 2011 for an honoree with payment via campaign page.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | donor | SELECT SUM(donation_total) FROM donations WHERE donation_timestamp LIKE '2011%' AND via_giving_page = 't' AND for_honoree = 't' |
Write SQL query to solve given problem: For each donation not from a teacher, state the donor account id and calculate the percentage of donation given for optional support.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | donor | SELECT donor_acctid, donation_optional_support / donation_total FROM donations WHERE is_teacher_acct = 'f' |
Write SQL query to solve given problem: Name all the project titles whereby project materials are intended mainly for literary.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | donor | SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject = 'Literacy' |
Write SQL query to solve given problem: Name the project titles meant for school whereby 65% of the students are on reduced lunch.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | donor | SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.poverty_level LIKE 'highest%' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.