Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Flag Suspicious Transactions | Logical Functions
Functions in SQL

bookChallenge: 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.

Tâche

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 flag to the result.
  • Set flag to "Suspicious" if amount is greater than or equal to 1000 or status is "failed".
  • Set flag to "Normal" for all other transactions.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 5
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Can you show me an example SQL query for this scenario?

What other conditions could be used to flag suspicious transactions?

Can you explain how logical functions work in SQL?

close

bookChallenge: Flag Suspicious Transactions

Glissez pour afficher le menu

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.

Tâche

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 flag to the result.
  • Set flag to "Suspicious" if amount is greater than or equal to 1000 or status is "failed".
  • Set flag to "Normal" for all other transactions.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 5
single

single

some-alt