db_id stringclasses 66
values | question stringlengths 24 325 | evidence stringlengths 1 673 ⌀ | gold_query stringlengths 23 804 | db_schema stringclasses 66
values |
|---|---|---|---|---|
synthea | For how many times had Elly Koss have her Systolic Blood Pressure observed? | Systolic Blood Pressure refers to DESCRIPTION = 'Systolic Blood Pressure'; | SELECT COUNT(T2.description) FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE D... |
synthea | Please list all the medication that are prescribed to Elly Koss. | medication that are prescribed refers to DESCRIPTION from medications; | SELECT DISTINCT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE D... |
synthea | For how long was Elly Koss required to take Acetaminophen? | SUM(MULTIPLY(365, SUBTRACT(strftime('%Y', STOP), strftime('%Y', START))), MULTIPLY(30, SUBTRACT(strftime('%m', STOP), strftime('%m', START))), SUBTRACT(strftime('%d', STOP), strftime('%d', START))) where DESCRIPTION like 'Acetaminophen%'; | SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE D... |
law_episode | Who is the person who appeared the most in the series? Calculate in percentage how many times he or she appeared. | who refers to name; appear the most refers to max(count(person_id)); percentage = divide(count(person_id where max(count(person_id))), count(person_id)) * 100% | SELECT T2.person_id, CAST(COUNT(T2.person_id) AS REAL) * 100 / ( SELECT COUNT(T2.person_id) AS num FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id ) AS per FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id GROUP BY T2.person_id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
synthea | Please give the full names of all the patients who had been prescribed with Acetaminophen. | full name refers to first, last; prescribed with Acetaminophen refer to DESCRIPTION like 'Acetaminophen%' from medications; | SELECT DISTINCT T1.first, T1.last FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.description LIKE 'Acetaminophen%' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE D... |
law_episode | What is the title of the episode with the most nominations? | the most nominations refers to max(count(episode_id where result = 'Nominee')) | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' GROUP BY T2.episode_id ORDER BY COUNT(T1.result) DESC LIMIT 1 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What are the names of all the people who worked on episode 19 of season 9? | null | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 19 AND T1.season = 9 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | Among the episodes that were aired in 1998, how many won an International Monitor Awards? | aired in 1998 refers to air_date like '1998%'; won refers to result = 'Winner'; International Monitor Awards refers to organization = 'International Monitor Awards' | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE strftime('%Y', T1.air_date) = '1998' AND T2.organization = 'International Monitor Awards' AND T2.result = 'Winner' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What was the rating of the episodes that Jace Alexander worked on? | null | SELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Jace Alexander' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What role was Julia Roberts nominated for? | nominated refers to result = 'Nominee' | SELECT T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Nominee' AND T1.name = 'Julia Roberts' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | In which region were the assistant location managers born? | region refers to birth_region; assistant location manager refers to role = 'assistant location manager' | SELECT T2.birth_region FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'president of NBC West Coast' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | How many episodes are there in the 9th season of Law and Order? Calculate the average number of casts per season of the said series. | the 9th season refers to season = 9; Law and Order refers to series = 'Law and Order'; cast refers to category = 'Cast'; average number of casts per season = divide(count(person_id), count(episode_id)) | SELECT SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.episode_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T2.series = 'Law and Order' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | In which episodes was Anthony Azzara not credited? | which episode refers to title; not credited refers to credited = '' | SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'false' AND T3.name = 'Anthony Azzara' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | In what year did the episodes titled DWB get an award? | titled DWB refers to title = 'DWB'; get an award refers to result = 'Winner' | SELECT DISTINCT T1.year FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.title = 'DWB' AND T1.result = 'Winner' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | How many times did the episode titled "Agony" win an award? | titled "Agony" refers to title = 'Agony'; win an award refers to result = 'Winner' | SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
movie_platform | When was the first movie released and who directed it? | first movie refers to oldest movie_release_year; | SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1 | CREATE TABLE ratings_users
(
user_cover_image_url TEXT, --
user_avatar_image_url TEXT, --
rating_date_utc TEXT, --
user_trialist INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
user_has_payment_method INTEGER, -- Example Values: `0`, `1` | Value S... |
law_episode | How many votes did the episode titled Juvenile get? | the episode titled Juvenile refers to title = 'Juvenile' | SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Juvenile' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What is the name of the actors born in the USA? | born in the USA refers to birth_country = 'USA' | SELECT name FROM Person WHERE birth_country = 'USA' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What is the title of the 3 worst rated episodes? | worst rated refers to min(rating) | SELECT title FROM Episode ORDER BY rating LIMIT 3 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What is the title of the episodes that were least enjoyed? | least enjoyed refers to stars = 1 | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 1 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | How many episodes have not won any Law & Order series awards? | have not won any award refers to Result = 'Nominee' | SELECT COUNT(award_id) FROM Award WHERE Result = 'Nominee' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What is the title of the episode with the highest number of keywords? | the highest number of keywords refers to max(count(keyword)) | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(T2.keyword) DESC LIMIT 1 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | How many awards did the "Agony" win? | the "Agony" refers to title = 'Agony'; win refers to result = 'Winner' | SELECT COUNT(T2.award) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What is the full place of birth of Rene Chenevert Balcer? | full place of birth refers to birth_place, birth_region; Rene Chenevert Balcer refers to birth_name = 'Rene Chenevert Balcer' | SELECT birth_place, birth_region FROM Person WHERE birth_name = 'Rene Chenevert Balcer' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
synthea | Why did Elly Koss need to take Acetaminophen? | why need to take Acetaminophen refers to REASONDESCRIPTION where DESCRIPTION like 'Acetaminophen%' from medications; | SELECT T2.REASONDESCRIPTION FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description LIKE 'Acetaminophen%' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE D... |
synthea | What medication did Elly Koss take when she had Streptococcal sore throat? | medication refers to DESCRIPTION from medications; Streptococcal sore throat refers to REASONDESCRIPTION like 'Streptococcal sore throat%'; | SELECT T2.description FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.reasondescription = 'Streptococcal sore throat (disorder)' | CREATE TABLE immunizations
(
foreign key (ENCOUNTER) references encounters(ID),
CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0
foreign key (PATIENT) references patients(patient),
ENCOUNTER TEXT, --
PATIENT TEXT, --
DATE D... |
law_episode | What role does the tallest person play? | the tallest refers to max(height_meters) | SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id ORDER BY T1.height_meters DESC LIMIT 1 | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | How many stars did the episodes in which Donna Villella worked? | null | SELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Donna Villella' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
law_episode | What are the names of the two people who won an award for their role as directors? | won an award refers to result = 'Winner'; role as director refers to role = 'director' | SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Winner' AND T2.role = 'director' | CREATE TABLE Award
(
result TEXT, -- Example Values: `Winner`, `Nominee` | Value Statics: Total count 22 - Distinct count 2 - Null count 0
person_id TEXT, -- Example Values: `nm0937725`, `nm0792309`, `nm0049569`, `nm0371065`, `nm0288886` | Value Statics: Total count 22 - Distinct count 13 - Null count 0
organi... |
language_corpus | Please list the titles of all the Wikipedia pages on the Catalan language with 10 different words. | lid = 1 means it's Catalan language; 10 different words refers to words = 10; titles refers to title | SELECT title FROM pages WHERE lid = 1 AND words = 10 LIMIT 10 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | How many times greater is the appearances of the biword pair "a base" than "a decimal"? | a, base AND decimal are words; wid is the ID of word; w1st is the first word of a biword pair; w2nd is the second word of a biword pair; appearances refers to biwords.occurrences; biword pair 'a base' refers to word = 'a' as w1st AND word = 'base' as w2nd; biword pair 'a decimal' refers to word = 'a' as w1st AND word =... | SELECT CAST(occurrences AS REAL) / ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'a' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'decimal' ) ) FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'a' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'base' ) | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | How many Wikipedia pages with over 4000 different words are there on the Catalan language? | lid = 1 means it's Catalan language; over 4000 different words means words > 4000; Wikipedia pages refers to pid | SELECT COUNT(lid) FROM pages WHERE lid = 1 AND words > 4000 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | Please list the titles of the top 3 Wikipedia pages with the most different words on the Catalan language. | lid = 1 means it's Catalan language; with most different words refers to MAX(words) | SELECT title FROM pages WHERE lid = 1 ORDER BY words DESC LIMIT 3 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | For the word "grec", what is the percentage of the appearances in the "Art" Wikipedia page have among all the appearances? | grec refers to word = 'grec'; Art refers to title = 'Art'; percentage is DIVIDE(occurrences(grec), occurences(Art))*100 | SELECT CAST(SUM(CASE WHEN T3.title = 'Art' THEN T2.occurrences ELSE 0 END) AS REAL) * 100 / SUM(T2.occurrences) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | Please list the page IDs of all the Wikipedia pages that have the word "nombre" appeared on it. | nombre refers to word = 'nombre'; page IDs refers to pid | SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'nombre' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | What is the word that occurs the most in the Catalan language? | MAX(occurrences) | SELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words ) | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | Among the wikipedia pages on Catalan with more than 300 different words, how many of them have a revision ID of over 28330000? | lid = 1 means it's Catalan language; more than 300 different words refers to words > 300; revision ID of over 28330000 refers to revision > 28330000 | SELECT COUNT(lid) FROM pages WHERE lid = 1 AND words > 300 AND revision > 28330000 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | How many biwords pairs are there whose second word is "grec"? | grec refers to word = 'grec'; wid where word = 'grec' AS w2nd | SELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T1.word = 'grec' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | What is the revision ID for the page on Catalan titled "Arqueologia"? | lid = 1 means it's Catalan language; Arqueologia refers to title = 'Arqueologia'; revision ID refers to revision | SELECT revision FROM pages WHERE lid = 1 AND title = 'Arqueologia' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | Among the biwords pairs with "àbac" as its first word, how many of them have an occurrence of over 10? | àbac refers to word = 'àbac'; as first word refers to w1st; occurrence of over 10 refers to occurrences > 10 | SELECT COUNT(T2.w2nd) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T1.word = 'àbac' AND T2.occurrences > 10 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | How many Wikipedia pages on Catalan are there with the word "nombre" appearing for more than 5 times? | nombre refers to word = 'nombre'; appear for more than 5 times refers to pages_words.occurrences > 5 | SELECT COUNT(T2.pid) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'nombre' AND T2.occurrences > 5 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
airline | Among the flights on 2018/8/1, how many of them departed from an airport in New York? | on 2018/8/1 refers to FL_DATE = '2018/8/1'; departed from an airport in New York refers to ORIGIN = 'JFK'; | SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'JFK' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
language_corpus | What is the title of the page on which the word "grec" has an occurrence of 52 times. | occurrence of 52 times refers to pages_words.occurrences = 52; grec refers to word = 'grec' | SELECT T3.title FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.pid WHERE T1.word = 'grec' AND T2.occurrences = 52 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
airline | How many flights were there on 2018/8/1? | on 2018/8/1 refers to FL_DATE = '2018/8/1'; | SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Please list the dates of the flights that were cancelled due to the most serious reason. | dates of the flights refers to FL_DATE; cancelled refers to CANCELLED = 1; most serious reason refers to CANCELLATION_CODE = 'A'; | SELECT FL_DATE FROM Airlines WHERE CANCELLATION_CODE = 'A' GROUP BY FL_DATE | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
language_corpus | What is the average occurrence of the word "grec" on each Wikipedia page that has this word? | grec refers to word = 'grec'; AVG(occurrences where word = 'grec') | SELECT CAST(SUM(T2.occurrences) AS REAL) / COUNT(T1.wid) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'grec' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
airline | Among the flights on 2018/8/1, how many of them were scheduled to depart from John F. Kennedy International in New York? | on 2018/8/1 refers to FL_DATE = '2018/8/1'; depart from refers to ORIGIN; John F. Kennedy International in New York refers to Description = 'New York, NY: John F. Kennedy International'; | SELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Please list the destination cities of all the flights that were cancelled on 2018/8/1. | destination cities refers to DEST; cancelled refers to CANCELLED = 1; on 2018/8/1 refers to FL_DATE = '2018/8/1'; | SELECT DEST FROM Airlines WHERE FL_DATE = '2018/8/1' AND CANCELLED = 1 GROUP BY DEST | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Please list the departure airports of the flights on 2018/8/1 that were delayed. | departure airports refers ORIGIN; on 2018/8/1 refers to FL_DATE = '2018/8/1'; delayed refers to DEP_DELAY > 0; | SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T2.DEP_DELAY > 0 GROUP BY T1.Description | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Among the flights departing from John F. Kennedy International, how many of them arrived earlier than scheduled? | departing from refers to ORIGIN; John F. Kennedy International refers to Description = 'New York, NY: John F. Kennedy International'; arrived earlier than scheduled refers to ARR_DELAY < 0; | SELECT SUM(CASE WHEN T2.ARR_DELAY < 0 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'New York, NY: John F. Kennedy International' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Among all the flights scheduled to depart from John F. Kennedy International on 2018/8/1, when was the earliest one scheduled to depart? | depart from refers to ORIGIN; John F. Kennedy International refers to Description = 'New York, NY: John F. Kennedy International'; on 2018/8/1 refers to FL_DATE = '2018/8/1'; earliest one scheduled to depart refers to MIN(DEP_TIME); | SELECT T2.DEP_TIME FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International' AND T2.DEP_TIME IS NOT NULL ORDER BY T2.DEP_TIME ASC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | For the flight from ATL to PHL on 2018/8/1 that scheduled local departure time as "2040", which air carrier does this flight belong to? | flight from ATL refers to ORIGIN = 'ATL'; flight to PHL refers to DEST = 'PHL'; on 2018/8/1 refers to FL_DATE = '2018/8/1'; local departure time refers to CRS_DEP_TIME; CRS_DEP_TIME = '2040'; | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/1' AND T1.ORIGIN = 'ATL' AND T1.DEST = 'PHL' AND T1.CRS_DEP_TIME = '2040' GROUP BY T2.Description | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | For the flight on 2018/8/1 that was delayed for the longest time, which was the destination airport of this flight? | on 2018/8/1 refers to FL_DATE = '2018/8/1'; delayed for the longest time refers to MAX(DEP_DELAY); destination airport refers to DEST; | SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/1' ORDER BY T2.DEP_DELAY DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights were there from San Diego International airport to Los Angeles International airport in the August of 2018? | flights from refers to ORIGIN; San Diego International airport refers to Description = 'San Diego, CA: San Diego International'; flights to refers to DEST; Los Angeles International airport refers to Description = 'Los Angeles, CA: Los Angeles International'; in the August of 2018 refers to FL_DATE like '2018/8%'; | SELECT COUNT(FL_DATE) FROM Airlines WHERE FL_DATE LIKE '2018/8%' AND ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'San Diego, CA: San Diego International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T... | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Provide the name of the airport which landed the most number of flights on 2018/8/15. | name of the airport refers to Description; airport that landed the most number of flights refers to MAX(COUNT(DEST)); on 2018/8/15 refers to FL_DATE = '2018/8/15'; | SELECT T1.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' ORDER BY T2.DEST DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the percentage of flights which landed at Pittsburgh were faster than scheduled? | percentage = MULTIPLY(DIVIDE(SUM(ACTUAL_ELAPSED_TIME < T2.CRS_ELAPSED_TIME), COUNT(Code)), 100); landed at refers to DEST; Pittsburgh refers to Description which contains 'Pittsburgh'; faster than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME; | SELECT CAST(SUM(CASE WHEN T1.ACTUAL_ELAPSED_TIME < T1.CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.DEST WHERE T2.Description LIKE '%Pittsburgh%' AND T1.CRS_ELAPSED_TIME IS NOT NULL AND T1.ACTUAL_ELAPSED_TIME IS NOT NULL | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Tell the number of flights that landed at Lake Charles Regional Airport on 2018/8/15. | landed at refers to DEST; Lake Charles Regional Airport refers to Description = 'Lake Charles, LA: Lake Charles Regional'; on 2018/8/15 refers to FL_DATE = '2018/8/15'; | SELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/15' AND T1.Description = 'Lake Charles, LA: Lake Charles Regional' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights departed on time on 8/1/2018? | departed on time refers to DEP_DELAY < = 0; on 8/1/2018 refers to FL_DATE = '2018/8/1'; | SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND DEP_DELAY <= 0 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the percentage of flights from Los Angeles International airport that were cancelled due to a type C cancellation code? | percentage = MULTIPLY(DIVIDE(SUM(CANCELLATION_CODE = 'C'), COUNT(Code)), 100); flights from refers to ORIGIN; Los Angeles International airport refers to Description = 'Los Angeles, CA: Los Angeles International'; cancelled refers to Cancelled = 1; cancelled due to a type C cancellation code refers to CANCELLATION_CODE... | SELECT CAST(SUM(CASE WHEN T2.CANCELLATION_CODE = 'C' THEN 1.0 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/15' AND T2.CANCELLATION_CODE IS NOT NULL AND T1.Description = 'Los Angeles, CA: Los Angeles International' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How long was the longest minute delay caused by a weather problem in airport id 12264? | longest minute delay caused by a weather problem refers to MAX(WEATHER_DELAY); airport id refers to ORIGIN_AIRPORT_ID; ORIGIN_AIRPORT_ID = 12264; | SELECT WEATHER_DELAY FROM Airlines WHERE ORIGIN_AIRPORT_ID = 12264 ORDER BY WEATHER_DELAY DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the description of the airline code 19049? | null | SELECT Description FROM `Air Carriers` WHERE Code = 19049 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the origin airport id that recorded the longest delay due to a late aircraft? | origin airport id refers to ORIGIN_AIRPORT_ID; longest delay due to a late aircraft refers to MAX(LATE_AIRCRAFT_DELAY); | SELECT ORIGIN_AIRPORT_ID FROM Airlines ORDER BY LATE_AIRCRAFT_DELAY DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What are the codes of the airport found in Ankara, Turkey? | airport found in Ankara, Turkey refers to Description like '%Ankara, Turkey%'; | SELECT Code FROM Airports WHERE Description LIKE '%Ankara, Turkey%' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many planes does Southwest Airlines Co. have? | planes refers to TAIL_NUM; Southwest Airlines Co. refers to Description = 'Southwest Airlines Co.: WN'; | SELECT COUNT(T3.TAIL_NUM) FROM ( SELECT T1.TAIL_NUM FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T2.Description = 'Southwest Airlines Co.: WN' GROUP BY T1.TAIL_NUM ) T3 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the IATA code of the Anita Bay Airport in Anita Bay, Alaska? | IATA code refers to Code; Anita Bay Airport in Anita Bay, Alaska refers to Description = 'Anita Bay, AK: Anita Bay Airport'; | SELECT Code FROM Airports WHERE Description = 'Anita Bay, AK: Anita Bay Airport' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | List the tail numbers of all the aircraft that arrived on time at Meadows Field airport in August of 2018? | tail number refers to TAIL_NUM; arrived on time refers to ARR_DELAY < = 0; Meadows Field airport refers to Description = 'Bakersfield, CA: Meadows Field'; in August of 2018 refers to FL_DATE like '2018/8%'; | SELECT T2.TAIL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Bakersfield, CA: Meadows Field' AND T2.DEST = 'BFL' AND T2.ARR_DELAY <= 0 GROUP BY T2.TAIL_NUM | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights depart to Hartsfield-Jackson Atlanta International from Chicago O'Hare International? | depart to refers to DEST; Hartsfield-Jackson Atlanta International refers to Description = 'Atlanta, GA: Hartsfield-Jackson Atlanta International'; depart from refers to ORIGIN; Chicago O'Hare International refes to Description = 'Chicago, IL: Chicago O'Hare International'; | SELECT COUNT(FL_DATE) FROM Airlines WHERE ORIGIN = ( SELECT T2.ORIGIN FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'Chicago, IL: Chicago O''Hare International' ) AND DEST = ( SELECT T4.DEST FROM Airports AS T3 INNER JOIN Airlines AS T4 ON T3.Code = T4.DEST WHERE T3.Descrip... | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What are the names of the top 5 airlines with the highest number of aircraft? | names of the airlines refers to Description; highest number of aircraft refers to MAX(COUNT(TAIL_NUM)); | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code GROUP BY T2.Description ORDER BY T1.TAIL_NUM DESC LIMIT 5 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | On August 2018, which day had the highest number of cancelled flights due to the most serious reasons in Dallas/Fort Worth International? | On August 2018 refers to FL_DATE like '2018/8%'; day with the highest number of cancelled flights refers to MAX(COUNT(FL_DATE WHERE CANCELLED = 1)); cancelled due to the most serious reasons refers to CANCELLATION_CODE = 'A'; in Dallas/Fort Worth International refers to Description = 'Dallas/Fort Worth, TX: Dallas/Fort... | SELECT T2.FL_DATE FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE LIKE '2018/8%' AND T1.Description = 'Dallas/Fort Worth, TX: Dallas/Fort Worth International' AND T2.ORIGIN = 'DFW' AND T2.CANCELLED = 1 AND T2.CANCELLATION_CODE = 'A' GROUP BY T2.FL_DATE ORDER BY COUNT(T2.FL_DATE) DE... | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Give the name of the airline to which tail number N202NN belongs to. | name of the airline refers to Description; tail number refers to TAIL_NUM; TAIL_NUM = 'N202NN'; | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N202NN' GROUP BY T2.Description | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Among the airports whose destination is Logan International, what is the airline id of the carrier operator with the highest delay in minutes due to security? | destination refers to DEST; Logan International refers to Description = 'Boston, MA: Logan International'; airline id of the carrier operator refers to OP_CARRIER_AIRLINE_ID; highest delay in minutes due to security refers to MAX(SECURITY_DELAY); | SELECT T2.OP_CARRIER_AIRLINE_ID FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T1.Description = 'Boston, MA: Logan International' AND T2.DEST = 'BOS' ORDER BY T2.SECURITY_DELAY DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the tail number of a Compass Airline's plane that flew the most number of flights from LAX to ABQ? | tail number refers to TAIL_NUM; Compass Airline refers to Description = 'Compass Airlines: CP'; flew the most number of lights from LAX TO ABQ refers to MAX(COUNT(OP_CARRIER_AIRLINE_ID WHERE ORIGIN = 'LAX' and DEST = 'ABQ')); from LAX refers to ORIGIN = 'LAX'; to ABQ refers to DEST = 'ABQ'; | SELECT T2.OP_CARRIER_AIRLINE_ID FROM `Air Carriers` AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.OP_CARRIER_AIRLINE_ID WHERE T1.Description = 'Compass Airlines: CP' AND T2.ORIGIN = 'LAX' AND T2.DEST = 'ABQ' GROUP BY T2.OP_CARRIER_AIRLINE_ID ORDER BY COUNT(T2.OP_CARRIER_AIRLINE_ID) DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the name of the airline with the highest number of non-cancelled flights? | names of the airlines refers to Description; highest number of non-cancelled flights refers to MAX(COUNT(CANCELLED = 0)); | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLED = 0 GROUP BY T2.Description ORDER BY COUNT(T1.CANCELLED) DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the name of the airline that flew the most flights to Chicago Midway International? | name of the airline refers to Description; flights to refers to DEST; Chicago Midway International refers to Description = 'Chicago, IL: Chicago Midway International'; most flights to Chicago Midway International refers to MAX(COUNT(DEST WHERE Description = 'Chicago, IL: Chicago Midway International')); | SELECT T3.Description FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T1.Description = 'Chicago, IL: Chicago Midway International' AND T2.DEST = 'MDW' GROUP BY T3.Description ORDER BY COUNT(T3.Description) DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights on 2018/8/1 were operated by American Airlines Inc.? | on 2018/8/1 refers to FL_DATE = '2018/8/1'; American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; | SELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Please list the flight numbers of all the flights operated by American Airlines Inc. that were scheduled to depart from John F. Kennedy International. | flight numbers refers to OP_CARRIER_FL_NUM; American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; depart from refers to ORIGIN; John F. Kennedy International refers to Description = 'New York, NY: John F. Kennedy International'; | SELECT T2.OP_CARRIER_FL_NUM FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' AND T1.Description = 'New York, NY: John F. Kennedy International' AND T2.FL_DATE = '2018/8/1' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights of Endeavor Air Inc. were faster than scheduled on 2018/8/31? | Endeavor Air Inc. refers to Description = 'Endeavor Air Inc.: 9E'; faster than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME; on 2018/8/31 refers to FL_DATE = '2018/8/31'; | SELECT SUM(CASE WHEN T1.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/31' AND T2.Description = 'Endeavor Air Inc.: 9E' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many planes of Spirit Air Lines took off on 2018/8/7? | Spirit Air Lines refers to Description = 'Spirit Air Lines: NK'; on 2018/8/7 refers to FL_DATE = '2018/8/7'; | SELECT COUNT(T2.Code) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/7' AND T2.Description = 'Spirit Air Lines: NK' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Tell the number of fights landed earlier on Miami Airport on 2018/8/12. | landed on refers to DEST; landed earlier refers to ARR_DELAY < 0; Miami Airport refers to DEST = 'MIA'; on 2018/8/12 refers to FL_DATE = '2018/8/12'; | SELECT COUNT(*) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/12' AND T2.DEST = 'MIA' AND T2.ARR_DELAY < 0 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | For the flight with the tail number 'N702SK', which air carrier does it belong to? | tail number refers to TAIL_NUM; TAIL_NUM = 'N702SK'; | SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N702SK' GROUP BY T2.Description | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Provide the number of airplanes that landed on Oakland Airport on 2018/8/7. | landed on refers to DEST; Oakland Airport refers to Description which contains 'Oakland'; on 2018/8/7 refers to FL_DATE = '2018/8/7'; | SELECT SUM(CASE WHEN T1.Description LIKE '%Oakland%' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST WHERE T2.FL_DATE = '2018/8/7' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights of Alaska Airlines were delayed on 2018/8/2? | Alaska Airlines refers to Description = 'Alaska Airlines Inc.: AS'; delayed refers to DEP_DELAY > 0; on 2018/8/2 refers to FL_DATE = '2018/8/2'; | SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.FL_DATE = '2018/8/2' AND T2.Description = 'Alaska Airlines Inc.: AS' AND T1.DEP_DELAY > 0 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Give the number of planes that took off from Los Angeles International airport on 2018/8/27. | took off from refers to ORIGIN; Los Angeles International airport refers to Description = 'Los Angeles, CA: Los Angeles International'; on 2018/8/27 refers to FL_DATE = '2018/8/27'; | SELECT SUM(CASE WHEN T2.FL_DATE = '2018/8/27' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T1.Description = 'Los Angeles, CA: Los Angeles International' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights on average does American Airlines Inc. operate every day in August, 2018? | flights on average = DIVIDE(COUNT(Code), 31); American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; every day in August, 2018 refers to FL_DATE like '2018/8%'; | SELECT CAST( SUM(CASE WHEN T2.FL_DATE LIKE '2018/8%' THEN 1 ELSE 0 END) AS REAL) / 31 FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the number of air carriers in the database? | null | SELECT COUNT(Code) FROM `Air Carriers` | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights from American Airlines were cancelled due to a type A cancellation code? | American Airlines refers to Description = 'American Airlines Inc.: AA'; cancelled refers to Cancelled = 1; cancelled due to type A cancellation code refers to CANCELLATION_CODE = 'A'; | SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.CANCELLATION_CODE = 'A' AND T2.Description = 'American Airlines Inc.: AA' AND T1.CANCELLED = 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Which airline operated more flights on 2018/8/1, American Airlines Inc. or Endeavor Air Inc.? | SUM(Description = 'American Airlines Inc.: AA') > SUM(Description = 'Endeavor Air Inc.: 9E') means American Airlines Inc. operated more flights than Endeavor Air Inc; SUM(Description = 'American Airlines Inc.: AA') < SUM(Description = 'Endeavor Air Inc.: 9E') means Endeavor Air Inc. operated more flights than American... | SELECT CASE WHEN COUNT(CASE WHEN T3.Description = 'American Airlines Inc.: AA' THEN 1 ELSE NULL END) > COUNT(CASE WHEN T3.Description = 'Endeavor Air Inc.: 9E' THEN 1 ELSE NULL END) THEN 'American Airlines Inc.: AA' ELSE 'Endeavor Air Inc.: 9E' END AS RESULT FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2... | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Among the flights operated by American Airlines Inc., how many of them were scheduled to land in New York? | American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; land in New York refers to DEST = 'JFK'; | SELECT SUM(CASE WHEN T2.DEST = 'JFK' THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.DEST INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | Among the flights operated by American Airlines Inc. on 2018/8/1, how many of them were cancelled? | American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; on 2018/8/1 refers to FL_DATE = '2018/8/1'; cancelled refers to CANCELLED = 1; | SELECT SUM(CASE WHEN T2.CANCELLED = 1 THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | How many flights operated by American Airlines Inc. on 2018/8/1 were faster than scheduled? | American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; on 2018/8/1 refers to FL_DATE = '2018/8/1'; faster than scheduled refers to ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME; | SELECT SUM(CASE WHEN T2.ACTUAL_ELAPSED_TIME < CRS_ELAPSED_TIME THEN 1 ELSE 0 END) AS count FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T2.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T2.FL_DATE = '2018/8/1' AND T3.Description = 'American Airlines Inc.: AA' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the average departure delay time of flights operated by American Airlines Inc.? | average departure delay time = DIVIDE(SUM(DEP_DELAY), COUNT(Code)); American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; | SELECT AVG(T1.DEP_DELAY) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T1.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
airline | What is the flight number of the flight operated by American Airlines Inc. that had the longest delay in departure? | flight numbers refers to OP_CARRIER_FL_NUM; American Airlines Inc. refers to Description = 'American Airlines Inc.: AA'; longest delay in departure refers to MAX(DEP_DELAY); | SELECT T1.OP_CARRIER_FL_NUM FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T2.Code = T1.ORIGIN INNER JOIN `Air Carriers` AS T3 ON T1.OP_CARRIER_AIRLINE_ID = T3.Code WHERE T3.Description = 'American Airlines Inc.: AA' ORDER BY T1.DEP_TIME DESC LIMIT 1 | CREATE TABLE Airlines
(
CANCELLED INTEGER, -- Example Values: `0`, `1` | Value Statics: Total count 100000 - Distinct count 2 - Null count 0
CRS_DEP_TIME INTEGER, --
CRS_ELAPSED_TIME INTEGER, --
CANCELLATION_CODE TEXT, -- Example Values: `A`, `B`, `C` | Value Statics: Total count 3795 - Distinct count 3 - Nu... |
language_corpus | How many occurrences does the word "panajot" have? | panajot refers to word = 'panajot' | SELECT occurrences FROM words WHERE word = 'panajot' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | For the biwords pair that appears "116430" times, what is the second word of the pair? | the biwords pair that appears "116430" times refers to occurrences = 116430; second word of the pair refers to w2nd | SELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T2.occurrences = 116430 | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
language_corpus | What is the word ID for the second word for the biwords pair with most repetitions? | second word refers to w2nd; biwords pair with most repetitions refers to MAX(biwords.occurrences) | SELECT w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords ) | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
movie_3 | What is the difference in the average number of films rented each day in Australia and Canada? | 'Australia' AND 'Canada' are country; average number of films refers to AVG('Australia') AND AVG('Canada'); calculation = SUBTRACT(AVG('Australia'), AVG('Canada')) | SELECT AVG(IIF(T4.country = 'Australia', 1, 0)) - AVG(IIF(T4.country = 'Canada', 1, 0)) AS diff FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T2.city_id = T3.city_id INNER JOIN country AS T4 ON T3.country_id = T4.country_id | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
language_corpus | State the word ID for "periodograma". | word ID refers to wid; periodograma refers to word = 'periodograma' | SELECT wid FROM words WHERE word = 'periodograma' | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
movie_3 | Give the full name of the actor who acted the most in drama movies? | full name refers to first_name, last_name; drama is a category of a film; acted the most in a movies refers to MAX(COUNT(film_id)) | SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T2.film_id) AS num FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film_category AS T3 ON T2.film_id = T3.film_id WHERE T3.category_id = 7 GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DES... | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
language_corpus | Which word has the most repetitions in the Catalan language? Give the ID of the word. | word with the most repetitions refers to MAX(occurrences); ID of the word refers to wid | SELECT wid FROM langs_words WHERE occurrences = ( SELECT MAX(occurrences) FROM langs_words ) | CREATE TABLE words
(
occurrences INTEGER DEFAULT 0, --
word TEXT UNIQUE, --
wid INTEGER PRIMARY KEY AUTOINCREMENT,
);
CREATE TABLE langs
(
lid INTEGER PRIMARY KEY AUTOINCREMENT,
pages INTEGER DEFAULT 0, -- Example Values: `1129144` | Value Statics: Total count 1 - Distinct count 1 - Null count 0
lang TEXT... |
movie_3 | Give the full name of the actor who acted in the most number of movies? | full name refers to first_name, last_name; acted in the most number of movies refers to MAX(COUNT(film_id)) | SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, COUNT(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1 | CREATE TABLE staff
(
last_name TEXT not null, -- Example Values: `Hillyer`, `Stephens` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
email TEXT, -- Example Values: `Mike.Hillyer@sakilastaff.com`, `Jon.Stephens@sakilastaff.com` | Value Statics: Total count 2 - Distinct count 2 - Null count 0
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.