NOTE: This page is experimental. Bug reports to carter.barry@gmail.com. Query language is SQLite3.

Prepend rss. to the URL for an RSS feed, csv. to the URL for CSV output.

QUERY: SELECT long_desc, nt.name, n.amount AS "Amount (100g serving)
(in grams or calories)"FROM food f JOIN nutrition n ON (f.id = n.food_id) JOIN nutrient nt ON (nt.id = n.nutrient_id) WHERE f.id = (SELECT id FROM food ORDER BY RANDOM() LIMIT 1) AND nutrient_id IN ( 208,204,606,601,307,205,291,269,203) ORDER BY (CASE WHEN nt.id=208 THEN 1 WHEN nt.id=204 THEN 2 WHEN nt.id=606 THEN 3 WHEN nt.id=601 THEN 4 WHEN nt.id=307 THEN 5 WHEN nt.id=205 THEN 6 WHEN nt.id=291 THEN 7 WHEN nt.id=269 THEN 8 WHEN nt.id=203 THEN 9 END)

To edit query (or if query above is munged), see textbox at bottom of page

Empty result may indicate error: I'm not sure why my error checking code isn't working.

Source code

Enter query below (must start w/ SELECT):

Schema Raw SQLite3 db RSS feed for this query