First Commit

This commit is contained in:
2026-05-19 14:32:46 +07:00
parent 73a8a01048
commit b3d162450d
20 changed files with 6543 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
-- All batches today (based on cutoff logic)
SELECT *
FROM batches
WHERE counting_date = (SELECT counting_date FROM daily_summaries ORDER BY updated_at DESC LIMIT 1)
ORDER BY batch_number;
-- Daily summary
SELECT counting_date,
total_count AS total_ayam,
total_batches AS jumlah_batch
FROM daily_summaries
ORDER BY counting_date DESC;
-- Average objects per batch per day
SELECT counting_date,
ROUND(CAST(total_count AS FLOAT) / total_batches, 1) AS avg_per_batch
FROM daily_summaries;