• The Query
  • Posts
  • 🤓 my favorite SQL string function

🤓 my favorite SQL string function

The Query (aka Kyle and Cody) here 👋 

Here’s what we have for you today:

  • More remote data jobs 🔥 

  • Real datasets used in the news 🗞️

  • My favorite string function 🧵

  • A SQL meme to send your coworker 🤣

select * from data-jobs

remote, entry-level data jobs

Because who likes writing SQL from a busy office?

  1. Data Analyst @ Coterie — $85-105k per year (apply here)

  2. Data Analyst @ Circle — $90-100k per year (apply here)

  3. Data Analyst, Healthcare @ Sentara — $69-105k per year (apply here)

freelance gigs

Need work experience? Get real experience with real projects.

  1. Organize Excel Data — $25-30 per hour (apply here)

  2. Google Sheets Data Viz — $17-40 per hour (apply here)

  3. Monthly Excel Reports — $50-75 per hour (apply here)

def content_spotlight(🔦):

This week, we’re featuring datasets from BuzzFeed news.

This is a repository of datasets and analysis done by BuzzFeed.

Here you can see how they present an analysis or you can download the datasets and do your own analysis!

A lot of these datasets are related to politics, which may be of interest to some of you.

If you do an analysis of any of these make sure to share it on Linkedin and tag Cody and Kyle in your post!

class SQLMiniLesson:

CONCAT — Combining Strings Together

Kyle here 👋 —

Working with strings in SQL is one of the most common things you do as a data analyst.

As a part of that, you may need to combine the values of multiple columns or strings in your SQL queries.

One useful function for this purpose is the CONCAT function.

In this lesson, we'll introduce you to the CONCAT function and explain how it can be helpful in your SQL queries.

What is CONCAT?

The CONCAT function is used to concatenate (or join) two or more strings or column values together.

It returns a single string that is the result of combining the input strings in the order they are provided.

Syntax

The basic syntax for the CONCAT function is:

CONCAT(string1, string2, ..., stringN)

Example

Suppose we have a table called employees with the following columns: first_name, last_name, and email.

We want to create a query that returns a full name by combining the first_name and last_name columns.

In this query, we use the CONCAT function to join the first_name and last_name columns, separated by a space character.

The result is aliased as full_name.

By using this function, you can easily create new strings by joining existing ones, which can be useful for formatting.

P.S. Another cool thing CONCAT can do is create a unique key on your table. If none of the columns are unique by themselves but a combination of columns is unique, then you can just concatenate them together to create a unique key.

import memes as 😂 

Slack this to any of your coworkers that pronounce it S.Q.L. lol!

content & resources 🤓 

1. Become a Data Analyst Guide: Our full guide on what it takes to land a job as a data analyst.

2. Download our SQL Cheatsheet as a PDF and desktop wallpaper here. 

3. LinkedIn: We create content on LinkedIn daily. You can follow Cody here and Kyle here.

4. Courses: Our course on showcasing your data portfolio is live!

That’s it for today.

Stay crunchin’ folks and see you next week!

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

What'd you think of today's newsletter?

Login or Subscribe to participate in polls.