Introduction To SQL Programming For Excel Users

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9
At a glance
Powered by AI
The key takeaways are that learning SQL is easy for Excel users and SQL unlocks the power of the database server for Excel analysts, allowing for acquiring, cleaning, and transforming data at scale, conducting analyses directly in the database, and enhancing Power Query pipelines.

The four types of filtering in Excel are: 1) Single column using a single filtering condition, 2) Single column using multiple filtering conditions, 3) Multiple columns using a single filtering condition for each column, 4) Multiple columns using any number of filtering conditions for each column.

Filtering a single column in Excel can be expressed in SQL using a WHERE clause specifying the column name and filtering condition, such as WHERE Shift = 'PM1'.

INTRO TO SQL

PROGRAMMING
FOR EXCEL USERS

SELECTING AND FILTERING

YOUR EXCEL SKILLS MAKES LEARNING TO


QUERY DATABASES EASY
INTRO TO SQL FOR EXCEL USERS

Unlock the Power of the Database


Skills with SQL opens up a new world of possibilities for ANY professional
that analyzes data with Microsoft Excel.

Here's the best part.

Learning SQL is easy for Excel users.

SQL unlocks the power of the database server for Excel analysts. This has
many benefits, including:

1 - Acquiring, cleaning, and transforming data at scale.


2 - Conducting data analyses (e.g., RFM analysis) directly in the DB.
3 - Enhancements to your Power Query data pipelines.

For the reasons listed above, and many others, SQL is one of the most
valuable (if not THE most valuable) of all data skills.

Skeptical that learning SQL is easy?

Wouldn't blame you. I like to let my content do the talking.

Keep reading and then decide.

https://bit.ly/AnalyticsFreeResources 2
INTRO TO SQL FOR EXCEL USERS

Selecting Columns
It is a common practice to hide columns of data in Excel - especially in
scenarios where you are sharing a workbook with others.

You can also think of this, logically, as choosing which columns you want
people to focus on.

In other words, selecting the columns you want seen.

Take the following Excel screenshots depicting a CallCenter table where a


subset of columns have been selected.

https://bit.ly/AnalyticsFreeResources 3
INTRO TO SQL FOR EXCEL USERS

Think about the screenshots on the previous page in terms of natural


language. You might describe the second screenshot like this:

"I have selected the WageType, Shift, LevelOneOperators, LevelTwoOperators,


Calls, and Data columns from the CallCenter table for all rows of data."

Just about everything you do with tables of data in Excel applies to working
with tables of data in SQL.

Here is legit SQL code that maps to the screenshots on the previous page:

SELECT WageType,
Shift,
LevelOneOperators,
LevelTwoOperators,
Calls,
Data
FROM CallCenter

SQL was designed to mirror natural language as much as possible.

SQL allows you to specify what you want to have happen and then the
database figures out how to do it.

The above code is very intuitive, no?

https://bit.ly/AnalyticsFreeResources 4
INTRO TO SQL FOR EXCEL USERS

Filtering Rows
When working with Excel tables you filter. A lot.

You can think of filtering as coming in four types:

1. Single column using a single filtering condition.


2. Single column using multiple filtering conditions.
3. Multiple columns using a single filtering condition for each column.
4. Multiple columns using any number of filtering conditions for each
column.

Whew!

When listed out it seems complicated, but Excel users do this all the time.

Once again, if filtering is common (and necessary) in Excel, it shouldn't


surprise you that the same is true with SQL.

We'll take a look at mapping #1 from Excel to SQL.

https://bit.ly/AnalyticsFreeResources 5
INTRO TO SQL FOR EXCEL USERS

Filtering a Single Column in Excel


This screenshot illustrates filtering
the CallCenter Excel table on a single
column using a single condition.

In this case, filtering the CallCenter


table to only rows of data where the
Shift column has a value of PM1.

Thinking about what Excel is doing


behind the scenes is very useful for
mapping your Excel knowledge to
SQL.

Once again, thinking in terms of natural language is helpful in mapping


Excel knowledge to SQL. We could describe the filter like this:

"I want only the rows of data from the CallCenter table where value of the
Shift column equals PM1."

Here is legit SQL code for the filter:

WHERE Shift = 'PM1'

https://bit.ly/AnalyticsFreeResources 6
INTRO TO SQL FOR EXCEL USERS

A Complete SQL Query


Putting everything together, we get the following legit SQL query:

SELECT WageType,
Shift,
LevelOneOperators,
LevelTwoOperators,
Calls,
Data
FROM CallCenter
WHERE Shift = 'PM1'

While this is a simple example, it demonstrates that Excel users can quickly
become productive by mapping what they do in Excel every day to
accomplishing the same tasks in SQL.

Are you ready to unlock the power of the database?

My 21-part self-paced tutorial will teach you the 20% of SQL that is used
80% of the time for analyzing data.

https://bit.ly/AnalyticsFreeResources 7
INTRO TO SQL FOR EXCEL USERS

See What Your Excel Skills Make Possible

I've built hours of free tutorials that have been used by 1000s of
professionals to build the data skills of the future.

You've got this if you want it.

https://bit.ly/AnalyticsFreeResources

8
INTRO TO SQL FOR EXCEL USERS

About the Author


My name is Dave Langer and I am the founder of
Dave on Data.

I'm a hands-on analytics professional, having used


my skills with Excel, SQL, and R to craft insights,
advise leaders, and shape company strategy.

I'm also a skilled educator, having trained 100s of


working professionals in a live classroom setting
and 1000s more via my online courses and
tutorials.

In the past, I’ve held analytics leaderships roles at


Schedulicity, Data Science Dojo, and Microsoft.

Drop me an email if you have any questions:


[email protected]

https://bit.ly/AnalyticsFreeResources 9

You might also like