Stage 2 · Lesson 7 of 8
Text and date functions in your dialect
Built-in clean up and reshape values. They join pieces of text, trim spaces, change upper and lower case, pull out parts of a date, add time periods and round timestamps down to the day or month. This is where the three databases differ most.
joins strings with || and has date_trunc and . MySQL uses CONCAT, DATE_FORMAT and INTERVAL 30 DAY. uses CONCAT or +, DATEADD, DATEDIFF and DATETRUNC.
Learn the ten functions you will use daily in your own database, and know where the documentation lists the rest. They come up constantly in reports and whenever you month.
Common trapwrapping an indexed column in a function inside WHERE, which usually stops the index being used, as the performance stage shows.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking SQL for Tech Interviews
Design Gurus · Intermediate · Subscription
The basics, order of execution and functions chapters, each followed by graded problems
- CourseFreeSQLBolt
SQLBolt · Beginner
Free: Lessons 1 to 4, 8, 9 and 12 cover SELECT, filtering, sorting, NULLs, expressions and query order
Practise
Keep handy
Also worth your time
Walks through the logical order a query is evaluated in, which explains most early errors