Data Wrangling on the DATE Data Type
Most transactional data has some or other form of date-type data that holds meaningful information, especially when doing analysis on historical data or data modeling. In SQL, the DATE
data type is used to store date values. Dates are stored in the format YYYY-MM-DD, where YYYY represents the year, MM represents the month, and DD represents the day. For example, January 5, 2020 would be stored as 2020-01-05
. The DATE
data type is supported by most SQL implementations, including MySQL, PostgreSQL, and SQLite. In addition to the DATE data type, most SQL implementations also support additional data types for storing time or timestamp information, such as TIME
and TIMESTAMP
.
For example, extracting just the month information from a date column in a table. The goal of this chapter is to help you achieve hands-on experience in how to extract meaningful information after data wrangling on the DATE data type.
In this chapter, we will cover the following...