The Skill Explained
What Is SQL?
SQL (Structured Query Language) is the language for asking questions of data stored in tables. You describe the result you want, such as "total sales per country this month", and the database works out how to get it.
Why AI Employers Ask for It
Most company data lives in relational databases and data warehouses, and SQL is how you reach it. Before a model can be trained or an AI feature can answer from company data, someone has to select, join and check that data. Data scientists, data engineers, analysts and many AI engineers use SQL daily, so ads ask for it even when the role is mostly about models.
How It Works
Data sits in tables made of rows and columns, and tables are linked by keys, for example a customer id that appears in both an orders table and a customers table. A query starts with SELECT, names the columns you want, the tables they come FROM, and the conditions in WHERE.
The power comes from combining tables with JOIN, summarising with GROUP BY and aggregate functions such as COUNT, SUM and AVG, and window functions that compute running totals or ranks without collapsing rows. Databases such as PostgreSQL and MySQL, and warehouses such as BigQuery or Snowflake, all speak SQL with small differences.
Good SQL is also about correctness: knowing how NULL values behave, avoiding duplicated rows after a join, and checking results against a number you already trust.
What You Do With It at Work
- Pull the training data for a model from a warehouse with joins and filters.
- Build a dashboard query that counts events per day and per product.
- Check data quality: missing values, duplicates, values out of range.
- Store an AI application's results, such as user feedback on answers, in a database.
- Speed up a slow query by filtering earlier or adding an index.
Tools and Terms You Will Meet
- JOIN
- Combines rows from two tables that share a key.
- GROUP BY
- Groups rows to compute totals, counts or averages per group.
- Window function
- A calculation across related rows (rank, running total) that keeps every row.
- PostgreSQL
- A widely used open-source relational database.
- Data warehouse
- A database built for analysis over large historical data.
Industry Example: Pharma
A clinical operations analyst joins a table of trial sites with a table of patient visits to find which sites are behind on enrolment, and refreshes the query every week for the study team.
A Common Mix-Up
SQL is not a database product. MySQL, PostgreSQL and SQL Server are databases; SQL is the shared language they understand.
How Deep Do You Need to Go?
- Know itWrite SELECT queries with WHERE and ORDER BY on one table.
- Use itJoin several tables, group and aggregate, use window functions and check results for duplicates.
- Master itDesign schemas, read query plans, tune slow queries and model data for a warehouse.