Sign up
Sign in
Sign up
Sign in
Member-only story
Ivo Bernardo
Follow
Towards Data Science
—
Share
As data scientists, most of us are used to filter tables using pandas (on Python) or dplyr (on R). Indeed, there are certain wrangling operations that are more convenient to do in both libraries and in the context of the languages we use to code our algorithms.
But, if your data source is sitting on a database somewhere (and you are probably accessing it using some SQL interface), some filters and table operations would be more efficient using SQL code and performing those operations on the server side.
Filtering tables is one of the most common operations one does when working with SQL. On the surface, they seem pretty straightforward, you apply a WHERE
clause and that’s it! But.. filters have more than meets the eye and can get complex quite fast.
Learning how to apply the different filtering methods and leverage theWHERE
clause with IN
, AND
, OR
, precedence and wildcards will improve your SQL game enormously. In this post, we’ll explore those extra spices that can be applied when filtering rows from a table. By the end of the post, you should be able to understand most complex WHERE
statements in the…
—
—
Towards Data Science
I write about data science and analytics | Partner @ DareData | Instructor @ Udemy | also on thedatajourney.substack.com/ and youtube.com/@TheDataJourney42
Help
Status
About
Careers
Press
Blog
Privacy
Terms
Text to speech
Teams
