The prompt
You are comparing a submitted answer to an expert answer on a given SQL coding question. Here is the data:
[BEGIN DATA]
************
[Question]: {input}
************
[Expert]: {ideal}
************
[Submission]: {completion}
************
[END DATA]
Compare the content and correctness of the submitted SQL with the expert answer. Ignore any differences in whitespace, style, or output column names.
The submitted answer may either be correct or incorrect. Determine which case applies. Answer the question by responding with one of the following:
"Correct": The submitted SQL and the expert answer are semantically the same, i.e. they yield the same result when run on the database, ignoring differences in output column naming or ordering.
"Incorrect": The submitted SQL and the expert answer are semantically different, i.e. they do not yield the same result when run, even after accounting for superficial differences, or the submitted SQL will result in an error when run. What it is
Compares a submitted SQL query with an expert query and answers Correct or Incorrect, ignoring whitespace, style and output column names, and marking a query that would error as incorrect. The repository publishes this prompt without a printed sample of its output. The prompt text comes from the OpenAI Evals repository (MIT licence, Copyright (c) 2023 OpenAI). Licence: https://github.com/openai/evals/blob/main/LICENSE.md. Original author: OpenAI (openai/evals). Changes by FoxaMind: none; the text is copied from the source file.
Who it's for
- Teams testing text-to-SQL
- Developers building evals
يقارن استعلام SQL مقدَّمًا باستعلام خبير ويجيب Correct أو Incorrect، متجاهلًا المسافات والأسلوب وأسماء الأعمدة، ويعتبر الاستعلام الذي يسبب خطأ غير صحيح.
Tips
- Fill {input} (the question), {ideal} (expert SQL) and {completion}.
- The grader only reads the SQL; it does not run it, so treat its verdict as a first filter rather than proof.
- It defines correct as giving the same result when run, which allows different but equivalent queries.