From the course: SQL Tips and Tricks for Data Science

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Date and time functions

Date and time functions

- [Instructor] All right now let's take a look at some popular date and time functions. Date and time functions are methods in SQL that allow you to perform manipulation and arithmetic operations on date and time fields. Often we start dates and times of when events occur in our databases, sometimes those lineup with how we want to analyze the data but often they do not. So we need to manipulate those values or calculate things like numbers of days between dates, we turn to our date and time functions. First and foremost, you'll be looking to use functions in aggregations. As I just said, we may store the data with the detail down to the millisecond of when something occurred but when analyzing we'll want to use all of the events rolled up to the day or month. So we use these functions to extract those higher levels of granularity of the date hierarchy before we aggregate our values. The next is filtering. Time is…

Contents