Data cleaning: Difference between revisions

Jump to navigation Jump to search
223 bytes added ,  15 June 2020
→‎Verify the format of field value: + Time data: the value should be YYYY/MM/DD format
(→‎Verify the format of field value: + Time data: the value should be YYYY/MM/DD format)
Line 290: Line 290:
</pre>
</pre>


=== Time data ===
=== Time data: the value should be YYYY/MM/DD format ===


==== Condition: Data was generated in 10 years ====
<pre>
SELECT `my_date_column`, UNIX_TIMESTAMP(STR_TO_DATE(`my_date_column`, '%Y/%m/%d'))
FROM `my_table`
WHERE
UNIX_TIMESTAMP(STR_TO_DATE(`my_date_column`, '%Y/%m/%d')) IS NULL;
 
</pre>
 
=== Time data: Data was generated in 10 years ===
Definition of abnormal values of the time data ([http://en.wikipedia.org/wiki/Time_series time series]) if they
Definition of abnormal values of the time data ([http://en.wikipedia.org/wiki/Time_series time series]) if they
* were generated 10 years before or
* were generated 10 years before or
Line 317: Line 325:
* PHP: [http://stackoverflow.com/questions/19271381/correctly-determine-if-date-string-is-a-valid-date-in-that-format php - Correctly determine if date string is a valid date in that format - Stack Overflow]
* PHP: [http://stackoverflow.com/questions/19271381/correctly-determine-if-date-string-is-a-valid-date-in-that-format php - Correctly determine if date string is a valid date in that format - Stack Overflow]


==== Condition: Human birth year (age) data ====
=== Time data: Human birth year (age) data ===
Based on the existing record, the longest-living person who lived to 122<ref>[https://en.wikipedia.org/wiki/Maximum_life_span Maximum life span - Wikipedia]</ref>.  
Based on the existing record, the longest-living person who lived to 122<ref>[https://en.wikipedia.org/wiki/Maximum_life_span Maximum life span - Wikipedia]</ref>.  


Anonymous user

Navigation menu