18 Matching Annotations
  1. Mar 2018
    1. Points of interest:

      • Uses regular expressions -- fancy pattern matching -- to scan the text of annotations

      • This one just looks for ?, the idea being a teacher is looking for students asking questions

      • Could also look for dates, currency, links, images, videos, lots of things

    1. Points of interest

      • A highlight is an annotation with no text or tags.

      • This query has to perform some gymnastics to find the set of annotations that meet those two conditions

      • Gymnastics also required for the percentages

      • This pattern work for other things like: annotations vs pagenotes, public vs private, etc.

    1. Aspects of interest

      • Accesses the user_group table

      • Quotes the "group" field to distinguish it from the group keyword

      • Applies the lower string function to make matching more robust

      • Joins the user_group and group tables in order to show user counts per group

    1. Aspects of interest:

      • Uses WITH ("WITH provides a way to write auxiliary statements for use in a larger query. These statements can be thought of as defining temporary tables that exist just for one query")

      • Uses wildcard to match tlds: .edu, .ac.uk

      • Uses regular expression to match subdomains of email addresses (e.g. cornell. nyu)

      • uses array indexing to slice the regexp match

      • use || operator to join strings

      -