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 - SQL Tutorial
From the course: SQL Tips and Tricks for Data Science
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Retrieve data using SQL4m 18s
-
(Locked)
Join tables5m 44s
-
(Locked)
Filter data5m 33s
-
(Locked)
Aggregate data6m 29s
-
(Locked)
Window functions1m 54s
-
(Locked)
Subqueries4m 16s
-
(Locked)
Rolling calculations4m 48s
-
(Locked)
Analyze employee data4m 18s
-
(Locked)
Date and time functions5m 11s
-
(Locked)
Common table expressions5m 55s
-
(Locked)
Year-over-year calculations3m 26s
-
(Locked)
Finding ranks4m 9s
-
-