From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Working with date functions - SQL Tutorial
From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced
Working with date functions
- [Instructor] You have understood the different mathematical functions. Now imagine if you want to manipulate different dates in your database or want to know today's date, extract a specific portion of the date, or you want to do some additional subtraction in the date. Then there is a lot of built-in functions available for this purpose. Let's go down to PG admin and see how we can play with this date. To get the current date, there is a function called current date. You can say select current_date. This function will give you the current date. Now maybe possible that from a date column you have, you want to extract some specific month, year, or day from this date. So to extract a specific piece out of this date, there is a function exists. The function is called extract. You use extract and you tell the extract what you want to extract out of it. For example, you want to extract day from your current date. When…
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
-
-
-
-
-
-
-
(Locked)
Introduction to SQL functions4m 30s
-
(Locked)
Using mathematical functions4m 56s
-
(Locked)
Working with date functions9m 2s
-
(Locked)
Working with time functions7m 6s
-
(Locked)
String functions: Concatenation and trimming5m 45s
-
(Locked)
String functions: Changing case and extracting substrings7m 22s
-
(Locked)
Challenge: Play with strings48s
-
(Locked)
Solution: Play with strings50s
-
(Locked)
-
-
-
-
-
-
-
-