Extract ZIP Codes | String Contains Substring | Data Analyst SQL Interview Questions

preview_player
Показать описание
#sql #dataanalysis #datascience
We are going to use pattern matching to Extract the Zip Codes within the address text. We will use a combination of the RIGHT function with LIKE operator to bring back zip codes regardless of where they fall within the address. Learn about other ways to pattern match in the blog post here:
Рекомендации по теме
Комментарии
Автор

Super
It’s pattern matching
A very useful technique

Thekingslayer-igse
Автор

What about the other ZIP codes that are not at the right most but a few characters before? These are getting missed out.

hiarunkumar
Автор

That 5 digit apartment number gonna cause one hell of a bug.
If you're using regex for this on truly uncleaned data, then you're gonna have a bad time.
If you need a regex though, a better one might be "^.*/w+, /w/w /d{5}.*$", which will match the pattern city, ST Just gotta figure out how to say that in your SQL flavor.

MrMusicman
Автор

What would be the best way to fill in the blanks? Can you use SQL to extract zip from left part using the Internet?

JayOwinFull
Автор

Thanks a million sir for your time and efforts and value adding contents....

Adeyeye_seyison
Автор

half of the values omitted in final answer, not a solution

inversion_media
Автор

How would we do this if we were looking for dates?

ericaleverson