The following query results in 2,698 rows of data being retrieved, but the auditor_report table only has 1,620 rows. Analyse the query and select the reason why this discrepancy occurs.
Mysql
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Sandhiya PriyaRank #26 · 43.2K reputationPosted Oct 14, 2025, 2:26 AM EDT
Question:
Answer:
The discrepancy occurs because the query uses a JOIN (most likely an
INNER JOINorLEFT JOIN) that matches multiple rows from another table for each record inauditor_report.When a join condition is not unique — for example, if the joined table has duplicate matching keys — the result set will multiply rows.
Each matching combination between the two tables will create a new row in the output, leading to more rows than exist in the base table.
Example:
If:
auditor_reporthas 1,620 rows,auditor_detailshas multiple rows for eachreport_id,then the result may expand to 2,698 rows or more, depending on how many matches exist per report.
In short:
Tip:
To verify, you can run:
SELECT report_id, COUNT(*) FROM auditor_details GROUP BY report_id HAVING COUNT(*) > 1;This will show which
report_ids cause duplicates in the join.