Write SQL to compute max and min marks
Problem Description
You are given a table named marks with the following schema:
marks Table
| column | type | notes |
|---|---|---|
student_id | INT | primary key |
marks | INT | not null |
Task
Your task is to write a SQL query that returns a single row containing two columns:
max_marks: The maximum value found in themarkscolumn.min_marks: The minimum value found in themarkscolumn.
Expected Output
The query should produce a single row with the columns (max_marks, min_marks).
AI interview prep
Core dilemma
Ensuring fundamental SQL correctness and efficiency for aggregate computations, while considering potential edge cases and performance implications at scale.
2 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Write SQL to compute max and min marks
Problem Description
You are given a table named marks with the following schema:
marks Table
| column | type | notes |
|---|---|---|
student_id | INT | primary key |
marks | INT | not null |
Task
Your task is to write a SQL query that returns a single row containing two columns:
max_marks: The maximum value found in themarkscolumn.min_marks: The minimum value found in themarkscolumn.
Expected Output
The query should produce a single row with the columns (max_marks, min_marks).