OVER: Turns an aggregate or window function into a window — it computes per row WITHOUT collapsing rows like GROUP BY does. OVER turns an aggregate function into a window function. Instead of collapsing rows into one result, like GROUP BY does, it calculates the value for each row while keeping all rows.
SELECT name, salary, AVG(salary) OVER () AS company_avg FROM employees shows every employee with the company average next to them. That makes comparisons like "how far above average is each person" a single query.
What should you keep in mind with OVER?
Inside OVER, PARTITION BY restarts the calculation per group and ORDER BY defines the order, which enables running totals and rankings with functions like ROW_NUMBER() and RANK(). Window functions replace many awkward self-joins and much application-side processing. MySQL 8, PostgreSQL and SQLite all support them, so they are available in most current stacks.
What does an example of OVER look like?
SELECT name, salary, AVG(salary) OVER () AS company_avg FROM employees;