Char vs varchar
shape
LIMIT
/OFFSET
clause (for MySQL) or ROW_NUMBER()
function (for SQL Server, PostgreSQL, or Oracle). ROW_NUMBER()
function in SQL is a window function that assigns a unique sequential integer to rows within a result set. The numbering starts at 1 for the first row and increments by 1 for each subsequent row in the specified order. It is typically used to assign a rank or row number to rows in a result set based on a particular order. SELECT
, INSERT
, UPDATE
, or DELETE
statements and can help with complex queries where a direct comparison or condition is needed. GROUP BY
clause in MySQL is used to group rows that have the same values in specified columns into summary rows, often used with aggregate functions like COUNT()
, SUM()
, AVG()
, MIN()
, and MAX()
to perform calculations on each group. Essentially, it allows you to aggregate data across multiple rows and summarize it into a smaller set of results.