Week 05

Wrapping up SQL

Stored Procedures

Minor Video Correction

In the get_best procedure, I forgot to ORDER BY grade DESC. The in the video, the procedure actually returns the student with the lowest grade.

Case Statements and Functions

Minor Video Correction

SQLite's case expression (it doesn't have CASE statements) has a slightly different syntax than shown in the video. It looks like this:

UPDATE table_name SET column_name = CASE
    WHEN cond1 THEN expr1
    WHEN cond2 THEN expr2
    WHEN cond3 THEN expr3
    ELSE expr4
END;

Aggregate Functions and Collations

Adapters and Converters

Tables and Triggers

Views

Indices