Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Summarize Transaction Status | Logical Functions
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Functions in SQL

bookChallenge: Summarize Transaction Status

Task

Swipe to start coding

Write a query to count the number of transactions for each status in the transactions table using the CASE statement.

  • Count the number of transactions where status is 'completed' and return this as completed_count.
  • Count the number of transactions where status is 'pending' and return this as pending_count.
  • Count the number of transactions where status is 'failed' and return this as failed_count.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 4. ChapterΒ 6
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: Summarize Transaction Status

Swipe to show menu

Task

Swipe to start coding

Write a query to count the number of transactions for each status in the transactions table using the CASE statement.

  • Count the number of transactions where status is 'completed' and return this as completed_count.
  • Count the number of transactions where status is 'pending' and return this as pending_count.
  • Count the number of transactions where status is 'failed' and return this as failed_count.

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Β 6
single

single

some-alt