update comment/syntax: tables_aux.sql (no changes)
authorShane Jaroch <chown_tee@proton.me>
Sun, 25 Feb 2024 16:33:37 +0000 (11:33 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sun, 25 Feb 2024 16:33:51 +0000 (11:33 -0500)
sql/tables_aux.sql

index 4aae5892b13105f2313660adf615a1a1eb535cf6..cb396ab83b61f5155cd736c1028475599f8a5245 100644 (file)
@@ -1,6 +1,7 @@
 -- NOTE: need to first run: fetch.sh
 .load ./extensions/stats
 -- Saves time intensive query in new table
+-- TODO: show nutrients_overview.id as a foreign key to nutr_def.id?
 CREATE TABLE nutrients_overview AS
 SELECT
   id,
@@ -8,7 +9,7 @@ SELECT
   unit,
   tagname,
   nutr_desc,
-  CAST(COUNT(nut_data.nutr_id) AS INTEGER) AS n_foods,
+  CAST(COUNT(nut_data.nutr_id) AS integer) AS n_foods,
   CAST(ROUND(avg(nut_data.nutr_val), 3) AS real) AS avg_val,
   CAST(ROUND(stddev(nut_data.nutr_val), 2) AS real) AS std_dev
 FROM