“Piton!”
“Neither.”
“Fools, it’s obviously Rust.”
Many data science students and experts are eager to find the best language for data science. In my opinion, most people are wrong. In the midst of searching for the newest, sexiest, most container-friendly data science language, people are looking for the wrong thing.
Picture of reddit
It’s easy to miss. It’s easy to even dismiss it as a language. But the humble Structured Query Language, or SQL, is my choice as a language for learning data science. All of those other languages certainly have their place, but SQL is the only non-negotiable language that I consider a basic requirement for anyone working in data science. This is why.
Look, databases go hand in hand with data science. It’s in the name. If you’re working with data science, you’re working with databases. And if you work with databases, you’re probably working with SQL.
Because? Because SQL is the universal database query language. There is no other. Imagine if someone told you that if you learned a specific language, you could speak and understand every person on Earth. How valuable would that be? SQL is that language in data science, the language that everyone uses to manage and access databases.
Picture of x
Every data scientist needs to access and retrieve data, explore and formulate hypotheses, filter, aggregate and sort data. And therefore, every data scientist will need SQL. As long as you know how to write a sql queryYou will go far.
Someone, reading this article right now, is talking about the NoSQL movement. In fact, certain data is currently more commonly stored in non-relational databases, such as key-value pairs or graph data. It is true that storing data of this type has advantages: you get more scalability and flexibility. But there is no standard NoSQL query language. You may learn one for one job and then need to learn a completely new one for a new job.
Additionally, you will rarely find a company that runs entirely on NoSQL databases, while many companies do not need non-relational databases.
There is that famous one (and discredited) statistic on how data scientists spend 80% of their time cleaning. While not true, I think if you ask any data scientist what they spend their time on, data cleansing will rank in the top five tasks. That’s why this section is the longest.
You can clean and process data with other languages, but SQL in particular offers unique advantages for certain aspects of data cleaning and processing.
SQL’s expressive query language allows data scientists to efficiently filter, sort, and aggregate data using concise statements. This level of flexibility is especially useful when dealing with large data sets where manual data manipulation would be time-consuming and error-prone. Compare that to a language like Python, where accomplishing similar data manipulation tasks may require writing more lines of code and dealing with loops, conditions, and external libraries. While Python is known for its versatility and rich ecosystem of data science libraries, SQL’s focused syntax can speed up routine data cleansing operationsallowing data scientists to quickly prepare data for analysis.
Furthermore, any data scientist will complain about the nightmare of their existence: missing values. SQL functions and capabilities to handle missing values, such as using GET TOGETHERCASE, and NULL Handling: Provide simple approaches to address data gaps without the need for complex programming logic.
The other bane of a data scientist’s existence is duplicates. Fortunately, SQL offers efficient methods for identifying and removing duplicate records from data sets, such as the `DISTINCT` keyword and the `GROUP BY`clause.
You’ve probably heard of ETL pipelines. Well, SQL can be used to create data transformation pipelines, which take raw or semi-processed data and convert it to a format suitable for analysis. This is particularly beneficial for automating and standardizing the repetitive data cleansing processes we all know and hate.
SQL’s ability to join tables from different databases or files streamlines the process of merging data for analysis, it is essential for projects that involve data integration or aggregation of data from various sources. Which, for a data scientist, encompasses most projects.
Lastly, I like to remind people that data science doesn’t happen in a vacuum. SQL queries are self-contained and can be easily shared with colleagues. This encourages collaboration and ensures that others can reproduce the data cleansing steps without manual intervention.
Now, you won’t get very far in data science if only Know SQL. But fortunately, SQL integrates seamlessly with any other major data science languages like R, Python, Julia, or Rust. You get all the benefits of analytics, data visualization, and machine learning while retaining the robustness of SQL for data manipulation.
Picture of LinkedIn
This is especially powerful when you think about all that data cleaning and processing I talked about earlier. You can use SQL to preprocess and clean data directly within databases and then lean on Python, R, Julia, or Rust to perform more advanced data transformations or feature engineering, taking advantage of the extensive libraries available.
Many organizations rely on SQL (or, more accurately, rely on data scientists who know how to use SQL) to generate reports, dashboards, and visualizations that inform decision making. Familiarity with SQL enables data scientists to produce meaningful reports directly from databases. And because SQL is so widespread, these reports are typically compatible and interoperable on almost any system.
Due to its interoperability with reporting tools and scripting languages such as Python, R, and JavaScript, data scientists can automate reporting processes, seamlessly combining the data extraction and manipulation capabilities of SQL. with the visualization and reporting functions of these languages. The result is that you’ll get comprehensive, insightful reports that effectively communicate data-driven insights to stakeholders, all within one place.
There is a reason why you will be asked many times SQL interview questions in any data science interview. Almost all data science jobs require at least a basic familiarity with SQL.
Here it is an example of what I mean: the job posting says: “Experience in SQL and R or Python for data analysis and platform development.” In other words, SQL is a must. And then R or Python, but one is as good as the other for most employers. But thanks to the dominance of SQL, there is no alternative to SQL. Every data science job will require you to work with SQL.
What’s really interesting about this is that it makes SQL the ultimate portable tool. A job may prefer Python, while a startup may require Rust due to personal preferences or legacy infrastructure. But no matter where you go or what you do, it’s SQL or fail. Take the time to learn it and you’ll always be able to check off a job requirement.
Ultimately, if you find a job as a data scientist that doesn’t require SQL, you probably won’t do much data science.
It really comes down to the database. Data science requires the storage, manipulation, retrieval and management of large amounts of data. That data lives somewhere. Typically, it can only be accessed with one tool, and that tool is SQL. SQL is the language we must learn for data science and will be as long as we depend on databases to do data science.
Nate Rosidi He is a data scientist and in product strategy. He is also an adjunct professor of analysis and is the founder of StrataScratch, a platform that helps data scientists prepare for their interviews with real questions from top companies. Connect with him on Twitter: StrataScratch either LinkedIn.
Nate Rosidi He is a data scientist and in product strategy. He is also an adjunct professor of analysis and is the founder of StrataScratch, a platform that helps data scientists prepare for their interviews with real questions from top companies. Connect with him on Twitter: StrataScratch either LinkedIn.