SQL
stringlengths
18
577
question
stringlengths
317
11.5k
SELECT pestcode FROM resultsdata15 GROUP BY pestcode ORDER BY count(*) LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. which pesticides have been used the least?
SELECT sample_pk, testclass FROM resultsdata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. how was a specific sample tested?
SELECT sample_pk, growst FROM sampledata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. in which state was a specific sample grown?
SELECT sample_pk, packst FROM sampledata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. in which state was a specific sample packed?
SELECT sample_pk, distst FROM sampledata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. in which state was a specific sample distributed?
SELECT sample_pk FROM sampledata15 WHERE origin = "2"
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. show all imported samples?
SELECT DISTINCT commod FROM sampledata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. which foods are captured in the data set?
SELECT count(*) FROM sampledata15 WHERE origin = "3"
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. how many samples have unknown countries of origin?
SELECT T2.commod FROM resultsdata15 as T2 JOIN sampledata15 as T1 ON T1.sample_pk = T2.sample_pk WHERE T1.year = 15 GROUP BY T2.commod ORDER BY sum(T2.concen) DESC LIMIT 10
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which are the top 10 commodities that have the highest residue during 2015?
SELECT commod FROM sampledata15 WHERE origin = 2 AND commod not in (SELECT commod FROM sampledata15 WHERE origin = 1)
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Name some imported commodities that are not found in the US.
SELECT T1.growst, avg(T2.concen) FROM sampledata15 as T1 JOIN resultsdata15 as T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.growst
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Tell me the average pesticide residue for each state in the US where food is grown.
SELECT T1.variety FROM resultsdata15 as T2 JOIN sampledata15 as T1 ON T1.sample_pk = T2.sample_pk WHERE T2.commod = "AP" GROUP BY T1.variety ORDER BY sum(T2.concen) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which varieties of apple typically have higher pesticide levels?
SELECT commod FROM resultsdata15 WHERE concen > lod
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which commodities have the pesticides concentration much higher than their limit for detection?
SELECT lab FROM resultsdata15 GROUP BY lab ORDER BY count(*) DESC LIMIT 5
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Name top 5 labs with the maximum number of testing.
SELECT T1.country FROM sampledata15 as T1 JOIN resultsdata15 as T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.country ORDER BY sum(T2.concen) LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which country is the safest in terms of the pesticide concentration found in imported foods?
SELECT distst FROM sampledata15 GROUP BY distst ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which is the most popular state in the US in terms of commodities distribution?
SELECT max(concen) FROM resultsdata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What is the maximum pesticide concentration ever found in a commodity?
SELECT year, month, day FROM sampledata15 WHERE sample_pk = 3763
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. When is sample 3763 collected?
SELECT distst FROM sampledata15 WHERE commod = "AP" GROUP BY distst ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which state has the most apple collected?
SELECT growst FROM sampledata15 WHERE commod = "AP" GROUP BY growst ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which state has grow the most apples?
SELECT count(DISTINCT variety) FROM sampledata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. How many class of products are there?
SELECT site FROM sampledata15 WHERE sample_pk = 3763
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. what's the 4 digit collection code of sample 3763?
SELECT country FROM sampledata15 WHERE sample_pk = 6480 AND origin = 2
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. If sample 6480 is imported, which country is it originally from?
SELECT quantity FROM sampledata15 WHERE sample_pk = 9628
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. How many number of units are there in sample 9628?
SELECT testclass FROM resultsdata15 WHERE sample_pk = 7498
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the code for test for sample 7498?
SELECT confmethod FROM resultsdata15 as T2 JOIN sampledata15 as T1 ON T1.sample_pk = T2.sample_pk ORDER BY year, month, day DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the code for confirmation for the latest sample?
SELECT lab FROM resultsdata15 GROUP BY lab ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which lab has analyzed the most sample?
SELECT max(testclass) FROM resultsdata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the majority of test classification result?
SELECT conunit FROM resultsdata15 WHERE sample_pk = 3879
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the unit of measure for sample 3879?
SELECT conunit FROM resultsdata15 WHERE commod = "PO"
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the unit of measure used for the product commodity code PO?
SELECT mean FROM resultsdata15 WHERE commod = "AP"
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the mean result finding for product AP?
SELECT max(extract) FROM resultsdata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What's the most common extraction method?
SELECT lab FROM resultsdata15 GROUP BY lab ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which lab conduct of most number of tests?
SELECT lab FROM resultsdata15 WHERE commod = "AP"
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which lab is used for testing for prodict AP?
SELECT count(*) FROM sampledata15 WHERE origin = "2"
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. How many samples come from other countries?
SELECT commod FROM resultsdata15 WHERE mean = "A" GROUP BY commod ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What kind of food has been tested 'detect' most?
SELECT state FROM sampledata15 WHERE claim = "PO" GROUP BY state ORDER BY count(*) DESC LIMIT 1
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which state produce the most organic food?
SELECT max(country) FROM sampledata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Where do the US import the most food ?
SELECT max(commod) FROM resultsdata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. What kind of food has been test the most?
SELECT max(pestcode) FROM resultsdata15
Given the Table sampledata15 having columns as sample_pk has datatype number, state has datatype text, year has datatype text, month has datatype text, day has datatype text, site has datatype text, commod has datatype text, source_id has datatype text, variety has datatype text, origin has datatype text, country has datatype text, disttype has datatype text, commtype has datatype text, claim has datatype text, quantity has datatype number, growst has datatype text, packst has datatype text, distst has datatype text which has sample pk and Given the Table resultsdata15 having columns as sample_pk has datatype number, commod has datatype text, commtype has datatype text, lab has datatype text, pestcode has datatype text, testclass has datatype text, concen has datatype number, lod has datatype number, conunit has datatype text, confmethod has datatype text, confmethod2 has datatype text, annotate has datatype text, quantitate has datatype text, mean has datatype text, extract has datatype text, determin has datatype text which has sample pk. Answer the question by writing the appropriate SQL code. Which kind of pesticide is the easiest to be tested?
SELECT FIRE_YEAR FROM Fires GROUP BY FIRE_YEAR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which year has the most wildfires?
SELECT DISCOVERY_TIME FROM Fires GROUP BY DISCOVERY_TIME ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which time of day has the most wildfires?
SELECT STAT_CAUSE_DESCR FROM Fires GROUP BY STAT_CAUSE_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What are the most common causes of the wildfires?
SELECT avg(CONT_DATE - DISCOVERY_DATE) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How long does it take to control wildfires on average?
SELECT State FROM Fires GROUP BY State ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state has the most wildfires?
SELECT State FROM Fires ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state has the largest wildfire?
SELECT OWNER_DESCR FROM Fires GROUP BY OWNER_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What enrity is reponsible for managing the land at the point of origin of the most wildfires?
SELECT STAT_CAUSE_DESCR FROM Fires WHERE FIRE_YEAR BETWEEN 2000 AND 2005 GROUP BY STAT_CAUSE_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What was the most common cause of fire between 2000 and 2005?
SELECT count(*) FROM Fires WHERE FIRE_YEAR = 2006 AND FIRE_SIZE > 100
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many fires were more than 100 acres in 2006?
SELECT State FROM Fires WHERE FIRE_YEAR = 2001 GROUP BY State ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which states had the largest number of fires in 2001?
SELECT sum(FIRE_SIZE), FIRE_YEAR FROM Fires WHERE State = "CA" AND FIRE_YEAR BETWEEN 2000 AND 2005 GROUP BY FIRE_YEAR
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many acres burned in fires in California each year between 2000 and 2005?
SELECT FIRE_YEAR FROM Fires GROUP BY FIRE_YEAR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which year had the largest number of fires?
SELECT * FROM Fires WHERE State = "TX" AND STAT_CAUSE_DESCR LIKE "Campfire"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show all fires caused by campfires in Texas.
SELECT OWNER_DESCR FROM FIres WHERE State = "OR" AND FIRE_YEAR = 2015 ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Who was responsible for the land of the biggest fire in Oregon in 2015?
SELECT COUNTY FROM Fires WHERE State = "WA" AND FIRE_YEAR = 2012
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which counties in Washington had fires in 2012?
SELECT count(*) FROM Fires WHERE FIRE_YEAR = 2010 AND STAT_CAUSE_DESCR LIKE "%Arson%"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many arson-related fires were there in 2010?
SELECT count(DISTINCT FIRE_YEAR) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many years of data are recorded in this database?
SELECT avg(DISCOVERY_DATE) FROM Fires where FIRE_YEAR BETWEEN 2000 AND 2004
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Average date of year that fire was discovered from 2000~2004?
SELECT STAT_CAUSE_CODE FROM Fires GROUP BY STAT_CAUSE_CODE ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What’s the most common cause of the fire (code) in the database?
SELECT FIRE_YEAR FROM Fires ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What’s the year that have the largest acres in the fire area?
SELECT count(*) FROM Fires WHERE OWNER_DESCR = "MISSING/NOT SPECIFIED"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many missing / not specified name of the owner are there in the database?
SELECT COUNTY FROM Fires GROUP BY COUNTY ORDER BY count(*)
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What’s the county that contains most recorded burns in 2000 according to the database?
SELECT count(DISTINCT STAT_CAUSE_DESCR) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many distinct cause of the fire descriptions are there in the database?
SELECT sum(FIRE_SIZE) FROM Fires WHERE State = "NY" and FIRE_YEAR = "2006"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Sum of the acres burned in NC state in 2006?
SELECT * FROM Fires WHERE State = "UT" AND FIRE_YEAR = 1997 ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What was the cause of the largest wildfire in Utah in the year 1997?
SELECT count(*) FROM Fires WHERE COUNTY = "Gloucester" AND FIRE_SIZE > 10
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many wildfires in Gloucester county have been larger than 10 acres?
SELECT State FROM Fires GROUP BY State ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state experiences the most wildfires?
SELECT STAT_CAUSE_DESCR FROM Fires GROUP BY STAT_CAUSE_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the leading cause of wildfires?
SELECT OWNER_DESCR FROM Fires GROUP BY OWNER_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. On what type of land (public or private) do more wildfires occur?
SELECT count(*) FROM Fires WHERE STAT_CAUSE_DESCR LIKE "%Campfire%" AND FIRE_YEAR = 2014
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. In 2014, how many wildfires were the result of mismanaged campfires?
SELECT sum(FIRE_SIZE) FROM Fires WHERE State = "TX" AND FIRE_YEAR BETWEEN 2000 AND 2010
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many total acres of land in Texas have seen a wildfire in the decade between 2000-2010?
SELECT State FROM Fires GROUP BY State ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state has the most number of fires being recorded?
SELECT STAT_CAUSE_DESCR FROM Fires GROUP BY STAT_CAUSE_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the most common reason that causes a fire?
SELECT sum(FIRE_SIZE) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the total area that has been burned until now?
SELECT sum(FIRE_SIZE) FROM Fires WHERE STATE = "TX" AND FIRE_YEAR BETWEEN 2000 AND 2010 UNION SELECT sum(FIRE_SIZE) FROM Fires WHERE STATE = "TX" AND FIRE_YEAR BETWEEN 1990 AND 2000
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many acres burned in 2000s and 1990s?
SELECT count(*) FROM Fires WHERE OWNER_DESCR = "MISSING/NOT SPECIFIED"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many fire cases occur on the land without any owner?
SELECT LATITUDE FROM Fires GROUP BY LATITUDE ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the latitudinal band that is most likely to experience wildfires in the USA?
SELECT * FROM Fires WHERE State = "TX" AND STAT_CAUSE_DESCR LIKE "Campfire"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Show all fires caused by campfires in Texas.
SELECT OWNER_DESCR FROM FIres WHERE State = "OR" AND FIRE_YEAR = 2015 ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Who was responsible for the land of the biggest fire in Oregon in 2015?
SELECT COUNTY FROM Fires WHERE State = "WA" AND FIRE_YEAR = 2012
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which counties in Washington had fires in 2012?
SELECT count(*) FROM Fires WHERE FIRE_YEAR = 2010 AND STAT_CAUSE_DESCR LIKE "%Arson%"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many arson-related fires were there in 2010?
SELECT count(DISTINCT FIRE_YEAR) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many years of data are recorded in this database?
SELECT avg(DISCOVERY_DATE) FROM Fires where FIRE_YEAR BETWEEN 2000 AND 2004
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Average date of year that fire was discovered from 2000~2004?
SELECT STAT_CAUSE_CODE FROM Fires GROUP BY STAT_CAUSE_CODE ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What’s the most common cause of the fire (code) in the database?
SELECT FIRE_YEAR FROM Fires ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What’s the year that have the largest acres in the fire area?
SELECT count(*) FROM Fires WHERE OWNER_DESCR = "MISSING/NOT SPECIFIED"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many missing / not specified name of the owner are there in the database?
SELECT COUNTY FROM Fires GROUP BY COUNTY ORDER BY count(*)
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What’s the county that contains most recorded burns in 2000 according to the database?
SELECT count(DISTINCT STAT_CAUSE_DESCR) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many distinct cause of the fire descriptions are there in the database?
SELECT sum(FIRE_SIZE) FROM Fires WHERE State = "NY" and FIRE_YEAR = "2006"
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Sum of the acres burned in NC state in 2006?
SELECT * FROM Fires WHERE State = "UT" AND FIRE_YEAR = 1997 ORDER BY FIRE_SIZE DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What was the cause of the largest wildfire in Utah in the year 1997?
SELECT count(*) FROM Fires WHERE COUNTY = "Gloucester" AND FIRE_SIZE > 10
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many wildfires in Gloucester county have been larger than 10 acres?
SELECT State FROM Fires GROUP BY State ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state experiences the most wildfires?
SELECT STAT_CAUSE_DESCR FROM Fires GROUP BY STAT_CAUSE_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the leading cause of wildfires?
SELECT OWNER_DESCR FROM Fires GROUP BY OWNER_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. On what type of land (public or private) do more wildfires occur?
SELECT count(*) FROM Fires WHERE STAT_CAUSE_DESCR LIKE "%Campfire%" AND FIRE_YEAR = 2014
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. In 2014, how many wildfires were the result of mismanaged campfires?
SELECT sum(FIRE_SIZE) FROM Fires WHERE State = "TX" AND FIRE_YEAR BETWEEN 2000 AND 2010
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many total acres of land in Texas have seen a wildfire in the decade between 2000-2010?
SELECT State FROM Fires GROUP BY State ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. Which state has the most number of fires being recorded?
SELECT STAT_CAUSE_DESCR FROM Fires GROUP BY STAT_CAUSE_DESCR ORDER BY count(*) DESC LIMIT 1
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the most common reason that causes a fire?
SELECT sum(FIRE_SIZE) FROM Fires
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. What is the total area that has been burned until now?
SELECT sum(FIRE_SIZE) FROM Fires WHERE STATE = "TX" AND FIRE_YEAR BETWEEN 2000 AND 2010 UNION SELECT sum(FIRE_SIZE) FROM Fires WHERE STATE = "TX" AND FIRE_YEAR BETWEEN 1990 AND 2000
Given the Table fires having columns as FIRE_YEAR has datatype number, DISCOVERY_DATE has datatype number, DISCOVERY_DOY has datatype number, DISCOVERY_TIME has datatype text, STAT_CAUSE_CODE has datatype number, STAT_CAUSE_DESCR has datatype text, CONT_DATE has datatype text, CONT_DOY has datatype text, CONT_TIME has datatype text, FIRE_SIZE has datatype number, FIRE_SIZE_CLASS has datatype text, LATITUDE has datatype number, LONGITUDE has datatype number, OWNER_CODE has datatype number, OWNER_DESCR has datatype text, STATE has datatype text, COUNTY has datatype text, FIPS_CODE has datatype text, FIPS_NAME has datatype text which has NO_PRIMARY_KEY. Answer the question by writing the appropriate SQL code. How many acres burned in 2000s and 1990s?