Hard1 markMultiple Choice
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'?
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
Q01A CPA is advising a client who is migrating their legacy on-premise ERP system to a cloud environ...HardQ02An auditor is reviewing the Service Level Agreement (SLA) for a client using a public cloud provi...HardQ03A company uses an Infrastructure as a Service (IaaS) model. During an IT audit, the auditor disco...HardQ04An organization is implementing the COSO Enterprise Risk Management (ERM) framework to govern its...HardQ05During a walkthrough of an order-to-cash process, the auditor observes that the sales manager can...Hard
Expert