“気温”表の2011年の7月1日から8月31日までの間で,最高気温が35度以上のレコードを全て抽出したい。抽出条件として,適切なものはどれか。 気温
| 年 | 月 | 日 | 最高気温 |
|---|---|---|---|
| 2011 | 1 | 1 | 12 |
| 2011 | 1 | 2 | 11 |
| 2011 | 1 | 3 | 9 |
| : | : | : | : |
| 2011 | 7 | 31 | 34 |
| 2011 | 8 | 1 | 36 |
| : | : | : | : |
| 2011 | 12 | 31 | 10 |
| 2012 | 1 | 1 | 11 |
This question's explanation and your answers so far.
“気温”表の2011年の7月1日から8月31日までの間で,最高気温が35度以上のレコードを全て抽出したい。抽出条件として,適切なものはどれか。 気温
| 年 | 月 | 日 | 最高気温 |
|---|---|---|---|
| 2011 | 1 | 1 | 12 |
| 2011 | 1 | 2 | 11 |
| 2011 | 1 | 3 | 9 |
| : | : | : | : |
| 2011 | 7 | 31 | 34 |
| 2011 | 8 | 1 | 36 |
| : | : | : | : |
| 2011 | 12 | 31 | 10 |
| 2012 | 1 | 1 | 11 |
The month condition is (Month = 7 and Month = 8), but a single record's month can never be both 7 and 8 at the same time, so the parentheses are always false and not a single record is extracted. In addition, Max temperature ≦ 35 means “35 degrees or lower”, the opposite of the required “35 degrees or higher”. Wrong on two counts.
Max temperature ≧ 35 is correct, but the month condition (Month = 7 and Month = 8) uses and, and no record is both July and August at once, so the result is empty. To collect both July and August, or is required.
The month condition (Month = 7 or Month = 8) is correct, but Max temperature ≦ 35 means “35 degrees or lower”, the opposite of the required “35 degrees or higher”, so it picks up records on the low-temperature side.
正解 The records to extract are those satisfying all three conditions: “2011”, “July 1 to August 31”, and “max temperature 35 degrees or higher”. Choice エ is Year = 2011 and (Month = 7 or Month = 8) and Max temperature ≧ 35, which correctly expresses these three conditions. The key point is how the month is specified: since each record has only one month value, to collect both the July and August records you must join them with or as “Month = 7 or Month = 8”. Also, “35 degrees or higher” includes 35 and extends upward, so Max temperature ≧ 35 is correct. Therefore エ is appropriate.