• Skip to primary navigation
  • Skip to content
  • Skip to footer
Thomas Ngo Thomas Ngo
  • Home
  • Journal
  • Tags
  • About

    Thomas Ngo

    Software Engineer

    • Stanton, California
    • Email
    • GitHub
    • Resume

    SQL problem - List the Products Ordered in a Period

    March 3, 2024 less than 1 minute read

    Page Navigation

    • Problem
    • Query

    Problem

    problem-1327

    Query

    SELECT
        p.product_name,
        SUM(o.unit) as unit
    FROM
        Products p,
        Orders o
    WHERE
        p.product_id = o.product_id
        AND YEAR(o.order_date) = 2020
        AND MONTH(o.order_date) = 2
    GROUP BY
        product_name
    HAVING
        SUM(o.unit) >= 100
    

    Tags: SQL

    Updated: March 3, 2024

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    You may also enjoy

    Problem of The Day: Delete the Middle Node of a Linked List

    December 17, 2025 1 minute read

    Problem Statement

    Problem of The Day: Dota2 Senate

    December 15, 2025 4 minute read

    Problem Statement

    Problem of The Day: Number of Recent Calls

    December 14, 2025 less than 1 minute read

    Problem Statement

    Problem of The Day: Decode String

    December 14, 2025 1 minute read

    Problem Statement

    • Follow:
    • GitHub
    • LinkedIn
    © 2025 Thomas Ngo.