Challenge: Flag Suspicious Transactions
You have explored logical functions in SQL, learning how to use them to make decisions based on data values. In this challenge, you will apply that knowledge to identify potentially suspicious transactions in a payments table. Your goal is to flag transactions as "Suspicious" if their amount is greater than or equal to 1000, or if their status is "failed". This is a common scenario in fraud detection and risk management, where it is important to highlight transactions that require further review.
Swipe to start coding
Write a query to flag transactions as "Suspicious" if the amount is greater than or equal to 1000, or if the status is "failed". Otherwise, flag the transaction as "Normal".
- Add a column named
flagto the result. - Set
flagto "Suspicious" ifamountis greater than or equal to 1000 orstatusis "failed". - Set
flagto "Normal" for all other transactions.
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 2.86
Challenge: Flag Suspicious Transactions
Stryg for at vise menuen
You have explored logical functions in SQL, learning how to use them to make decisions based on data values. In this challenge, you will apply that knowledge to identify potentially suspicious transactions in a payments table. Your goal is to flag transactions as "Suspicious" if their amount is greater than or equal to 1000, or if their status is "failed". This is a common scenario in fraud detection and risk management, where it is important to highlight transactions that require further review.
Swipe to start coding
Write a query to flag transactions as "Suspicious" if the amount is greater than or equal to 1000, or if the status is "failed". Otherwise, flag the transaction as "Normal".
- Add a column named
flagto the result. - Set
flagto "Suspicious" ifamountis greater than or equal to 1000 orstatusis "failed". - Set
flagto "Normal" for all other transactions.
Løsning
Tak for dine kommentarer!
single