Hard1 markMultiple Choice
Area I: Information SystemsSQLData AnalysisArea I

CPA · Question 20 · Area I: Information Systems

Which of the following SQL statements would be most useful for an auditor attempting to identify duplicate invoice numbers in a table named 'Invoices'?

Answer options:

A.

SELECT DISTINCT InvoiceNum FROM Invoices

B.

SELECT * FROM Invoices ORDER BY InvoiceNum

C.

SELECT InvoiceNum, COUNT() FROM Invoices GROUP BY InvoiceNum HAVING COUNT() > 1

D.

SELECT InvoiceNum FROM Invoices WHERE InvoiceNum IS NOT NULL

How to approach this question

To find duplicates, you need to count occurrences of each item and look for counts > 1. This requires GROUP BY and HAVING.

Full Answer

C.SELECT InvoiceNum, COUNT(*) FROM Invoices GROUP BY InvoiceNum HAVING COUNT(*) > 1✓ Correct
The GROUP BY clause groups rows with the same values, and HAVING COUNT(*) > 1 filters those groups to show only the ones that appear multiple times (duplicates).

Common mistakes

Using DISTINCT (which removes duplicates) instead of finding them.

Practice the full CPA ISC Practice Exam 4

82 questions · hints · full answers · grading

More questions from this exam