79594511

Date: 2025-04-26 23:21:27
Score: 0.5
Natty:
Report link

Without another bridging condition to tell whether the sender on a comment record is the buyer or the seller, the query is under-constrained and COUNT of anything will return the COUNT of the under-constrained Cartesian product, i.e. GROUPing BY only order_id here.

This is because "senders" in the comment system are a completely independent role from buyer or selling in the order system, stemming from "order_responses" having a composite primary key - i.e. order_responses.order_id, unlike order_responses ( order_id, response_id ), is not a key in its own right that can be joined to alone without the addition further binding conditions found as foreign keys elsewhere, e.g. if "orders" had a FOREIGN KEY to requests ( request_id ) that allowed us to separately find a deterministic link to buyer_id.

We would need additional bridging journal entries as an (INNER) JOIN, as exist in the comment_receivers table, to pare down who is sending what to whom here by eliminating records.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: JJ Ward