https://www.linkedin.com/posts/data-dawn_your-analyses-is-useless-if-your-data-is-activity-7375890512094040064-p0Ud?utm_source=social_share_video_v2&utm_medium=android_app&rcm=ACoAAAMyhrcBZfCbyRqksrH2wYOCdYxljJ2vRuI&utm_campaign=copy_link
WWW.LINKEDIN.COM
Your analyses is useless. If your data is a mess.
8 steps to clean data in SQL ๐
๐ฆ๐๐ฒ๐ฝ ๐ฌ: ๐จ๐ป๐ฑ๐ฒ๐ฟ๐๐๐ฎ๐ป๐ฑ ๐ฑ๐ฎ๐๐ฎ ๐๐๐ฟ๐๐ฐ๐๐๐ฟ๐ฒ
โณ Understand column names and types
โณ Check out a… | Dawn Choo | 64 comments Your analyses is useless. If your data is a mess.
8 steps to clean data in SQL ๐
๐ฆ๐๐ฒ๐ฝ ๐ฌ: ๐จ๐ป๐ฑ๐ฒ๐ฟ๐๐๐ฎ๐ป๐ฑ ๐ฑ๐ฎ๐๐ฎ ๐๐๐ฟ๐๐ฐ๐๐๐ฟ๐ฒ
โณ Understand column names and types
โณ Check out a sample of the data
๐ฆ๐๐ฒ๐ฝ ๐ญ: ๐๐
๐ฝ๐น๐ผ๐ฟ๐ฒ ๐๐ต๐ฒ ๐ฑ๐ฎ๐๐ฎ
โณ For numerical columns, check distributions
โณ For categorical variables, check frequencies
๐ฆ๐๐ฒ๐ฝ ๐ฎ: ๐ฆ๐๐ฎ๐ป๐ฑ๐ฎ๐ฟ๐ฑ๐ถ๐๐ฒ ๐ฑ๐ฎ๐๐ฎ ๐ณ๐ผ๐ฟ๐บ๐ฎ๐๐
โณ Convert strings to lower case or upper case
โณ Cast dates to readable format
โณ Remove white spaces
๐ฆ๐๐ฒ๐ฝ ๐ฏ: ๐ฅ๐ฒ๐บ๐ผ๐๐ฒ ๐ฑ๐๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ฒ๐
โณ Use DISTINCT to remove duplicate rows
๐ฆ๐๐ฒ๐ฝ ๐ฐ: ๐๐ถ๐น๐น ๐ถ๐ป ๐ป๐๐น๐น๐ ๐ฎ๐ป๐ฑ ๐บ๐ถ๐๐๐ถ๐ป๐ด ๐๐ฎ๐น๐๐ฒ๐
โณ Fill with 0 (only when 0 is a meaningful default)
โณ Drop the data, if missing data makes the row unusable
โณ Fill with the average (for numerical data only)
๐ฆ๐๐ฒ๐ฝ ๐ฑ: ๐ฆ๐๐ฎ๐ป๐ฑ๐ฎ๐ฟ๐ฑ๐ถ๐๐ฒ ๐ฐ๐ฎ๐๐ฒ๐ด๐ผ๐ฟ๐ถ๐ฐ๐ฎ๐น ๐๐ฎ๐ฟ๐ถ๐ฎ๐ฏ๐น๐ฒ๐
โณ Use CASE WHEN to clean the data
๐ฆ๐๐ฒ๐ฝ ๐ฒ: ๐๐ถ๐น๐๐ฒ๐ฟ ๐ผ๐๐ ๐ฏ๐ฎ๐ฑ ๐ฑ๐ฎ๐๐ฎ
โณ Use WHERE to filter out unusable rows
๐ฆ๐๐ฒ๐ฝ ๐ณ: ๐ฅ๐ฒ๐ป๐ฎ๐บ๐ฒ ๐ฐ๐ผ๐น๐๐บ๐ป๐ ๐ณ๐ผ๐ฟ ๐ฐ๐น๐ฎ๐ฟ๐ถ๐๐
โณ Use intuitive and clear column names
๐ฆ๐๐ฒ๐ฝ ๐ด: ๐๐ฟ๐ฒ๐ฎ๐๐ฒ ๐ฟ๐ฒ๐๐๐ฎ๐ฏ๐น๐ฒ ๐๐ถ๐ฒ๐๐ ๐ผ๐ฟ ๐๐ฎ๐ฏ๐น๐ฒ๐
โณ Create a view (doesn't take up more storage)
โณ Save as a table (faster for querying)
———
Ready to test your SQL skills?
Check out these questions on Interview Master:
๐ Easy SQL question: https://lnkd.in/gG_A8FWP
๐ Medium SQL question: https://lnkd.in/geQqR_uV
๐ Hard SQL question: https://lnkd.in/gRrNfcuK
———
โป๏ธ Found this useful? Repost it please! | 64 comments on LinkedIn
0 condivisioni