Find the median value in a table with two columns

Given a table of data with two columns, write a SQL query to find the median value in the second column.

Problem

Given a table of data with two columns, write a SQL query to find the median value in the second column.
Example input:
id | value
---|------
1  | 3
2  | 5
3  | 7
4  | 9
Example output:
5

Solution

This solution is in SQL. Our A.I. can create solutions in multiple languages.
by sarastevens
/*

The solution below is optimal because it uses the median function, which is a built-in function in SQL.

*/

SELECT MEDIAN(value) FROM table;

A.I. Evaluation of the Solution

The candidate's solution is correct and uses the median function, which is a built-in function in SQL.

Evaluated at: 2022-11-18 04:15:48