context
stringlengths 11
9.12k
| question
stringlengths 0
1.06k
| SQL
stringlengths 2
4.44k
| source
stringclasses 28
values |
|---|---|---|---|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Calculate average scene per act in Antony and Cleopatra.
|
SELECT CAST(SUM(T2.Scene) AS REAL) / COUNT(T2.act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Antony and Cleopatra'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Calculate the percentage of paragraphs in all chapters of "All's Well That Ends Well".
|
SELECT CAST(SUM(IIF(T1.Title = 'All''s Well That Ends Well', 1, 0)) AS REAL) * 100 / COUNT(T3.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
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
How many "all" character names have the "all" abbreviation?
|
SELECT COUNT(id) FROM characters WHERE Abbrev = 'All'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Please name any three comedic works.
|
SELECT Title FROM works WHERE GenreType = 'comedy' LIMIT 3
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
From 1593 onwards, what is the difference between the number of comedy works and history works?
|
SELECT SUM(IIF(GenreType = 'Comedy', 1, 0)) - SUM(IIF(GenreType = 'History', 1, 0)) FROM works WHERE Date > 1593
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Please name the latest historical work.
|
SELECT LongTitle FROM works WHERE GenreType = 'History' ORDER BY Date DESC LIMIT 1
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What are the work numbers that are related to King Henry?
|
SELECT id FROM works WHERE Title LIKE '%Henry%'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What are the character names for a senator of Venice?
|
SELECT CharName FROM characters WHERE Description = 'a senator of Venice'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the name of the character that can be found in paragraph 8 of chapter 18820?
|
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 8 AND T2.chapter_id = 18820
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the description of chapter 18704, where there is a character called Orsino?
|
SELECT DISTINCT T3.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id INNER JOIN chapters AS T3 ON T2.chapter_id = T3.id WHERE T1.CharName = 'Orsino' AND T3.ID = 18704
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
How many scenes can be found in "Twelfth Night, Or What You Will"?
|
SELECT COUNT(T2.Scene) AS cnt FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.LongTitle = 'Cymbeline, King of Britain'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Please list all of the character descriptions in paragraph 20.
|
SELECT T1.Description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 20
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
How many chapters have the name Gratiano as a character for "friend to Antonio and Bassiano"?
|
SELECT COUNT(DISTINCT T2.chapter_id) FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Gratiano' AND T1.Description = 'friend to Antonio and Bassiano'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the description of chapter 18706 in "All's Well That Ends Well"?
|
SELECT T2.Description FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T2.id = 18706 AND T1.Title = 'All''s Well That Ends Well'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What are the character names in paragraph 3?
|
SELECT DISTINCT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.ParagraphNum = 3
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Please list all of the paragraphs that have the character name Aedile.
|
SELECT T2.ParagraphNum FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Aedile'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Please list any two character names in chapter 18708.
|
SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.chapter_id = 18708 LIMIT 2
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
How many acts can be found in the comedy "Two Gentlemen of Verona"?
|
SELECT COUNT(T1.ACT) FROM chapters AS T1 LEFT JOIN works AS T2 ON T1.work_id = T2.id WHERE T2.GenreType = 'Comedy' AND T2.Title = 'Two Gentlemen of Verona'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the percentage of historical works that have not fewer than five scenes in the 1500s?
|
SELECT CAST(( SELECT COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.GenreType = 'History' AND T1.DATE BETWEEN 1500 AND 1599 GROUP BY T1.id HAVING COUNT(T2.Scene) >= 5 ) AS REAL) * 100 / COUNT(id) FROM works WHERE GenreType = 'History' AND DATE BETWEEN 1500 AND 1599
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the percentage of act number 5 in Titus Andronicus?
|
SELECT CAST(SUM(IIF(T2.act = 5, 1, 0)) AS REAL) * 100 / COUNT(T2.act) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Titus Andronicus'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
How many of the works of Shakespeare are Tragedy?
|
SELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Among the works of Shakespeare, how many of them have the word "Henry" on its title?
|
SELECT COUNT(id) FROM works WHERE Title LIKE '%Henry%'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Give the character's ID of the character that said the paragraph "O my poor brother! and so perchance may he be."
|
SELECT character_id FROM paragraphs WHERE PlainText = 'O my poor brother! and so perchance may he be.'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
List the paragraph number and paragraphs said by the character named "Sir Andrew Aguecheek".
|
SELECT T2.ParagraphNum, T2.id FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T1.CharName = 'Sir Andrew Aguecheek'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Give the title and the characters name of the most recent work of Shakespeare.
|
SELECT T1.Title, T4.CharName 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 ORDER BY T1.Date DESC LIMIT 1
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Among paragraphs with paragraph number between 1900 to 1950, list the texts said by a character described as a sea captain, friend to Sebatian.
|
SELECT T1.description FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'a sea captain, friend to Sebastian' AND T2.ParagraphNum BETWEEN 1500 AND 1950
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the long title of the Shakespeare's work with Act 4 Scene 5 described as "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.'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Who is the character that said "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.'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
In Shakespeare's works between 1600 to 1610, how many of these have a character as a "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'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
In the Venus and Adonis, what is the description of the last scene listed?
|
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
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
In Act 1 Scene 2 of the Twelfth Night, what is the total number of of lines said by 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'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the character and work ID of the text "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.'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
What is the chapter description where the paragraph "What, wilt thou hear some music, my sweet love?" belongs?
|
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?'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
List the scene numbers involving the character named Sir Toby Belch in the 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'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
In Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named "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'
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
List the chapter ID of the works with a year greater than the 89% of average year of all listed works of 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
|
bird
|
CREATE TABLE shakespeare (id integer, Act integer, Scene integer, Description text, work_id integer, id integer, CharName text, Abbrev text, Description text, id integer, ParagraphNum integer, PlainText text, character_id integer, chapter_id integer, id integer, Title text, LongTitle text, Date integer, GenreType text)
|
Among the comedy works of Shakespeare, what is the percentage of his works with a character named "antonio"?
|
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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars with 8 cylinders, what is the name of the one that's the most expensive?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars over 3000lbs, how many of them cost less than $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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the acceleration of the most expensive car?
|
SELECT T1.acceleration FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How much US dollars does a Ford Torino cost?
|
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford torino'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What was the origin country of the car model ford torino produced in 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the car models introduced in the market in 1970, how many of them have the USA as their origin country?
|
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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Please list the names of all the car models whose origin country is the 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Please list the names of the top 3 most expensive 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Please list all the years in which the car model Chevrolet Impala was introduced in the market.
|
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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
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?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Please list the weights of all the cars with the price over $40000.
|
SELECT T1.weight FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the maximum acceleration of a car with price over $40000?
|
SELECT MAX(T1.acceleration) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price > 40000
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the average price of cars with 8 cylinders?
|
SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the maximum sweep volume of a car that costs less than $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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How many cars in the database are originated from Europe?
|
SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'Europe'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Show the origin country of 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What are the miles per gallon of the most expensive car?
|
SELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Tell the origin country of car no.382.
|
SELECT DISTINCT T2.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Which is the origin country of the $44274.40748 car?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How much is the Volkswagen Dasher with 14.1 mph acceleration?
|
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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Provide the engine displacement status of the $37443.85589 car.
|
SELECT T1.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
When was the $32650.65157 car introduced to the market? State the year.
|
SELECT T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Provide the price of the only Toyota Corona hardtop in the database.
|
SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How many cylinders does the cheapest car have?
|
SELECT T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY price ASC LIMIT 1
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Which car in the database provides the best crash protection based on its weight? How much is it?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
State the origin country of the fastest car in the database.
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the percentage of Japanese cars in the database?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Calculate the swept volume of the $34538.97449 car.
|
SELECT T1.displacement / T1.cylinders FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 34538.97449
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the name of the most expensive car?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How many cars were released in the USA in 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How much is the car with the highest sweep volume?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the fastest car made by Japan?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How many times was Ford Maverick introduced to the market?
|
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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Which country produced the most fuel-efficient car?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Which Dodge car is the cheapest?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the name of the most expensive car that was produced by the 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars with an engine displacement of no less than 400 cubic millimeter, how many cars cost at least 30,000?
|
SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.displacement > 400 AND T2.price > 30000
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Which year did Europe produce the most 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How much is the 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the miles per square hour of the cheapest car produced by the 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
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.
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the percentage of cars that was produced by Japan among those that have a sweep volume of no less than 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
List the name of the cars with 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Calculate the average price of cars from 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How many of the cars from Japan weighed less than 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars produced in year 1973, how many of the cars have horsepower less than 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Provide the ID of cars from Japan worth greater than 35000 and have an acceleration of 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Give the model year of the heaviest car.
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the horsepower and model year of the car named 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars originated from Japan, what is the name of the car with the highest 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What are the names of the cars worth 20000?
|
SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
How many cars worth greater than 40000 were from the 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Provide the price and country origin of the car named 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
List the car's name with a price worth greater than 85% of the average price of all 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 )
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Calculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars from Asia, list the IDs of cars that were introduced in 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Which country produced the car with the lowest mileage per gallon?
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Provide the name, model, sweep volume, and introduced year of the car with the best crash protection.
|
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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Among the cars introduced in 1977, provide the names and the horse powers of cars from 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
Provide the name and model of the car with the highest 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
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the price of a 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'
|
bird
|
CREATE TABLE cars (origin integer, country text, ID integer, price real, ID integer, mpg real, cylinders integer, displacement real, horsepower integer, weight integer, acceleration real, model integer, car_name text, ID integer, model_year integer, country integer)
|
What is the average price per car produced in 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'
|
bird
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.