Database calculations, sorting and searching
도입됨이 수업의 내용
| English | 의미 |
|---|---|
| sort/sɔːt/ | |
| calculated field | |
| query/ˈkwɪərɪ/ | A request to retrieve or manipulate information, especially data in a database. |
| calculated control | |
| ascending/əˈsendɪŋ/ | |
| descending/dɪˈsendɪŋ/ | |
| operator/ˈɒpəreɪtə/ | Symbols or keywords specifying operations to perform on values or expressions. |
| wildcard/ˈwaɪldkɑːd/ |
Ask the database a question
- Databases calculate new values, sort 排序 records and search with queries. The practical exam tests all three.
Calculations
- A calculated field 计算字段 in a query 查询 works out a value per record:
Total: [Price]*[Quantity]. - A calculated control 计算控件 in a report shows a result:
=Sum([Total]). Functions: Sum, Avg, Max, Min, Count.
Which is a calculated field in a query?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
The =Sum(...) form is a calculated control in a report.
Sorting
- Ascending 升序: A→Z, 0→9, oldest first. Descending 降序: the reverse.
- A second criterion orders ties: Surname, then FirstName.
Records are sorted by Surname, then FirstName. When is FirstName used?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
The second criterion breaks ties.
Descending order sorts numbers from 9 to 0.
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
Ascending is 0 to 9.
Queries
| operator 运算符 | example |
|---|---|
= <> |
Colour <> "Red" |
> < >= <= |
Price >= 100 |
AND |
Price < 50 AND Stock > 0 |
OR |
Colour = "Red" OR Colour = "Blue" |
NOT |
NOT "London" |
LIKE + wildcards 通配符 |
LIKE "T*"; ? one character |
Red or blue cars under 20 000, newest first: (Colour = "Red" OR Colour = "Blue") AND Price < 20000, sorted by Year descending. Without brackets every red car is selected whatever its price.
Match each criterion to what it finds.
난이도 2/5 · 140코인 + 오늘 첫 완료 시 작은 보너스 추가
- means any number of characters.
Which criteria find red or blue cars under 20 000?
난이도 1/5 · 100코인 + 오늘 첫 완료 시 작은 보너스 추가
The brackets keep the OR together.
Bracket the OR when mixing with AND. Otherwise AND binds first and the results are wrong.
Calculated fields work per record; calculated controls summarise. Sort ascending or descending with tie-breakers. Queries use comparison operators, AND, OR, NOT and wildcards.
어떤 문제가 있었나요? 사이트 팀만 이 내용을 볼 수 있습니다.