Leetcode Problem 1821. Find Customers With Positive Revenue this Year

1821. Find Customers With Positive Revenue this Year

Leetcode Solutions

Simple Selection with Condition

  1. Write a SELECT statement to retrieve the customer_id.
  2. Use the WHERE clause to filter the results where year equals 2021.
  3. Add an additional condition in the WHERE clause to check that revenue is greater than 0.
  4. Execute the query to obtain the desired result set.

erDiagram
    Customers {
        int customer_id
        int year
        int revenue
        customer_id year } --||--|{ revenue : has
}

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...