SQL reference
Every function, with what it does for a business, the Excel formula it replaces, how other databases spell it, and an example you can run. No ads in the way.
- =VLOOKUP()→JOINSQL JOIN: combine two tables (like VLOOKUP)
- =IFERROR(VLOOKUP())→LEFT JOINSQL LEFT JOIN: keep rows with no match
- =IFS()→CASE WHENSQL CASE WHEN: IF logic in a query
- =IF()→IIF()IF in SQL: IIF, IF() and CASE
- Filter ▾→WHERESQL WHERE: filter the rows you want
- Sort→ORDER BYSQL ORDER BY: sort your results
- PivotTable→GROUP BYSQL GROUP BY: totals per category
- Value Filters→HAVINGHAVING vs WHERE in SQL
- =COUNTA()→COUNT(*)SQL COUNT: count rows, values and blanks
- =UNIQUE()→COUNT(DISTINCT)SQL COUNT DISTINCT: count unique values
- Remove Duplicates→DISTINCTSQL DISTINCT: remove duplicate rows
- Pivot columns→SUM(CASE…)Pivot in SQL: turn rows into columns
- =MID()→SUBSTRING()SQL SUBSTRING: cut out part of text
- =A2&B2→CONCAT()SQL CONCAT: join text together
- =SEARCH()→LIKECheck if text contains a word in SQL
- =B2-A2→DATEDIFFDays between two dates in SQL (DATEDIFF)
- =EDATE()→DATEADDAdd days or months to a date in SQL
- =TEXT()→FORMATFormat dates in SQL (month, year, weekday)
- dragged-down formulas→OVER()SQL window functions, explained simply
- =RANK.EQ()→RANK()RANK, DENSE_RANK and ROW_NUMBER in SQL
- =SUM($B$2:B2)→SUM() OVERRunning total (cumulative sum) in SQL