From the course: Intermediate SQL: Data Reporting and Analysis
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Use date functions - SQL Tutorial
From the course: Intermediate SQL: Data Reporting and Analysis
Use date functions
- [Instructor] Dates are tricky, there's no getting around it. Part of the problem is that SQL date handling differs widely between versions of SQL. I can't give you a definitive guide because many settings such as currency or thousand separators are set at the database level with your local settings. This means two students with the same database and software version could handle dates differently. Let's learn some tricks to reduce this pain. We're going to look at some common issues with dates, different ways of storing date time information, transforming the date format and time zones. It's important for you to understand that date type information can generally be stored in three different data types behind the scenes. It can be stored as a date, date time or a time stamp. Time stamps are not generally human readable but they take up less space in the database and are indexed faster, so databases love them. The actual…
Contents
-
-
-
-
The basic SELECT query1m 57s
-
(Locked)
Aggregated results with GROUP BY1m 51s
-
(Locked)
Wildcards and aliases6m
-
(Locked)
Merging tables with JOIN3m 56s
-
(Locked)
Use string functions8m 6s
-
(Locked)
Use number functions with grouped data6m 46s
-
(Locked)
Use date functions6m 7s
-
(Locked)
Challenge: Report average cost by staff53s
-
(Locked)
Solution: Report average cost by staff1m 49s
-
-
-
-
-