Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Detect Duplicate Transactions | Data Accuracy, Reconciliation, and Transaction Logic
SQL for Finance and Accounting

bookChallenge: Detect Duplicate Transactions

Task

Swipe to start coding

Write an SQL query to identify accounts where the recorded balance in the balances table does not match the sum of all their transactions in the bank_transactions table. This helps ensure that account balances reflect the actual transaction history.

  • Calculate the net transaction sum for each account by summing deposits and subtracting withdrawals from the bank_transactions table.
  • Compare this calculated sum to the balance recorded in the balances table for each account.
  • Return the account_id, the recorded balance, and the calculated transaction sum for any account where these values do not match.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Detect Duplicate Transactions

Swipe to show menu

Task

Swipe to start coding

Write an SQL query to identify accounts where the recorded balance in the balances table does not match the sum of all their transactions in the bank_transactions table. This helps ensure that account balances reflect the actual transaction history.

  • Calculate the net transaction sum for each account by summing deposits and subtracting withdrawals from the bank_transactions table.
  • Compare this calculated sum to the balance recorded in the balances table for each account.
  • Return the account_id, the recorded balance, and the calculated transaction sum for any account where these values do not match.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 2
single

single

some-alt