Views are named queries with pseudo-tables containing their output. Materialized views cache query results in persistent structures. Materialized views are available in PostgreSQL, Oracle, SQL Server, and select others
DATEPART and EXTRACT functions return integer parts of date/time values. Functions support only datetime or timestamp-based table columns. Both functions can be used in SELECT statements and WHERE clauses
Minimize wildcard characters to avoid table scans. Use indexes to speed up query performance. Choose appropriate data types for columns. Avoid subqueries and use JOINs instead. Use LIMIT/TOP to restrict row returns
UPDATE modifies values in rows satisfying specified conditions. Only modified columns need explicit specification in SET clause. Can modify tables using sub-selects or FROM clause. Optional RETURNING clause computes values based on updated rows
Simple query using GETDATE() and month offset works for SQL Server 2009. SQL Server 2012 introduced EOMONTH function for month first. SQL Server 2022 added DATETRUNC function for this purpose
Oracle's ROWNUM pseudo-column evaluates before order by, unlike MySQL's LIMIT. ROWNUM doesn't allow specifying offsets or returning random rows