4
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 ...
Get Data Wrangling with SQL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.