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

single

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ย 1. Chapterย 24
single

single

Ask AI

expand

Ask AI

ChatGPT

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

some-alt