InferenceAI

Enter at least two characters to search.

Start free

Average Retrieval Score

easySQL for AI12 min10 XP

From retrievals(query_id, document_id, score), return each query_id and avg_score rounded to two decimals, highest average first.

Examples

EXAMPLE WALKTHROUGHquery averages

A guided view of the published example, not a trace of your code.

INPUT["CREATE TABLE retrievals(query_id INT,document_id INT,score REAL); INSERT INTO retrievals VALUES(1,1,.8),(1,2,.6),(2,3,.9);"]
TASKquery()
EXPECTED OUTPUT[[2,0.9],[1,0.7]]

Start with the input values shown in this example.

Input: CREATE TABLE retrievals(query_id INT,document_id INT,score REAL); INSERT INTO retrievals VALUES(1,1,.8),(1,2,.6),(2,3,.9);

Output: [[2,0.9],[1,0.7]]

Explanation: query averages

Hint 1

Check column aliases and required ordering.

Topics

SQLAnalyticsAI Systems