Learn how to calculate aggregate statistics in a SQLite query.
- [Instructor] For our program we'll need one more query.…This query will perform our averages and medians…for our weather metrics across a given time span.…The SQL string for this query is somewhat long,…so I'll define it separately from the function,…and I'll call it def avg-median-query…for average median query.…The select clause of this query…will contain the average and median functions.…So I'll use select avg, and then,…in parentheses, wind_speed.…
This will average the wind speed values.…Since the query function will use this select clause…to determine the keys to set in its response,…I'm gong to use as so that we can rename this key.…I'll name it avg_wind_speed.…Now when we get back the data,…the keyword will be avg_wind_speed…rather than the former one with parentheses in it.…When a keyword has parentheses in it,…you can't write it literally in Clojure,…and it becomes a bit awkward to deal with.…
Now I'll hit comma and Enter,…and I'll copy this select clause…for several weather metrics.…Gonna paste it and paste it again.…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.