CASE is SQLs answer to other programming languages IF-ELSE statement. If you need to test a condition and return a value CASE is the expression you need.
Time for some fun with SQL aggregate functions, and Mariah Carey
Your database doesn’t just contain your data. It also contains data about your data.
Before you rage quit or call in your DBA, check these things aren’t slowing down your SQL query. A few tweaks could be all you need to get things working.
A high-level overview of why your DBA needs to VACUUM your tables
Your query is running slow, have you checked your indexes?
Joining tables is the first big learning curve after getting your head around SQL basics
CTEs are persisted temporary data sets, that allow you to store a single query to go back to later in your script.