AlibabaResearch / AlibabaResearch/DAMO-ConvAI

Corrected SQL for `shooting` dataset in train set for date.

Đang mở
#216 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
1.6k
Fork
250
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Current entry:
```
{
"db_id": "shooting",
"question": "In which year has the greatest number of cases where Handgun was used as weapon?",
"evidence": "year refers to year(date); the greatest number of cases refers to max(count(case_number)); OS Spray was used as weapon refers to subject_weapon = 'OS Spray'",
"SQL": "SELECT STRFTIME('%Y', date) FROM incidents WHERE subject_weapon = 'Handgun' GROUP BY STRFTIME('%Y', date) ORDER BY COUNT(case_number) DESC LIMIT 1"
}
```

>> Output: null

This is because the date format is:
```
>> sqlite3 train/train_databases/shooting/shooting.sqlite "SELECT date from incidents LIMIT 10"

2015/2/9
2016/3/26
2016/4/16
2004/12/29
2007/2/12
2005/12/25
2006/2/11
2006/1/1
2008/4/18
2010/4/27
```

---

**Suggested corrected SQL: `"SELECT SUBSTR(date, 1, 4) FROM incidents WHERE subject_weapon = 'Handgun' GROUP BY SUBSTR(date, 1, 4) ORDER BY COUNT(case_number) DESC LIMIT 1"`**

```
>>> sqlite3 train/train_databases/shooting/shooting.sqlite "SELECT SUBSTR(date, 1, 4) FROM incidents WHERE subject_weapon = 'Handgun' GROUP BY SUBSTR(date, 1, 4) ORDER BY COUNT(case_number) DESC LIMIT 1"

2014
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.