-- Query #1

@@ = full text search

title_tsv @@ plainto_tsquery('this is what the user typed')


-- Query #2
% = similarity search

SELECT set_limit(0.5);

SELECT publ.title, book.title
FROM publ,
  (SELECT 'Principles of Database Management') AS book(title)
WHERE publ.title % book.title


-- Query #3

SELECT DISTINCT b.author
FROM auth AS a
  -- same paper, but different author
  JOIN auth AS b ON a.dblp_key = b.dblp_key
                 AND a.author <> b.author
WHERE a.author = 'Jennifer Widom'
  AND (a_number_of_pub) < (b_number_of_pub)
ORDER BY b.author


-- Query #4

combine examples in erdos.sql with flight.sql


-- Query #5

straightforward; just use DISTINCT


-- Query #6

use DISTINCT in subquery to filter out duplicates


-- Query #7

SELECT DISTINCT nbr, subject, number, enrolled,
  rank() OVER...


-- Query #8

Turn query #7 into a sub query
  then aggregate the results
    then rank those results
