ITPEC IP October 2024 Question 26
From a “Product” table and “Sales” table that are managed with a relational database, which of the following contains all and only the products where the total sales for each product in May is at least 20,000 yen?
Product
Sales
Explanation
Product B and Product C — total each product's May sales, found by SalesDate, and keep those of at least 20,000 yen.
May sales are the rows with SalesDate in May: Z00003, Z00004, Z00005, Z00006, Z00007. Join each to Product by ProductCode and multiply quantity by price:
- •A (0001): (5 + 4) × 2,000 = 18,000 yen — below the threshold
- •B (0002): (3 + 3) × 4,000 = 24,000 yen
- •C (0003): 3 × 7,000 = 21,000 yen
- •D (0004): its only sale is on 4/30, so no May sales
Answer (c)
Why not others:
- •(a) — includes A, whose May total is 18,000 yen; A reaches 24,000 only if the April 30 sale Z00002 is counted by its May delivery date
- •(b) — includes A and also D, whose only sale Z00001 was made on 4/30; only its delivery falls in May
- •(d) — omits B, which reaches 24,000 yen with its two May sales, including Z00007 sold on 5/30 and delivered in June
Key rule: Filter rows by the date column the question names (sales, not delivery) before grouping, then compare each group's total to the threshold.
Databases · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.