Quick Overview

This question evaluates a candidate's ability to perform basic data aggregation in SQL, specifically computing summary statistics from a single table. It is commonly asked to assess competence in data manipulation and query result shaping within the Data Manipulation (SQL/Python) domain, focusing on practical application of SQL aggregation rather than purely conceptual theory.

Write SQL to compute max and min marks

Company: IBM

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Online Assessment

## Tables ### `marks` | column | type | notes | |---|---|---| | student_id | INT | primary key | | marks | INT | not null | ## Task Write a SQL query that returns a **single row** with: - `max_marks`: the maximum value of `marks` - `min_marks`: the minimum value of `marks` ### Output A single row with columns `(max_marks, min_marks)`.

Overview: This question evaluates a candidate's ability to perform basic data aggregation in SQL, specifically computing summary statistics from a single table. It is commonly asked to assess competence in data manipulation and query result shaping within the Data Manipulation (SQL/Python) domain, focusing on practical application of SQL aggregation rather than purely conceptual theory.

You are given a table named `marks` that stores students' marks. Write a SQL query to return the maximum mark and the minimum mark from the table. Return exactly two columns: - `max_marks`: the maximum value of `marks` - `min_marks`: the minimum value of `marks`

Tables

marks(student_id INT, marks INT)

Hints

  1. Use aggregate functions to compute the max and min across all rows.
  2. The result should be a single row with two columns.

Loading coding console...