SQL aka “sequel” stands for Structured Query Language and is used to manipulate and manage data stored in a structured database (rows and columns). When a person writes in SQL code and executes that code they are querying a database. To query, is to ask a question. As a result, we’re asking a question of the database using some type of query editor.
The following query illustrates how a person might inquire to a database with SQL in order to return a list of people and their address information for the city of Chicago.
SELECT a.FirstName, a.LastName, b.Address, b.City
FROM Person a
JOIN Address b ON a.AddressId = b.AddressId
WHERE b.City = ‘Chicago’;
Without getting into the details of how to structure a SQL query, there are several slices and dices of the language. Each company had their vision of what it should look like. Because of that, there are several versions – and which version depends on the type of database. Most SQL code is transferable from one database to another with very slight adjustments. We often see very subtle differences between functions that might require tweaking first.
To be considered actual SQL by definition the query language must follow the American National Standards Institute compliance or ANSI standard. These standards were created sometime in the early 1970’s and defined in the 1980’s.
Why is SQL Useful?
The SQL language can be used across all relational database platforms since it follows ANSI compliance standards making it a valuable and transferable skill. Most, if not all of the fortune 500 companies have jobs that harness SQL as an important skill. Maybe the CFO or even CEO needs to see how their company is performing. How is the company is trending? Using SQL, we can pull information to show those answers.
These data points are used to drive business decisions and is commonly referred to as business intelligence. This market sector has only been growing over the years. As a result, the data landscape is constantly changing. It now includes artificial intelligence (AI) processes and machine learning to drive business decisions – and yes, SQL is still involved in a lot of this!
How do you write SQL?
The database language is written is what’s known as SQL syntax. Many often refer to the syntax as a query – being a question given to the database. Each and every query that is expecting an answer must include a SELECT and a FROM clause. The SELECT is what we’re asking the database to return (or fields to select). A FROM clause is which tables in the database the data comes from. The bare minimum of a database query written in SQL syntax to retrieve data is a SELECT and FROM clause.
SELECT * FROM TABLE;
SQL queries usually end with a semi-colon ; and the * operator indicates that we want to return ALL columns in a table. The range of complexity in SQL can range from super simple to quite complex – but knowing the query syntax is only half the battle.
Why should you care?
Solving business problems and being able to crunch numbers is vital for any large company. So yes – while knowing SQL is half the battle, knowing the industry and data is the other half. In the end, both together provide a valuable combination and a powerful punch to make you a valuable asset for any company.
SQL is a valuable foundation skill-set. Additional skills to build on include:
- Programming (C++, Java, C#, .Net, etc..)
- ETL (Informatica, Oracle ODI, Microsoft SSIS, Matillion, etc..)
- Data Modeling & Architecture
And the list goes on…
Do you get the point?
It’s like asking someone, “do you know how to throw a baseball?”. You might already be pretty good, but if you don’t know how to throw a baseball I could still show you fairly quick. The thing is – it’s going to take time for you to hone in that skill.
That’s like SQL – very simple to start, but will take time to master.