input
stringlengths
193
2.69k
output
stringlengths
24
744
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: State the Wikipedia page title that has revision page id of 28040864. [...
SELECT title FROM pages WHERE revision = 28040864;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT SUM(occurrences) FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'barcelona' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'precolombina' );
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that a...
SELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Anys 90';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Which word that ...
SELECT T1.word FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = 71303;
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that a...
SELECT T1.locale FROM langs AS T1 INNER JOIN pages AS T2 ON T1.lid = T2.lid WHERE T2.title = 'Abril';
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL sta...
SELECT words FROM langs WHERE lid = ( SELECT lid FROM biwords WHERE w1st = 100 AND w2nd = 317 );
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the followin...
SELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences = 2593;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT DISTINCT T1.title FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.wid < 20;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT COUNT(T2.wid) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.words = 3;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT COUNT(T2.wid), T1.lid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T2.occurrences = 8;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT CAST(SUM(T1.words) AS REAL) * 100 / SUM(T2.occurrences) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.revision < 106680;
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the followin...
SELECT T1.pages FROM langs AS T1 INNER JOIN langs_words AS T2 ON T1.lid = T2.lid WHERE T2.occurrences > 3000 GROUP BY T1.pages;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.w1st = 20 AND T2.w2nd = 50;
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] Please write me a SQL statement that answers the following question: How many pages of Wikipedia are there in total on the Catalan language? [/INST]
SELECT pages FROM langs WHERE lang = 'ca';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the titles of the Wikipedia pages on the Catalan language w...
SELECT title FROM pages WHERE lid = 1 AND words > 4000;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: How many words are there on the page titled "Asclepi"? [/INST]
SELECT words FROM pages WHERE title = 'Asclepi';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: Which of these pages have more words, the page titled "Afluent" or "Asc...
SELECT CASE WHEN ( SELECT words FROM pages WHERE title = 'Asclepi' ) > ( SELECT words FROM pages WHERE title = 'Afluent' ) THEN 'Asclepi' ELSE 'Afluent' END;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: What is the occurrence of the word "nombre"? [/INST]
SELECT occurrences FROM words WHERE word = 'nombre';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the Catalan words with an occurrence of over 200000. [/INST]
SELECT word FROM words WHERE occurrences > 200000;
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that a...
SELECT T2.locale FROM pages AS T1 INNER JOIN langs AS T2 ON T1.lid = T2.lid WHERE T1.title = 'Asclepi';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
SELECT 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 T3.title = 'Àbac' AND T1.word = 'grec';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
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 > 20;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
SELECT SUM(T3.words) 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;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' );
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT CASE WHEN ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' ) ) > ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'grec' ...
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT occurrences - ( SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' ) ) AS CALUS FROM words WHERE word = 'àbac';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT T1.word AS W1, T3.word AS W2 FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = 'àbac';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = 'àbac';
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] b...
SELECT COUNT(T1.pages) FROM langs AS T1 INNER JOIN biwords AS T2 ON T1.lid = T2.lid WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND T2.w2nd = ( SELECT wid FROM words WHERE word = 'xinès' );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
SELECT CAST((SUM(CASE WHEN T3.title = 'Àbac' THEN T2.occurrences END) - SUM(CASE WHEN T3.title = 'Astronomia' THEN T2.occurrences END)) AS REAL) * 100 / SUM(CASE WHEN T3.title = 'Astronomia' THEN T2.occurrences END) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid INNER JOIN pages AS T3 ON T2.pid = T3.p...
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] Please write me a SQL statement that answers the following question: How many pages does the Catalan language have in Wikipedia? [/INST]
SELECT pages FROM langs WHERE lang = 'ca';
[INST] Here is a database schema: langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Which word has the most repetitions in the Catalan language? Give the ID of the word. [/IN...
SELECT wid FROM langs_words WHERE occurrences = ( SELECT MAX(occurrences) FROM langs_words );
[INST] Here is a database schema: biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: What is the word ID for the second word for the biwords pa...
SELECT w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords );
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: How many occurrences does the word "panajot" have? [/INST]
SELECT occurrences FROM words WHERE word = 'panajot';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Which word has the time of occurrences as 340691? [/INST]
SELECT word FROM words WHERE occurrences = 340691;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: State the word ID for "periodograma". [/INST]
SELECT wid FROM words WHERE word = 'periodograma';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T2.occurrences = 116430;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT COUNT(T1.wid) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T1.word = 'riu';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT T2.wid FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Agricultura' ORDER BY T2.occurrences DESC LIMIT 1;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT SUM(T2.occurrences) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.title = 'Astre' AND T2.wid = 2823;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT title FROM pages WHERE pid = ( SELECT pid FROM pages_words WHERE wid = 174 ORDER BY occurrences DESC LIMIT 1 );
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: How many times d...
SELECT COUNT(T2.occurrences) FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'heròdot';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write m...
SELECT pid FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE revision = 28278070 ) ORDER BY occurrences DESC LIMIT 1;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'que' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'gregorio' );
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT COUNT(w1st) FROM biwords WHERE w2nd = ( SELECT wid FROM words WHERE word = 'base' );
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: How many times o...
SELECT T2.occurrences FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'exemple' AND T2.lid = 1;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Which word that ...
SELECT T1.word FROM words AS T1 INNER JOIN langs_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = 274499 AND T2.lid = 1;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
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' );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
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';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: How many Wikipedia pages with over 4000 different words are there on th...
SELECT COUNT(lid) FROM pages WHERE lid = 1 AND words > 4000;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the titles of all the Wikipedia pages on the Catalan langua...
SELECT title FROM pages WHERE lid = 1 AND words = 10 LIMIT 10;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: What is the word that occurs the most in the Catalan language? [/INST]
SELECT word FROM words WHERE occurrences = ( SELECT MAX(occurrences) FROM words );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the titles of the top 3 Wikipedia pages with the most diffe...
SELECT title FROM pages WHERE lid = 1 ORDER BY words DESC LIMIT 3;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: What is the revision ID for the page on Catalan titled "Arqueologia"? [...
SELECT revision FROM pages WHERE lid = 1 AND title = 'Arqueologia';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: Among the wikipedia pages on Catalan with more than 300 different words...
SELECT COUNT(lid) FROM pages WHERE lid = 1 AND words > 300 AND revision > 28330000;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Please list the ...
SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'nombre';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: How many Wikiped...
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;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T1.word = 'grec';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
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;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
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;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: What is the aver...
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';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'JFK';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT DEST FROM Airlines WHERE FL_DATE = '2018/8/1' AND CANCELLED = 1 GROUP BY DEST;
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT FL_DATE FROM Airlines WHERE CANCELLATION_CODE = 'A' GROUP BY FL_DATE;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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...
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND DEP_DELAY <= 0;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: What are the codes of the airport found in Ankara, Turkey? [/INST]
SELECT Code FROM Airports WHERE Description LIKE '%Ankara, Turkey%';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT WEATHER_DELAY FROM Airlines WHERE ORIGIN_AIRPORT_ID = 12264 ORDER BY WEATHER_DELAY DESC LIMIT 1;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: What is the IATA code of the Anita Bay Airport in Anita Bay, Alaska? [/INST]
SELECT Code FROM Airports WHERE Description = 'Anita Bay, AK: Anita Bay Airport';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT ORIGIN_AIRPORT_ID FROM Airlines ORDER BY LATE_AIRCRAFT_DELAY DESC LIMIT 1;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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...
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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...
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
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;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
SELECT T1.OP_CARRIER_AIRLINE_ID FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T1.ORIGIN = T2.Code WHERE T1.ACTUAL_ELAPSED_TIME IS NOT NULL AND T1.CRS_ELAPSED_TIME IS NOT NULL ORDER BY T1.ACTUAL_ELAPSED_TIME - T1.CRS_ELAPSED_TIME ASC LIMIT 1;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: Please list any three airports with their codes. [/INST]
SELECT Code, Description FROM Airports LIMIT 3;
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT CRS_DEP_TIME, DEP_TIME FROM Airlines WHERE ORIGIN = 'PHL' AND DEST = 'MDT' AND TAIL_NUM = 'N627AE' AND FL_DATE = '2018/8/13';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT COUNT(*) FROM Airlines WHERE FL_DATE = '2018/8/1' AND ORIGIN = 'ABE';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT DEST FROM Airlines WHERE ORIGIN = 'ABY' GROUP BY DEST;
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT COUNT(*) FROM Airlines WHERE DEST = 'SNA' AND ORIGIN = 'DFW' AND DEP_DELAY = 0;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORI...
SELECT COUNT(*) FROM Airlines AS T1 INNER JOIN Airports AS T2 ON T1.ORIGIN = T2.Code WHERE T1.ORIGIN = 'CLT' AND T1.DEST = 'AUS' AND T2.Description = 'Charlotte, NC: Charlotte Douglas International' AND T1.CANCELLATION_CODE = 'A';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: What is the airport description of the airport code A11? [/INST]
SELECT Description FROM Airports WHERE Code = 'A11';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT COUNT(*) AS num FROM Airlines WHERE Origin = 'OKC';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: How many airports have a code starting with the letter C? [/INST]
SELECT COUNT(*) FROM Airports WHERE Code LIKE 'C%';
[INST] Here is a database schema: Airlines : FL_DATE [ TEXT ] OP_CARRIER_AIRLINE_ID [ INTEGER ] Airlines.OP_CARRIER_AIRLINE_ID = Air Carriers.Code TAIL_NUM [ TEXT ] OP_CARRIER_FL_NUM [ INTEGER ] ORIGIN_AIRPORT_ID [ INTEGER ] ORIGIN_AIRPORT_SEQ_ID [ INTEGER ] ORIGIN_CITY_MARKET_ID [ INTEGER ] ORIGIN [ TEXT ] Airlines.OR...
SELECT DEST FROM Airlines WHERE OP_CARRIER_FL_NUM = 1596;
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: List the description of the airports that have code that ends with number 3? [/INST]
SELECT Description FROM Airports WHERE Code LIKE '%3';
[INST] Here is a database schema: Airports : Code [ TEXT ] primary_key Description [ TEXT ] Please write me a SQL statement that answers the following question: Give the code of the airport described as Driftwood Bay, AK: Driftwood Bay Airport. [/INST]
SELECT Code FROM Airports WHERE Description = 'Driftwood Bay, AK: Driftwood Bay Airport';