-- 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;
