Digital Marketers Need To Learn SQL [10+ Resources]

Digital Marketers Need To Learn SQL [10+ Resources]

SQL (Structured Query Language) is a programming language designed to manage, access, and manipulate data stored in relational databases. According to Google Trends, this language saw its height in popularity in the early-mid 2000s but has been rising in popularity over the last five years. This is an incredible yet simple language to learn and can help anyone, specifically in the Digital Marketing field, expand their craft. In this post, I'm going to give some reasons why Digital Marketers should learn the language, give SQL an introduction, break down some basic functions on SQL, give a list of commands and their adaptations, and finish with 10 resources you should use to get started.

SQL Adaptations in Marketing

Analytical minded Digital Marketing professionals or "technical marketers" are in high demand and low supply. The best marketers or "growth hackers" in the field today are those that are data-driven. Many companies have invested in teaching their marketing specialist/strategist SQL, therefore adding this to your arsenal on your own will make you a heavily desired marketing unicorn in the field. 

SQL gives marketers the ability to extract any information they want about customers or potential customers stored in a database without having to rely on engineers to retrieve this data. Jamie Stevenson, the CMO of Moz, is quoted saying, 

"Regardless of whether or not you subscribe to these labels, technical skills are becoming a requirement for success in online marketing. The marketers who know SQL, can write code, leverage APIs, and perform quantitative analysis will be the most desirable and productive individuals in our industry.”

Currently, for this type of type of data pulling and storage, there are few systems that top SQL and none that are currently more popular. Apache Hive, which is rising in the ranks of popularity, is an SQL-like interface and with a SQL background, Hive will be easier to use for marketers of the future. 


Picture this as a marketer: A spreadsheet that contains every bit of data on your customers and potential customers, what their converting habits are, and whatever action they have taken on your website. Imagine what you could do with all of this data! SQL gives you the ability to easily access this information.

Introduction to SQL

Like I mentioned earlier, SQL is a programming language designed to manage, manipulate and read data stored in relational databases.

  • Relational Database(s) is a database that organizes information into one or more tables and is typically managed in a Relational Database Management System(RDBMS).
  • Tables often referred to as 'relations' are collections of data that are organized into rows and columns.
  • Columns are sets of data values of a particular type such as name, age, revenue, etc... Columns can be virtually any type of header for a certain data type.
  • Rows are single records in a table that give value or definition to a column such as name = Richard, age = 113, revenue = $8.22 etc... 

All of the data stored in this relational database that is managed with SQL is data of a certain type. The datatype are the following: date(YYYY,MM,DD), integer(number), text(text string), and real(decimal).

To give a bit of background, SQL has a rather interesting history. In the early 1970s, SEQUEL (Structured English Query Language) was developed at IBM and was used for similar functions it is used for now. IBM had a pseudo-relational database management system that SEQUEL was developed to retrieve information from and manipulate data in. The name was changed from SEQUEL to SQL because of a trademark issue. In the late 1970s, Oracle developed their own SQL based Relational Database Management System (RDBMS) and in 1979 introduced it commercially. IBM then began developing commercial systems in the early 1980s, but Oracle sat at the top until Microsoft caught wind and jumped into the market in the 1990s. The Microsoft SQL Server is still the most used RDBMS.

A funny point I want to make here is that still to this day, people -myself included- pronounce SQL as 'sequel' although the actual pronunciation should be S-Q-L. 

4 Basic SQL Functions

SQL, like many other languages in computer programming, has four basic functions that can easily be remembered as C.R.U.D. (create, read, update, & delete). In SQL these functions are often referred to as clauses or commands. 

  1. Create - SQL equivalent functions are CREATE TABLE, INSERT INTO, & ALTER TABLE - CREATE TABLE is a clause that allows you to create a table and build in columns and rows. INSERT INTO is a clause that allows you to insert a new row into a table when you want to add new records. ALTER TABLE is a clause that allows you to add a new column using ADD COLUMN.
  2. Read - SQL equivalent function is SELECT - SELECT is a clause that is used to fetch data from a database or specific table. This can query data from a specific table or from all tables. SELECT clauses are the most important and applicable commands that digital marketers and marketing analysts should become familiar with.
  3. Update - SQL equivalent function is UPDATE - UPDATE is a clause that edits a row in a table to change existing records. 
  4. Delete - SQL equivalent function is DELETE FROM - DELETE FROM is a clause that allows you to delete one or more rows from a table.

These are some of the basic commands in SQL with SELECT being the most powerful tool of receiving and interpreting information from a database.

List of SQL Commands

There is a long list of commands in SQL that allow for you to do a whole array of things in your Relational Database Management System. The following are obviously not all of the functions you can perform in SQL since there is a combination of things you can do using multiple things at once, but this is a great list to become a more dynamic SQL user. The example below will be including inputs in curly brackets {} and to make that function work replace that text with the curly brackets being replaced as well.

  • ALTER TABLE - lets you add columns to a table in an RDBMS.

ALTER TABLE {table name} ADD {column name} {datatype};

  • AND - is an operator that combines two conditions, both conditions may be true for the specific row to be included.

SELECT {column name(s)} FROM {table name} WHERE {column 1} = {value 1} AND {column 2} = {value 2};

  • AS - a keyword that allows you to rename a column temporarily for easier interpretations.

SELECT {column name} AS 'Temporary Name' FROM {table name};

  • AVG( ) - an aggregate function that returns the average value for a numeric column.

SELECT AVG({column name}) FROM {table name};

  • BETWEEN - an operator used to filter the results within a certain range and can be the number, text, or date datatypes.

SELECT {column name} FROM {table name} WHERE {column name} BETWEEN {value 1} and {value 2};

  • COUNT( ) - is a function that takes the name of the column and counts the total number of rows in the column when the column is not NULL or blank.

SELECT COUNT({column name}) FROM {table name};

  • CREATE TABLE - simply creates a new table in a database.

CREATE TABLE {table name} ({column 1} {datatype}, {column 2} {datatype});

  • DELETE - is used to remove rows from table.

DELETE FROM {table name} WHERE {column name} = {value};

  • GROUP BY - is a clause used with aggregate functions with the purpose of arranging data into groups.

SELECT COUNT(*) FROM {table name} GROUP BY {column name};

  • INNER JOIN - combines rows from different tables only if the condition you declare is true.

SELECT {column name} FROM {table 1} JOIN {table 2} ON {table 1}.{column name} = {table 2}.{column name};

  • INSERT - is used to add new rows to a table.

INSERT INTO {table name}({column 1}, {column 1}) VALUES({value 1}, {value 1};

  • LIMIT - since databases get very large sometimes, limit allows you to set the maximum number of rows you want to see.

SELECT {column name} FROM {table name} LIMIT {max number};

  • MAX( ) - is a function that returns the largest value of a column.

SELECT MAX ({column name}) FROM {table name};

  • MIN( ) - is a function that returns the smallest value of a column.

SELECT MIN ({column name}) FROM {table name};

  • OR - returns rows where either of the conditions stated are true.

SELECT {column name} FROM {table name} WHERE {column name} = {value} OR {column name} = {value};

  • ORDER BY - is a clause that determines whether you see your information ascending or descending alphabetically or numerically.

SELECT {column name} FROM {table name} ORDER BY {column name} ASC|DESC;

  • OUTER JOIN - combines rows from different tables if the join condition is not true.

SELECT {column name} FROM {table 1} LEFT JOIN {table 2} ON {table 1}.{column name} = {table 2}.{column name};

  • ROUND( ) - takes column name and integer and rounds the number to the decimal specified. For this example we are rounding it to the 2nd place.

SELECT ROUND({column name}, 2) FROM {table name};

  • SELECT - allows you to access/read data from a database.

SELECT * FROM {table name};

  • SELECT DISTINCT - is a select statement that ensures data that is returned is unique by column.

SELECT DISTINCT {column name} FROM {table name};

  • SUM( ) - returns the sum of values in a specific column.

SELECT SUM({column name}) FROM {table_name};

  • UPDATE - enables you to modify or change rows in a table.

UPDATE {table name} SET {column name} = {value} WHERE {column name} = {value};

  • WHERE - enables you to filter a result to whatever conditions you specify.

SELECT {column name} FROM {table name} WHERE {column name} {value};

10 Resources to Get Started

If you are looking to learn a bit more about SQL, I would recommend you go through this list and learn a bit more about this language and how powerful it can be in your arsenal.

  1. W3Schools – “SQL Tutorial” 
  2. Codecademy – “Learn SQL”
  3. Khan Academy – “Intro to SQL”
  4. SQLZoo
  5. Tutorials Point – “Learn SQL”
  6. SQL Problems and Solutions
  7. Tuts+ – “SQL for Beginners”
  8. Learn SQL The Hard Way
  9. Udemy – SQL Tutorials
  10. Vertabelo Academy

Some extra resources that I did not list can be found here.

Just to wrap things up, even if you do not see yourself using SQL in the near future it still is a great tool to have in your kit. Learning SQL goes a long way even when operating in Hadoop organizing data via Hive, but that's a conversation for another day. Thanks for reading, don't forget to follow me on twitter @LifeOfRahjr. If you have any questions or comments feel free to leave them below and also don't hesitate to connect with me on LinkedIn or email me.

Check out my Site

https://www.richardallenharrisjr.com/


Stuff I Referenced

https://www.codecademy.com/articles/sql-commands?r=master

https://trends.google.com

https://www.w3schools.com/sql/sql_intro.asp

https://academy.vertabelo.com/blog/18-best-online-resources-for-learning-sql-and-database-concepts/

https://www.name.com/blog/business/marketing-2/2014/05/why-sql-is-important-for-marketers/

要查看或添加评论,请登录

Richard Harris Jr.的更多文章

社区洞察

其他会员也浏览了