You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
db_id: california_schools
question:
What is the highest eligible free rate for K-12 students in the schools in Alameda County?
evidence:
Eligible free rate for K-12 = FRPM Count (K-12) / Enrollment (K-12)
Gold SQL:
SELECT FRPM Count (K-12) / Enrollment (K-12)
FROM frpm
WHERE County Name = 'Alameda'
ORDER BY (CAST(FRPM Count (K-12) AS REAL) / Enrollment (K-12)) DESC LIMIT 1
SELECT MAX(Percent (%) Eligible Free (K-12))
FROM frpm
WHERE County Name = 'Alameda';
或者
SELECT Free Meal Count (K-12) / Enrollment (K-12)
FROM frpm
WHERE County Name = 'Alameda'
ORDER BY (CAST(Free Meal Count (K-12) AS REAL) / Enrollment (K-12)) DESC LIMIT 1
类似的问题可能还有不少。
Originally posted by @wbbeyourself in #39 (comment)
Re-posting this issue as it is not clear what was the conclusion on this one. Why do we use 'Free Meal Count (K-12)AS REAL) /Enrollment (K-12)' when the calculated column - Percent (%) Eligible Free (K-12) exists in the DB?
The text was updated successfully, but these errors were encountered:
在 california_schools/frpm.csv 中,eligible free rate = Free Meal Count / Enrollment,同时 column 【Percent (%) Eligible Free (K-12)】确实是 【Free Meal Count (K-12)】 / 【Enrollment (K-12)】。
但是在 dev set中第一条测试数据就存在错误:
原始数据:
db_id: california_schools
question:
What is the highest eligible free rate for K-12 students in the schools in Alameda County?
evidence:
Eligible free rate for K-12 = FRPM Count (K-12) / Enrollment (K-12)
Gold SQL:
SELECT FRPM Count (K-12) / Enrollment (K-12)
FROM frpm
WHERE County Name = 'Alameda'
ORDER BY (CAST(FRPM Count (K-12) AS REAL) / Enrollment (K-12)) DESC LIMIT 1
两处错误:
(1) evidence 错误,正确的应该为 : Eligible free rate for K-12 = Free Meal Count (K-12) / Enrollment (K-12)
(2) Gold SQL 写得复杂了,除法是多此一举。直接写成如下的即可,无需除法。因为 【Percent (%) Eligible Free (K-12)】就代表了 Eligible free rate for K-12
SELECT MAX(Percent (%) Eligible Free (K-12))
FROM frpm
WHERE County Name = 'Alameda';
或者
SELECT
Free Meal Count (K-12)
/Enrollment (K-12)
FROM frpm
WHERE
County Name
= 'Alameda'ORDER BY (CAST(
Free Meal Count (K-12)
AS REAL) /Enrollment (K-12)
) DESC LIMIT 1类似的问题可能还有不少。
Originally posted by @wbbeyourself in #39 (comment)
Re-posting this issue as it is not clear what was the conclusion on this one. Why do we use 'Free Meal Count (K-12)
AS REAL) /
Enrollment (K-12)' when the calculated column - Percent (%) Eligible Free (K-12) exists in the DB?The text was updated successfully, but these errors were encountered: