Chinastark/bird_dataset huggingface dataset:
Database: language_corpus
Note: words in the Catalan language refers lid = 1; repetition of more than 16,000 times refers to occurrences > 16000; DIVIDE(COUNT(words where lid = 1 and occurrences > 16000), COUNT(words where lid = 1)) as percentage;
Question: What is the percentage of words in the Catalan language that have a repetition of more than 16,000 times?
SQL: SELECT cast(count(CASE WHEN occurrences > 16000 THEN lid ELSE NULL END) AS REAL) * 100 / count(lid) FROM langs_words
Database: language_corpus
Note: Wikipedia page number refers to page;  the highest number of words in the Catalan language refers to MAX(lid = 1);
Question: Which Wikipedia page number has the highest number of words in the Catalan language?
SQL: SELECT page FROM pages WHERE words = ( SELECT max(words) FROM pages )
Database: language_corpus
Note: Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; in the Catalan language refers to lid; repeated less than 80 times refers to occurrences < 80; DIVIDE(COUNT(lid where occurrences < 80), COUNT(lid)) as percentage;
Question: What proportion of a pair of words in the Catalan language have been repeated less than 80 times?
SQL: SELECT cast(count(CASE WHEN occurrences < 80 THEN lid ELSE NULL END) AS REAL) * 100 / count(lid) FROM biwords
Database: language_corpus
Note: Catalan-language refers to lang = 'ca';
Question: How many Catalan-language Wikipedia pages are there overall?
SQL: SELECT pages FROM langs WHERE lang = 'ca'
Database: language_corpus
Note: in Catalan means in Catalan-language and refers to lid = 1; revision page numbers refer to revision;
Question: Please list any three Wikipedia pages that are written in Catalan, together with their titles and revision page numbers.
SQL: SELECT title, revision FROM pages WHERE lid = 1 LIMIT 3
Database: language_corpus
Note: Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 616;
Question: What is the language of the pair of words numbered 1 and 616?
SQL: SELECT langs.lang FROM biwords INNER JOIN langs ON biwords.lid = langs.lid WHERE biwords.w1st = 1 AND biwords.w2nd = 616
Database: language_corpus
Note: the Catalan means Catalan language and refers to lid = 1; How many times repeat refers to occurrences;
Question: How many times does the Catalan word "nombre" repeat itself?
SQL: SELECT langs_words.occurrences FROM langs_words INNER JOIN words ON langs_words.wid = words.wid WHERE words.word = 'nombre'
Database: language_corpus
Note: Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 8968;
Question: What is the second word in the pair of words number 1 and 8968?
SQL: SELECT word FROM words WHERE wid = 8968
Database: language_corpus
Note: the most repetitions refer to MAX(occurrences); Catalan language refers to lid = 1;
Question: Which word has the most repetitions in the Catalan language?
SQL: SELECT words.word FROM langs_words INNER JOIN words ON langs_words.wid = words.wid WHERE langs_words.occurrences = ( SELECT max(occurrences) FROM langs_words )
Database: language_corpus
Note: How many times refers to occurrences; page number 44 refers to pid = 44;
Question: How many times on page number 44 does the word "votives" appear?
SQL: SELECT pages_words.occurrences FROM words INNER JOIN pages_words ON words.wid = pages_words.wid WHERE words.word = 'votives' AND pages_words.pid = 44
Database: language_corpus
Note: How many times appear refer to occurrences; page number 16 refers to pid = 16; Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 109;
Question: How many times on page number 16 does the second word in the pair of words 1 and 109 appear?
SQL: SELECT sum(pages_words.occurrences) FROM pages_words INNER JOIN biwords ON biwords.w2nd = pages_words.wid WHERE biwords.w2nd = 109 AND biwords.w1st = 1 AND pages_words.pid = 16
Database: language_corpus
Note: repeated under 180 times refers to occurrences < 180; Catalan language refers to lang = 'ca'; DIVIDE(COUNT(words WHERE occurrences < 180 and lang = 'ca'), COUNT(words WHERE lang = 'ca')) as percentage;
Question: What is the percentage of the words that have been repeated under 180 times in the Catalan language?
SQL: SELECT cast(count(CASE WHEN langs_words.occurrences < 180 THEN 1 ELSE NULL END) AS REAL) * 100 / count(langs.lid) FROM langs INNER JOIN langs_words ON langs.lid = langs_words.lid WHERE langs.lang = 'ca'
Database: language_corpus
Note: Catalan-language refers to lang = 'ca'; more than 10,000 words refer to words > 10000; DIVIDE(COUNT(pages WHERE words > 10000 and lang = 'ca'), COUNT(pages WHERE lang = 'ca')) as percentage;
Question: What percentage of Catalan-language Wikipedia pages have more than 10,000 words?
SQL: SELECT cast(count(CASE WHEN pages.words > 10000 THEN 1 ELSE NULL END) AS REAL) * 100 / count(pages.page) FROM langs INNER JOIN pages ON langs.lid = pages.lid WHERE langs.lang = 'ca'
Database: language_corpus
Note: How many times occurs refers to occurrences;
Question: How many times the word "desena" occurs?
SQL: SELECT occurrences FROM words WHERE word = 'desena'
Database: language_corpus
Note: appearance times greater than 10 refers to occurrences > 10;
Question: How many words has the appearance times greater than 10?
SQL: SELECT count(w1st) AS countwords FROM biwords WHERE occurrences > 10
Database: language_corpus
Note: This is not;
Question: List out the total pages of Wikipedia in Catalan language.
SQL: SELECT pages FROM langs
Database: language_corpus
Note: repetitions greater than 2000 and lower than 5000 refer to occurrences between 2000 and 5000;
Question: How many words have repetitions greater than 2000 and lower than 5000?
SQL: SELECT count(wid) FROM langs_words WHERE occurrences BETWEEN '2000' AND '5000'
Database: language_corpus
Note: Wikipedia revision page id as 106601 refers to revision = 106601;
Question: List out the title of Catalan language Wikipedia page that has wikipedia revision page id as 106601.
SQL: SELECT title FROM pages WHERE revision = 106601
Database: language_corpus
Note: revision page id of 28040864 refers to revision = 28040864;
Question: State the Wikipedia page title that has revision page id of 28040864.
SQL: SELECT title FROM pages WHERE revision = 28040864
Database: language_corpus
Note: Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st or w2nd = 'barcelona'; w1st or w2nd = 'precolombina';
Question: How many times that the word pair of "barcelona" and "precolombina" occur?
SQL: SELECT sum(occurrences) FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'barcelona' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'precolombina' )
Database: language_corpus
Note: page titled "Anys 90" refers to title = 'Anys 90';
Question: What is the locale of the language of the page titled "Anys 90"?
SQL: SELECT langs.locale FROM langs INNER JOIN pages ON langs.lid = pages.lid WHERE pages.title = 'Anys 90'
Database: language_corpus
Note: has 71303 appearance refers to occurrences = 71303;
Question: Which word that has 71303 appearance in the Catalan language?
SQL: SELECT words.word FROM words INNER JOIN langs_words ON words.wid = langs_words.wid WHERE langs_words.occurrences = 71303
Database: language_corpus
Note: the page titled "Abril" refers to title = 'Abril';
Question: What is the locale of the language of the page titled "Abril"?
SQL: SELECT langs.locale FROM langs INNER JOIN pages ON langs.lid = pages.lid WHERE pages.title = 'Abril'
Database: language_corpus
Note: Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 100; w2nd = 317;
Question: What is the total number of words in page containing pair of word id "100" and "317"?
SQL: SELECT words FROM langs WHERE lid = ( SELECT lid FROM biwords WHERE w1st = 100 AND w2nd = 317 )
Database: language_corpus
Note: repeated times of 2593 refers to occurrences = 2593;
Question: State the total pages of the words that has repeated times of 2593.
SQL: SELECT count(langs.pages) FROM langs INNER JOIN langs_words ON langs.lid = langs_words.lid WHERE langs_words.occurrences = 2593
Database: language_corpus
Note: word have id less than 20 refers to wid < 20;
Question: List out the title of the word have id less than 20.
SQL: SELECT DISTINCT pages.title FROM pages INNER JOIN pages_words ON pages.pid = pages_words.pid WHERE pages_words.wid < 20
Database: language_corpus
Note: This is not;
Question: How many word that has number of different words equal to 3?
SQL: SELECT count(pages_words.wid) FROM pages INNER JOIN pages_words ON pages.pid = pages_words.pid WHERE pages.words = 3
Database: language_corpus
Note: appeared 8 times refers to occurrences = 8;
Question: How many word appeared 8 times? State the language id of the page.
SQL: SELECT count(pages_words.wid), pages.lid FROM pages INNER JOIN pages_words ON pages.pid = pages_words.pid WHERE pages_words.occurrences = 8
Database: language_corpus
Note: revision page id smaller than 106680 refers to revision < 106680; word appearance refers to occurrences; DIVIDE(SUM(occurrences where revision < 106680), COUNT(occurrences)) as percentage;
Question: Calculate the average percentage of word appearance in the page that have revision page id smaller than 106680.
SQL: SELECT cast(sum(pages.words) AS REAL) * 100 / sum(pages_words.occurrences) FROM pages INNER JOIN pages_words ON pages.pid = pages_words.pid WHERE pages.revision < 106680
Database: language_corpus
Note: repeated more than 3000 times refers to occurrences > 3000;
Question: List out the total pages of the words that has repeated times more than 3000.
SQL: SELECT langs.pages FROM langs INNER JOIN langs_words ON langs.lid = langs_words.lid WHERE langs_words.occurrences > 3000 GROUP BY langs.pages
Database: language_corpus
Note: word that have id of 20 refers to wid = 20; word that have id of 50 refers to wid = 50;
Question: State the name of the pair of word that have id of 20 and 50?
SQL: SELECT words.word, words.word FROM words INNER JOIN biwords ON words.wid = biwords.w1st INNER JOIN words ON words.wid = biwords.w2nd WHERE biwords.w1st = 20 AND biwords.w2nd = 50
Database: language_corpus
Note: Catalan language refers to lang = 'ca';
Question: How many pages of Wikipedia are there in total on the Catalan language?
SQL: SELECT pages FROM langs WHERE lang = 'ca'
Database: language_corpus
Note: Catalan language refers to lid = 1; more than 4000 words refers to words > 4000;
Question: Please list the titles of the Wikipedia pages on the Catalan language with more than 4000 words.
SQL: SELECT title FROM pages WHERE lid = 1 AND words > 4000
Database: language_corpus
Note: page titled "Asclepi" refers to title = 'Asclepi' ;
Question: How many words are there on the page titled "Asclepi"?
SQL: SELECT words FROM pages WHERE title = 'Asclepi'
Database: language_corpus
Note: COUNT(words where title = 'Afluent')> COUNT(words where title = 'Asclepi');
Question: Which of these pages have more words, the page titled "Afluent" or "Asclepi"?
SQL: SELECT CASE WHEN ( SELECT words FROM pages WHERE title = 'Asclepi' ) > ( SELECT words FROM pages WHERE title = 'Afluent' ) THEN 'Asclepi' ELSE 'Afluent' END
Database: language_corpus
Note: This is not;
Question: What is the occurrence of the word "nombre"?
SQL: SELECT occurrences FROM words WHERE word = 'nombre'
Database: language_corpus
Note: occurrence of over 200000 refers to occurrences > 200000;
Question: Please list the Catalan words with an occurrence of over 200000.
SQL: SELECT word FROM words WHERE occurrences > 200000
Database: language_corpus
Note: page titled "Asclepi" refers to title = 'Asclepi' ;
Question: What is the locale of the language of the page titled "Asclepi"?
SQL: SELECT langs.locale FROM pages INNER JOIN langs ON pages.lid = langs.lid WHERE pages.title = 'Asclepi'
Database: language_corpus
Note: how many times occur refers to occurrences; page titled "Àbac" refers to title = 'Àbac' ;
Question: How many times did the word "grec" occur on the page titled "Àbac"?
SQL: SELECT pages_words.occurrences FROM words INNER JOIN pages_words ON words.wid = pages_words.wid INNER JOIN pages ON pages_words.pid = pages.pid WHERE pages.title = 'Àbac' AND words.word = 'grec'
Database: language_corpus
Note: occurred for over 20 times refers to occurrences > 20;
Question: Please list the title of the pages on which the word "grec" occurred for over 20 times.
SQL: SELECT pages.title FROM words INNER JOIN pages_words ON words.wid = pages_words.wid INNER JOIN pages ON pages_words.pid = pages.pid WHERE words.word = 'grec' AND pages_words.occurrences > 20
Database: language_corpus
Note: the word "grec" refers to word = 'grec'; occurred for 52 times refers to occurrences = 52;
Question: How many words are there on the page that the word "grec" has occurred for 52 times?
SQL: SELECT sum(pages.words) FROM words INNER JOIN pages_words ON words.wid = pages_words.wid INNER JOIN pages ON pages_words.pid = pages.pid WHERE words.word = 'grec' AND pages_words.occurrences = 52
Database: language_corpus
Note: àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; occurrence refers to occurrences;
Question: What's the occurrence of the biwords pair whose first word is "àbac" and second word is "xinès"?
SQL: SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'xinès' )
Database: language_corpus
Note: higher occurrence is MAX(occurrences); àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; grec refers to word = 'grec';
Question: Which biwords pair has a higher occurrence, "àbac-xinès" or "àbac-grec"?
SQL: 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' ) ) THEN 'àbac-xinès' ELSE 'àbac-grec' END AS calus FROM words LIMIT 1
Database: language_corpus
Note: àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; How many more times the first word in the biwords occur than the biwords pair itself means SUBTRACT(words.occurrence, biwords.occurrences);
Question: How many more times does the first word in the biwords pair "àbac-xinès" occur than the biwords pair itself?
SQL: 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'
Database: language_corpus
Note: àbac refers to word = 'àbac'; first word refers to w1st;
Question: Please list all the biwords pairs with "àbac" as its first word.
SQL: SELECT words.word AS w1, words.word AS w2 FROM words INNER JOIN biwords ON words.wid = biwords.w1st INNER JOIN words ON words.wid = biwords.w2nd WHERE words.word = 'àbac'
Database: language_corpus
Note: occurrence refers to occurrences; àbac refers to word = 'àbac'; first word refers to w1st;
Question: What is the total occurrence of the biwords pairs with "àbac" as its first word?
SQL: SELECT count(biwords.w1st) FROM words INNER JOIN biwords ON words.wid = biwords.w1st INNER JOIN words ON words.wid = biwords.w2nd WHERE words.word = 'àbac'
Database: language_corpus
Note: àbac refers to word = 'àbac'; xinès refers to word = 'xinès'; Wikipedia pages refer to pages;
Question: How many Wikipedia pages are there on the language of the biwords pair "àbac-xinès"?
SQL: SELECT count(langs.pages) FROM langs INNER JOIN biwords ON langs.lid = biwords.lid WHERE biwords.w1st = ( SELECT wid FROM words WHERE word = 'àbac' ) AND biwords.w2nd = ( SELECT wid FROM words WHERE word = 'xinès' )
Database: language_corpus
Note: grec refers to word = 'grec'; Àbac refers to title = 'Àbac'; Astronomia refers to title = 'Astronomia'; percentage = DIVIDE(SUBTRACT(occurrences where title = 'Àbac' AND word = 'grec', occurrences where title = 'Astronomia' AND word = 'grec'), occurrences where title = 'Astronomia' AND word = 'grec');
Question: How much higher in percentage does the word "grec" occur on the page titled "Àbac" than on the page titled "Astronomia"?
SQL: SELECT cast((sum(CASE WHEN pages.title = 'Àbac' THEN pages_words.occurrences END) - sum(CASE WHEN pages.title = 'Astronomia' THEN pages_words.occurrences END)) AS REAL) * 100 / sum(CASE WHEN pages.title = 'Astronomia' THEN pages_words.occurrences END) FROM words INNER JOIN pages_words ON words.wid = pages_words.wid INNER JOIN pages ON pages_words.pid = pages.pid WHERE words.word = 'grec'
Database: language_corpus
Note: Catalan language refers to lang = 'ca';
Question: How many pages does the Catalan language have in Wikipedia?
SQL: SELECT pages FROM langs WHERE lang = 'ca'
Database: language_corpus
Note: word with the most repetitions refers to MAX(occurrences); ID of the word refers to wid;
Question: Which word has the most repetitions in the Catalan language? Give the ID of the word.
SQL: SELECT wid FROM langs_words WHERE occurrences = ( SELECT max(occurrences) FROM langs_words )
Database: language_corpus
Note: second word refers to w2nd; biwords pair with most repetitions refers to MAX(biwords.occurrences);
Question: What is the word ID for the second word for the biwords pair with most repetitions?
SQL: SELECT w2nd FROM biwords WHERE occurrences = ( SELECT max(occurrences) FROM biwords )
Database: language_corpus
Note: panajot refers to word = 'panajot';
Question: How many occurrences does the word "panajot" have?
SQL: SELECT occurrences FROM words WHERE word = 'panajot'
Database: language_corpus
Note: occurrences of 340691 refers to occurrences = 340691;
Question: Which word has the time of occurrences as 340691?
SQL: SELECT word FROM words WHERE occurrences = 340691
Database: language_corpus
Note: word ID refers to wid; periodograma refers to word = 'periodograma';
Question: State the word ID for "periodograma".
SQL: SELECT wid FROM words WHERE word = 'periodograma'
Database: language_corpus
Note: the biwords pair that appears "116430" times refers to occurrences = 116430; second word of the pair refers to w2nd;
Question: For the biwords pair that appears "116430" times, what is the second word of the pair?
SQL: SELECT words.word FROM words INNER JOIN biwords ON words.wid = biwords.w2nd WHERE biwords.occurrences = 116430
Database: language_corpus
Note: riu refers to word = 'riu'; SUM(w1st where wid is word = 'riu' AND w2nd where wid is word = 'riu');
Question: How many times does the word "riu" appears in the biwords pair?
SQL: SELECT count(words.wid) FROM words INNER JOIN biwords ON words.wid = biwords.w1st INNER JOIN words ON words.wid = biwords.w2nd WHERE words.word = 'riu'
Database: language_corpus
Note: Agricultura refers to title = 'Agricultura'; the most appearances is MAX(pages_words_sampling.occurrences);
Question: Which word has the most appearances in the Wikipedia page with the title of "Agricultura"? Give the word ID.
SQL: SELECT pages_words.wid FROM pages INNER JOIN pages_words ON pages.pid = pages_words.pid WHERE pages.title = 'Agricultura' ORDER BY pages_words.occurrences DESC LIMIT 1
Database: language_corpus
Note: Astre refers to title = 'Astre'; word ID No. 2823 refers to wid = 2823; appearances refers to pages_words_sampling.occurrences;
Question: How many appearances does the word ID No. 2823 have in the Wikipedia page "Astre"?
SQL: SELECT sum(pages_words.occurrences) FROM pages INNER JOIN pages_words ON pages.pid = pages_words.pid WHERE pages.title = 'Astre' AND pages_words.wid = 2823
Database: language_corpus
Note: word ID No. 174 refers to wid = 174; appearances refers to pages_words_sampling.occurrences;
Question: In which Wikipedia page does the word ID No. 174 have the most appearances? Give the title.
SQL: SELECT title FROM pages WHERE pid = ( SELECT pid FROM pages_words WHERE wid = 174 ORDER BY occurrences DESC LIMIT 1 )
Database: language_corpus
Note: heròdot refers to word = 'heròdot'; times appear refers to SUM(pid);
Question: How many times does the word "heròdot" appear in the Wikipedia page?
SQL: SELECT count(pages_words.occurrences) FROM words INNER JOIN pages_words ON words.wid = pages_words.wid WHERE words.word = 'heròdot'
Database: language_corpus
Note: the most appearances refers to MAX(occurrences); revision ID No. 28278070 refers to revision = 28278070; word ID refers to wid;
Question: Which word has the most appearances in the Wikipedia page revision ID No. 28278070? Give the word ID.
SQL: SELECT pid FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE revision = 28278070 ) ORDER BY occurrences DESC LIMIT 1
Database: language_corpus
Note: que gregorio refers to w1st = wid where word = 'que' AND w2nd = wid where word = 'gregorio'; appear refers to biwords.occurrences;
Question: How many times does the biwords "que gregorio" appear in the language?
SQL: SELECT occurrences FROM biwords WHERE w1st = ( SELECT wid FROM words WHERE word = 'que' ) AND w2nd = ( SELECT wid FROM words WHERE word = 'gregorio' )
Database: language_corpus
Note: base refers to word = 'base'; SUM(w2nd) where w2nd = wid for word = 'base';
Question: How many biword pairs contain the word "base" as the second word?
SQL: SELECT count(w1st) FROM biwords WHERE w2nd = ( SELECT wid FROM words WHERE word = 'base' )
Database: language_corpus
Note: exemple refers to word = 'exemple'; repetition refers to langs_words.occurrences; lid = 1 menas it's Catalan language;
Question: How many times of repetition does the word "exemple" show in the Catalan language?
SQL: SELECT langs_words.occurrences FROM words INNER JOIN langs_words ON words.wid = langs_words.wid WHERE words.word = 'exemple' AND langs_words.lid = 1
Database: language_corpus
Note: lid = 1 menas it's Catalan language; 274499 repetitions refers to occurrences = 274499;
Question: Which word that has 274499 repetitions in the Catalan language?
SQL: SELECT words.word FROM words INNER JOIN langs_words ON words.wid = langs_words.wid WHERE langs_words.occurrences = 274499 AND langs_words.lid = 1
Database: language_corpus
Note: 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 = 'decimal' as w2nd; appearances of 'a base' greater than 'a decimal' refers to DIVIDE(SUBTRACT(biwords.occurrences'a base', biwords.occurrences'a decimal'), biwords.occurrences'a decimal');
Question: How many times greater is the appearances of the biword pair "a base" than "a decimal"?
SQL: 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' )
Database: language_corpus
Note: grec refers to word = 'grec'; Art refers to title = 'Art'; percentage is DIVIDE(occurrences(grec), occurences(Art))*100;
Question: For the word "grec", what is the percentage of the appearances in the "Art" Wikipedia page have among all the appearances?
SQL: SELECT cast(sum(CASE WHEN pages.title = 'Art' THEN pages_words.occurrences ELSE 0 END) AS REAL) * 100 / sum(pages_words.occurrences) FROM words INNER JOIN pages_words ON words.wid = pages_words.wid INNER JOIN pages ON pages_words.pid = pages.pid WHERE words.word = 'grec'
Database: language_corpus
Note: lid = 1 means it's Catalan language; over 4000 different words means words > 4000; Wikipedia pages refers to pid;
Question: How many Wikipedia pages with over 4000 different words are there on the Catalan language?
SQL: SELECT count(lid) FROM pages WHERE lid = 1 AND words > 4000