Step 1: Understanding the Question:
The question asks us to identify which of the given SQL functions are single-row (scalar) functions as opposed to multiple-row (aggregate or group) functions.
Step 2: Key Formula or Approach:
In SQL, functions are categorized into two main groups:
1. Single-Row Functions: These functions operate on a single row at a time and return one output value for each row. Examples include numeric, character, and date functions like MOD(), DAY(), ROUND(), UPPER(), etc.
2. Multiple-Row (Aggregate) Functions: These functions operate on groups of rows to return a single summarized result. Examples include SUM(), MAX(), MIN(), AVG(), and COUNT().
Step 3: Detailed Explanation:
Let's analyze each option:
- A. MAX(): This is an aggregate function that finds the maximum value across a set of rows. It is not a single-row function.
- B. SUM(): This is also an aggregate function that calculates the total sum of values in a column across multiple rows. It is not a single-row function.
- C. MOD(): This is a mathematical single-row function that returns the remainder of a division for a specific numeric value in each row. It operates on a single row at a time.
- D. DAY(): This is a date-handling single-row function that extracts the day of the month from a date value in a specific row. It operates on each row individually.
Therefore, C and D are single-row functions, while A and B are aggregate functions.
This leads us to the combination "C and D only", which is option (D).
Step 4: Final Answer:
The correct option is (D), representing single-row functions C and D.