File size: 4,815 Bytes
5716a3a
95707b2
5716a3a
 
 
 
 
 
 
 
95707b2
5716a3a
 
 
 
 
 
 
95707b2
5716a3a
 
 
 
 
 
 
95707b2
5716a3a
 
 
 
 
 
 
95707b2
5716a3a
 
 
 
 
 
 
95707b2
5716a3a
2194233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
from sql_env.models import SQLTask
from sql_env.grader import grade

EASY_TASKS = [
    SQLTask(
        task_id="easy_001",
        difficulty="easy",
        broken_query="SELECT * FORM users WHERE id = 1",
        canonical_answer="SELECT * FROM users WHERE id = 1",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_002",
        difficulty="easy",
        broken_query="SELECT name, age FORM employees WHERE department = 'HR'",
        canonical_answer="SELECT name, age FROM employees WHERE department = 'HR'",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_003",
        difficulty="easy",
        broken_query="SELECT * FROM products WEHRE price > 100",
        canonical_answer="SELECT * FROM products WHERE price > 100",
        error_hint="There is a typo in the filtering keyword.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_004",
        difficulty="easy",
        broken_query="SELCT id, name FROM customers",
        canonical_answer="SELECT id, name FROM customers",
        error_hint="There is a typo in the first keyword of the query.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_005",
        difficulty="easy",
        broken_query="SELECT COUNT(*) FORM orders WHERE status = 'pending'",
        canonical_answer="SELECT COUNT(*) FROM orders WHERE status = 'pending'",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_006",
        difficulty="easy",
        broken_query="SELECT id, email FORM users WHERE active = 1",
        canonical_answer="SELECT id, email FROM users WHERE active = 1",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_007",
        difficulty="easy",
        broken_query="SELECT * FROM invoices WEHRE amount > 500",
        canonical_answer="SELECT * FROM invoices WHERE amount > 500",
        error_hint="There is a typo in the filtering keyword.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_008",
        difficulty="easy",
        broken_query="SELCT title, author FROM books",
        canonical_answer="SELECT title, author FROM books",
        error_hint="There is a typo in the first keyword of the query.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_009",
        difficulty="easy",
        broken_query="SELECT name FORM departments WHERE location = 'NYC'",
        canonical_answer="SELECT name FROM departments WHERE location = 'NYC'",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_010",
        difficulty="easy",
        broken_query="SELECT product_name, price FROM catalog WEHRE category = 'electronics'",
        canonical_answer="SELECT product_name, price FROM catalog WHERE category = 'electronics'",
        error_hint="There is a typo in the filtering keyword.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_011",
        difficulty="easy",
        broken_query="SELECT * FORM sessions WHERE user_id = 42",
        canonical_answer="SELECT * FROM sessions WHERE user_id = 42",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_012",
        difficulty="easy",
        broken_query="SELCT COUNT(*) FROM transactions WHERE type = 'credit'",
        canonical_answer="SELECT COUNT(*) FROM transactions WHERE type = 'credit'",
        error_hint="There is a typo in the first keyword of the query.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_013",
        difficulty="easy",
        broken_query="SELECT username, created_at FORM accounts WHERE verified = 1",
        canonical_answer="SELECT username, created_at FROM accounts WHERE verified = 1",
        error_hint="There is a typo in a SQL keyword near the table name.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_014",
        difficulty="easy",
        broken_query="SELECT * FROM reports WEHRE year = 2024",
        canonical_answer="SELECT * FROM reports WHERE year = 2024",
        error_hint="There is a typo in the filtering keyword.",
        grader=grade,
    ),
    SQLTask(
        task_id="easy_015",
        difficulty="easy",
        broken_query="SELCT AVG(score) FROM results WHERE subject = 'math'",
        canonical_answer="SELECT AVG(score) FROM results WHERE subject = 'math'",
        error_hint="There is a typo in the first keyword of the query.",
        grader=grade,
    ),
]