Articles Cookbook

Tag: Aggregate functions

Common SQL Window Functions: Positional Functions

Positional SQL window functions deal with data's location in the set. In this post, we explain LEAD, LAG, and other positional functions. SQL window functions allow us to aggregate data while still using individual row values. We've already dealt with ranking functions and the use of partitions. In this post, we'll examine positional window functions, which are extremely helpful in reporting and summarizing data. Specifically, we'll look at LAG, LEAD, FIRST_VALUE and LAST_VALUE.

SQL Statistical Analysis Part 3: Measuring Spread of Distribution

Besides knowing the centers of a distribution in your data, you need to know how varied the observations are. In this article, we’ll explain how to find the spread of a distribution in SQL. Are you dealing with a very uniform or a very spread population? To really understand what the numbers are saying, you must know the answer to this question. In the second part of this series, we discussed how to calculate centers of distribution.

An Introduction to Using SQL Aggregate Functions with JOINs

-- Previously, we've discussed the use of SQL aggregate functions with the GROUP BY statement. Regular readers of the our blog will also remember our recent tutorial about JOINs. If you're a bit rusty on either subject, I encourage you to review them before continuing this article. That's because we will dig further into aggregate functions by pairing them with JOINs. This duo unleashes the full possibilities of SQL aggregate functions and allows us to perform computations on multiple tables in a single query.

A Beginner’s Guide to SQL Aggregate Functions

Aggregate functions are powerful SQL tools that compute numerical calculations on data, allowing the query to return summarized information about a given column or result set. These functions can be used in conjunction with the GROUP BY statement. Let’s see how they work using some easy examples. SQL Aggregate Functions Suppose we have users residing in a city, and we store their information in two tables. These tables and their relationship are shown below:

Useful SQL Patterns: Conditional Summarization with CASE

As you start coding in SQL, you will use some statements and techniques over and over again. We call these "SQL patterns". This series will look at the most common SQL patterns and consider how to use them. Previously, we looked at the SQL pattern of matching NULLs. This is important when you are comparing columns containing NULL values. Today, we're going to consider another SQL practice: conditional summarization with CASE operator.

NULL Values and the GROUP BY Clause

We've already covered how to use the GROUP BY clause and some aggregation functions like SUM(), AVG(), MAX(), MIN(), COUNT(). In this article, we will explain how the GROUP BY clause works when NULL values are involved. We will also explain about using NULLs with the ORDER BY clause. In SQL, NULL is a special marker used to indicate that a data value does not exist in the database. For more details, check out Wikipedia's explanation of NULL in SQL.

Tag: Avg

The SQL Coalesce Function: Handling Null Values

You may already know how to return null values in SQL. Now, we’re going to learn how to do the opposite. Though the SQL COALESCE function may seem complex, it’s actually very straightforward and useful. Let’s look at several examples of how the SQL COALESCE function can be used to work with NULL values in SQL. The Need for Coalesce in SQL Before we dive into the SQL COALESCE function in detail, you should understand how NULL values behave in expressions.

How Often Employees Are Running Late for Work: SQL Datetime and Interval SQL Arithmetic

Computing Tardiness: Date, Time, and Interval SQL Arithmetic In this article, we’re going to discuss some interesting operations we can perform with date-related data types in SQL. The SQL standard, which most relational databases comply with these days, specifies the date-related data types that must be present in relational databases. The most important of such data types are date, time, timestamp, and interval. Here’s a brief rundown of the differences between these data types:

Tag: Behind the scenes

Behind the Scenes at LearnSQL.com: How Our SQL Courses Are Created

Take a peek behind the scenes and learn our secret for creating great SQL courses! Have you ever wondered how LearnSQL.com courses are created? Are we looking at a lot of hard work or just a bit of magic? Or maybe both? Here’s a hint: we rely on proven methods to create user-friendly online courses. But it’s not easy! Read on to see the 8 steps we take when creating a new SQL course.

LearnSQL Track of the Season: SQL from A to Z

During Fall 2020, our main SQL track, SQL from A to Z, will be in the spotlight. In this article, we answer the most frequently asked questions about this track. At LearnSQL.com, our SQL courses are organized into tracks. A track is a sequence of courses designed to help you achieve a specific learning goal. The courses in the track are in a recommended order that progresses from the easiest to the most challenging.

A Mathematician in the World of SQL

She has a PhD in Mathematics and over 10 years’ experience teaching mathematics and computer science at the University of Warsaw. She knows SQL better than just about anyone I’ve met. Let’s get to know Agnieszka Kozubek-Krycuń, Vertabelo’s Chief Content Officer at Vertabelo. Let's go back in time. How did your adventure with math start? I’ve always enjoyed abstract concepts and problem solving. I was fascinated by variables when we learned to solve simple equations like x+2=5 in primary school.

You Want to Learn SQL? You've Come to the Right Place!

It is difficult to list all the benefits of learning SQL. You will work faster and more efficiently with a database, you will no longer be dependent on the IT department, and you will be able to analyze the data yourself and draw appropriate conclusions, among others. Add reporting to this, and you will get a very wide range of cool and useful skills. Maybe you want to change jobs or get a promotion?

Why Take the “SQL Basics” Course at LearnSQL.com

LearnSQL.com’s interactive “SQL Basics” course teaches the foundations of SQL. Discover why we built this online course, our philosophy behind it, and what it contains! What Is SQL, and Why Should You Learn It? SQL is a language used to talk to databases, computer programs that hold data and can process it efficiently. SQL can select data from a database and perform various computations on the data, be they simple or complex.

The Man Behind LearnSQL.com

If it wasn't for this guy, LearnSQL.com would never have been created. He manages the entire company, makes strategic decisions – and talks little about himself. Who is the man behind LearnSQL.com? Meet Vertabelo CEO Jarosław Błąd. SELECT interests, early_career, advice FROM Jarek AS the_man_behind_learnsql.com WHERE answer IS NOT Null AND success IS True; If you were to write one sentence about yourself, what would it be? I think I would say that I am an ordinary, simple guy who really likes what he does.

SQL Cookbook with Recipes for Success

The internet holds a lot of information and can provide solutions to various problems. SQL users, both beginners and advanced, often turn to the internet for help with SQL queries. This article will help you find the right SQL queries to solve your problems. Learn what the SQL Cookbook is and why you should use it. You will also find a list of the most important recipes, from which you will prepare a great SQL dish with the taste of success.

Tag: Book review

Our 6 Favorite SQL Books for 2020

So you want to learn SQL and query databases? Great! Check out these six SQL books for an in-depth look at the language and you’ll be writing queries in no time! You take SQL courses, participate in internet discussions and forums, watch tutorials on YouTube... What else can you do to develop your skills? Sometimes it’s good to reach for old-fashioned sources of knowledge: SQL books. Which book(s) should you choose?

Book Review: “Learn SQL the Hard Way” by Zed A. Shaw

“Learn SQL the Hard Way” by Zed A. Shaw is a great ebook for those who want to learn SQL essentials. At $19.99 USD, it may seem a bit expensive for an ebook, but you’re getting a DRM-free PDF, plus a whole bunch of explanatory videos and additional files. Who should read “Learn SQL the Hard Way”? Anyone interested in SQL basics – modifying databases or selecting information. Make no mistake about it: this book focuses heavily on the practical side of database language.

LearnSQL.com Review: “SQL Cookbook” by Anthony Molinaro

Recipes that make querying easy, even for the novice. In today’s information age, we have at our fingertips almost an overabundance of teaching and information on any and every subject. In the midst of this glut of information, it can be hard to decide which is the best source for our needs. But, fear not; we are here to assist you as you navigate through decisions about books on SQL topics!

5 Books That Will Grow Your SQL Skills

Which books will help you build your database skills? We look at five awesome SQL books. There’s a common saying that “all wise men read books”. I would say that all professionals read books – particularly those related to their field. There are many books about databases and SQL; most are tied to specific vendors (DB2, Oracle, MS SQL) but there are also plenty that are vendor-neutral. In this article, I’m going to review a few books that I would recommend to SQL learners at various levels of proficiency.

Tag: Calculating

SQL Statistical Analysis Part 2: Calculating Centers of Distribution

My previous article explained how to calculate frequencies using T-SQL queries. Frequencies are used to analyze the distribution of discrete variables. Today, we’ll continue learning about statistics and SQL. In particular, we’ll focus on calculating centers of distribution. We’ll learn e.g. how to calculate the SQL median, what functions to use to calculate the SQL mode, and how to calculate various types of mean in SQL (geometric mean, harmonic mean and, of course, arithmetic mean).

SQL Statistical Analysis Part 1: Calculating Frequencies and Histograms

Database and Business Intelligence (BI) developers create huge numbers of reports on a daily basis, and data analyses are an integral part of them. If you wonder whether you can perform statistical analysis in SQL, the answer is ‘yes’. Read my article to learn how to do this! Statistics are very useful as an initial stage of a more in-depth analysis, i.e. for data overview and data quality assessment. However, SQL statistical analysis possibilities are somewhat limited as there are not many statistical functions in SQL Server.

Tag: Career in data science

Why Use SQL Over Excel

SQL is replacing Excel in many fields, and data analysis is certainly one of them. If you are still using Excel as a data analyst, you are missing something very valuable. SQL can make your life easier, as it's more efficient and faster than Excel. So, how and from where can you learn SQL? How Can SQL Help Data Analyst? You can use SQL to help you with the following work:

Career Change: From Accountant to Database Designer

How do career changes and life choices impact our future? Can we change the path that's been set for us? And if so, where do we begin? I wouldn't blame you if you thought this article is about change. In a sense, it is—it's in the title, after all. But for me, this article is more about what remains constant. If somebody were to ask me what hasn't changed for me since my childhood, I would know the answer immediately: curiosity.

Complete SQL Practice for Interviews

Congratulations! Your SQL skills were strong enough to get you that job interview! Now, if you only knew what SQL que[stions and practical exercises a recruiter might ask you to do… This article is meant as a SQL practice for interviews. I’ll help you prepare for the SQL and database aspects of your job interview. In a previous article, I explained how can you boost your career by learning SQL.

Finding the Perfect SQL Job

So you have some SQL skills and you're looking for a job that will use them. What are your options? SQL is everywhere, and there's a huge demand for people with database management skills. This is especially the case when companies start implementing Big Data solutions and strategies. There's no arguing that SQL is a must-have skill. If you're already proficient, how can you put your expertise to practical use in the job market?

A Day in the Life of a SQL Developer

What is a SQL developer? And what does a SQL developer do? Describing a “typical” day for a SQL developer is not easy. When your daily work is using various technologies to create interesting database-oriented products, very few days are alike! Each day brings a new and intriguing challenge. Nevertheless, I’ll have a go at explaining what everyday things a SQL developer might do. -- Morning: Arrive at Work What does a SQL developer do after arriving at the office?

Tag: Case

Useful SQL Patterns: Conditional Summarization with CASE

As you start coding in SQL, you will use some statements and techniques over and over again. We call these "SQL patterns". This series will look at the most common SQL patterns and consider how to use them. Previously, we looked at the SQL pattern of matching NULLs. This is important when you are comparing columns containing NULL values. Today, we're going to consider another SQL practice: conditional summarization with CASE operator.

Using CASE with Data Modifying Statements

What happens when you combine CASE with SQL's data modifying statements? Find out in this article. The CASE expression is a very useful part of SQL and one that you'll employ frequently. We've already covered what the CASE expression does, how to format it, and how to use it in a SELECT statement in "Using CASE to Add Logic to a SELECT". Another article, "How to Sort Records with the ORDER BY Clause"

Using CASE to Add Logic to a SELECT

As you write an SQL query, you may need to get values from multiple columns and change values from one form to another. The simple way to achieve this goal is to add a CASE expression to your SELECT statement. In this article, we'll introduce you to the syntax, formats, and uses of the CASE expression. The CASE expression is a conditional expression: it evaluates data and returns a result.

Tag: Cheat sheet

SQL Window Functions Cheat Sheet

Download this 2-page SQL Window Functions Cheat Sheet in PDF or PNG format, print it out, and stick to your desk. The SQL Window Functions Cheat Sheet provides you with the syntax of window functions, a list of window functions, and examples. You can download this cheat sheet as follows: Download 2-page SQL Window Functions Cheat Sheet in PDF format (A4) Download 2-page SQL Window Functions Cheat Sheet in PDF format (Letter) Download 1-page SQL Window Functions Cheat Sheet in PDF format (A3) Download 1-page SQL Window Functions Cheat Sheet in PDF format (Ledger) Window Functions Window functions compute their result based on a sliding window frame, a set of rows that are somehow related to the current row.

Tag: Common sql functions

18 Useful Important SQL Functions to Learn ASAP

Beginning with SQL: Useful Functions to Master Learning a new programming language can seem intimidating. Like any other language, a programming language has a large vocabulary that you need to master. In this article, we'll look at some of the most useful SQL functions that you need to know. There are many useful SQL functions for working with different data types. Once you practice with some of the most common ones, you'll gain enough confidence to move on to more advanced material.

Tag: Common sql mistakes

Extracting Data From a String: SPLIT_PART in PostgreSQL

Learn how to use split_part in PostgreSQL to extract data from strings. Quite often, we’d like to extract parts of a string when working with text values. A common example is when we have a full name and need to retrieve only the last name. In this article, we’ll examine how to do it using split_part in PostgreSQL, i.e. a string-related function that can be used to extract a substring.

How to Remove Junk Characters in SQL

Unwanted characters in text data can be a bit of a pain, but there’s an easy way to fix them. Scroll down to learn how to remove junk characters in SQL in the easiest way! Sometimes, we’ll find unwanted characters inside our string data because our SQL queries didn’t work as expected. Moreover, these extra characters may sometimes be invisible, which really complicates things. In this article, we’ll examine some string-related SQL functions that can handle unwanted characters—visible or not!

How to Solve Capitalization Data Quality Issues

Misspelled names, typos, and text data quality issues in your database? Power up your queries! Use SQL string functions to address data quality issues related to capitalization. Sometimes, our SQL queries don't work as expected because of data quality issues. In this article, we will examine some string-related SQL functions that can correct data quality issues related to capitalization. We'll be using PostgreSQL in our examples, but similar functions are available in most database engines.

Preventing Common SQL Mistakes

Regardless of the engine you are using (SQL Server, MySQL, Oracle, etc.), you can prevent common errors and simplify the debugging process. This article will discuss some of the common SQL mistakes you’ll face and will help you correct them easily. One of the best ways to prevent the most common SQL mistakes is to keep your queries clear and readable. It’s very easy to forget the ideas behind your code!

Tag: Common table expressions

How to Draw a Christmas Tree in SQL

You can use SQL to manipulate all kinds of data, from huge analytical queries to brief single-purpose statements. But you can also use SQL just for fun, without any business requirements stifling your creativity. So, get out your jolly hat and prepare to sing O Christmas Tree as we create some quirky art with plain old SQL. Today, we’re going to generate some holiday-themed ASCII art, just for fun. That’s right.

Simplify SQL Code: Recursive Queries in DBMS

Hey SQL users! Are you repeating the same query in every report? Are your queries getting too complicated? Use recursive queries to simplify SQL code! Too many SQL reports can lead to clutter on your desktop and in your head. And is it really necessary to code each of them separately? Ad-hoc queries can share much of the same SQL code with managerial reports and even regulatory reports. Suppose you’ve been writing basic SQL code for a while.

How to Organize SQL Queries with CTEs

Common table expressions (CTEs) allow you to structure and organize SQL queries. Knowing how to organize SQL queries is a necessity when you begin to move deeper into SQL, so if you want to become an SQL master, you need to know CTEs. The SQL CTE has been part of standard SQL for some time now. CTEs – which are also called WITH statements – are available in all major RDBMS.

Long SQL Query vs. Recursive SQL Query

Recursion is one of the central ideas in computer science. We can define it as a method for solving problems where the solution of the problem depends on solving a smaller instance of a problem. If this sounds complicated do not fret, in this article we will learn about recursion in SQL that you can practice and deepen in Vertabelo Academy. Recursion is a way of solving hierarchical problems we find in data with common SQL.

Tag: Conditional summarization

Useful SQL Patterns: Conditional Summarization with CASE

As you start coding in SQL, you will use some statements and techniques over and over again. We call these "SQL patterns". This series will look at the most common SQL patterns and consider how to use them. Previously, we looked at the SQL pattern of matching NULLs. This is important when you are comparing columns containing NULL values. Today, we're going to consider another SQL practice: conditional summarization with CASE operator.

Tag: Course of the month

SQL Course of the Month - Analyzing Revenue Trends in SQL

We work hard, we learn SQL, and we develop professionally. But why? For our own satisfaction, but also for money! The knowledge of SQL will increase your income significantly. If you are proficient in SQL, you can better analyze your company's revenue. How? I asked Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo. In this article, she answers your questions about our September SQL Course of the Month: Analyzing Revenue Trends in SQL.

SQL Course of the Month - Recursive Queries

Recursive Queries is one of SQL’s more advanced features. You could say they divide SQL users into beginners and experts. But how do you learn recursive queries? And why do you need them, anyway? Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo, is here to help. In this article, she answers your questions about our August SQL Course of the Month: Recursive Queries. Recursive queries … that sounds very serious. What are they?

SQL Course of the Month - PostGIS

It's summer, and it's travel time ... at least it would be under normal conditions. The pandemic is still going on, but that doesn't stop us from dreaming about distant trips and visits to beautiful places. For now, most of us will have to do it on a map. Did you know that databases can store geographical data? With interactive maps, if you find a nice summer house on the internet, you can accurately track it and plan the best route there.

SQL Course of the Month - SQL Practice Set

It is said that practice makes perfect. I agree with this statement one hundred percent. What is applicable in basketball training, playing an instrument, or learning a foreign language is also useful in learning SQL. Practicing writing queries, using functions, and putting together clauses is the basis for learning the true power of SQL. But how and where do you practice SQL? I spoke with Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo about this.

SQL Course of the Month - Creating Basic SQL Reports

In May, we chose Creating Basic SQL Reports as our course of the month. Why? Because the basis of every successful business is making the right decisions based on proven data and good SQL reports. I asked Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo, about this. She knows SQL better than just about anyone and is probably the best person to talk about SQL Reporting. What does it mean to create SQL reports?

SQL Course of the Month - Window Functions

Spring has come. It is nicer outside. It's a great time to learn something new. Which course should you choose? In April, it's worth it to bet on SQL window functions. What are they, what are they used for, and why are they worth knowing? I asked Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo, these questions. She has a PhD in mathematics and over 10 years’ experience teaching mathematics and computer science at the University of Warsaw.

Tag: Creating tables

Learn SQL Views in 30 Minutes

Views aren't complicated – if you've got half an hour, we'll get you started writing SQL queries using views! Let's start by answering the question "What is a view in SQL?'. A view is a database object (as is a table, an index, or a stored procedure). Like a table, you can query a view and extract the information in it. It can be used in the FROM clause of a SELECT, and you can reference view columns in clauses like SELECT, WHERE and GROUP BY among other clauses as well.

Tag: Cte

How to Use 2 CTEs in a Single SQL Query

Have you ever wondered how to use multiple CTEs in one SQL query? Read this article and find out about recursive CTEs. After learning common table expressions or CTEs, a natural question is “Can I use several CTEs in one query?” Yes, you can! And you can do it quite easily, especially if you already have some basic knowledge of CTEs. Whether you know a bit about CTEs or you’re entirely new to the CTE world, reading about what a CTE is is always a good start.

How CTEs Work

The SQL language offers a feature named Common Table Expressions, or CTEs. Also known as WITH clauses, CTEs are a fairly new addition to SQL. They help you break longer queries into smaller chunks, making your queries much easier to understand. Read the article to find out how to use CTEs and how they differ from traditional subqueries. Common Table Expressions (CTEs), which are essentially named subqueries, were first mentioned in the SQL standard between 1999 and 2000.

SQL CTEs Explained with Examples

Learn how you can leverage the power of Common Table Expressions (CTEs) to improve the organization and readability of your SQL queries. The commonly used abbreviation CTE stands for Common Table Expression. However, that simple fact doesn’t add much to your understanding. What does a CTE do? Why might you want to use one in your SQL code? Let’s answer those questions. What Is a CTE? A Common Table Expression is a named temporary result set.

When Should I Use a Common Table Expression (CTE)?

Interested in hearing more about common table expressions or CTEs? Would you like to know when CTEs are useful? Read on—we’ll discuss in this article. If you’ve heard of common table expressions, you’ve probably wondered what they do. Even if you have not, it’s good that you’re here! CTEs can be very useful, especially if you have already mastered the basics of SQL, such as selecting, ordering, filtering data, and joining tables.

What Is a CTE?

After mastering statements like SELECT, DELETE, INSERT, and GROUP BY, you might search for ways to improve code maintainability, reproducibility, and readability. At that point, you will probably start learning about modern SQL concepts that were introduced in the early 2000s. One such SQL technique is the CTE? (common table expression) —?a temporary named result set. In this article, you will learn what a CTE is and how to use it to improve the maintenance and the readability of your code.

How to Draw a Christmas Tree in SQL

You can use SQL to manipulate all kinds of data, from huge analytical queries to brief single-purpose statements. But you can also use SQL just for fun, without any business requirements stifling your creativity. So, get out your jolly hat and prepare to sing O Christmas Tree as we create some quirky art with plain old SQL. Today, we’re going to generate some holiday-themed ASCII art, just for fun. That’s right.

Simplify SQL Code: Recursive Queries in DBMS

Hey SQL users! Are you repeating the same query in every report? Are your queries getting too complicated? Use recursive queries to simplify SQL code! Too many SQL reports can lead to clutter on your desktop and in your head. And is it really necessary to code each of them separately? Ad-hoc queries can share much of the same SQL code with managerial reports and even regulatory reports. Suppose you’ve been writing basic SQL code for a while.

How to Organize SQL Queries with CTEs

Common table expressions (CTEs) allow you to structure and organize SQL queries. Knowing how to organize SQL queries is a necessity when you begin to move deeper into SQL, so if you want to become an SQL master, you need to know CTEs. The SQL CTE has been part of standard SQL for some time now. CTEs – which are also called WITH statements – are available in all major RDBMS.

Long SQL Query vs. Recursive SQL Query

Recursion is one of the central ideas in computer science. We can define it as a method for solving problems where the solution of the problem depends on solving a smaller instance of a problem. If this sounds complicated do not fret, in this article we will learn about recursion in SQL that you can practice and deepen in Vertabelo Academy. Recursion is a way of solving hierarchical problems we find in data with common SQL.

How Recursive Common Table Expressions Work

Recursive Common Table Expressions are immensely useful when you're querying hierarchical data. Let's explore what makes them work. Common Table Expressions (CTEs) are some of the most useful constructions in SQL. Their main purpose is improving query design, which makes queries easier to read. One of the reasons CTEs are so popular is that they let you divide longer queries into shorter subqueries. These are easier to read and edit.

How to Organize SQL Queries When They Get Long

The first long SQL query you’ll have to deal with is likely to be hard for you to structure and understand. These five tips will teach you the best way to organize SQL queries, i.e. write and format them. As we all know, SQL queries are essential to database management. Without them, it would be extremely difficult to find and work with the information in a database. Query length depends on the type of information we need and the size of the database.

Improving Query Readability with Common Table Expressions

What is a Common Table Expression, or CTE? Where do you use them, and why? This post answers your questions. Simply put, Common Table Expressions (also known as WITH clauses) are essentially named subqueries. They also provide additional features like recursion. If you're new to subqueries, I recommend you read the SQL Subqueries article before continuing. The main purpose of Common Table Expressions is to improve the design and readability of an SQL statement.

Tag: Data analysis

Why Use SQL Over Excel

SQL is replacing Excel in many fields, and data analysis is certainly one of them. If you are still using Excel as a data analyst, you are missing something very valuable. SQL can make your life easier, as it's more efficient and faster than Excel. So, how and from where can you learn SQL? How Can SQL Help Data Analyst? You can use SQL to help you with the following work:

SQL Indexing 101

Indexes are one of the most misused and misunderstood entities in physical database design. A good understanding of indexes and how they solve database performance problems is necessary for any database novice. In this article, we'll look at basic database indexes and their role in database development. To picture what an index is, consider a textbook. At the end of most textbooks is an index listing all the terms one can find in the text and the pages on which they appear.

How to Use a SQL Wildcard

SQL wildcard allows us to filter data matching certain patterns in SQL. We use SQL wildcards with the LIKE operator in the WHERE clause of a query to filter data. In this beginner’s article, we’ll look at everything you need to know about basic SQL wildcards. If you like playing cards, then you know that wildcards can substitute any other card in your deck. Similarly, SQL wildcards can substitute one or more characters.

Our Picks for 2020’s 7 Best Online SQL Schools

If you’re looking for the best online SQL courses but aren’t sure where to start, you’re in the right place. I evaluated the top 7 ranked SQL schools available online to help you find the right solution. While summer is a great time to relax and get away from work, it’s also an excellent opportunity to learn new skills – like SQL! Thanks to SQL schools putting their courses on the internet, learning new tech skills is super easy and you can choose from a variety of formats to suit your needs.

Why Learn SQL Over the Summer

Think summer is reserved for flying to warm places and hanging out at the beach? Sure! But it's also a great time to learn new skills that you haven't had time for. -- If you recently graduated from high school and want to get a head start on computer programming for college, learning SQL over the summer is a great opportunity. You have nothing to lose and everything to gain—SQL is actually really easy to learn, especially with so much free time over the summer.

Key Insights for Mastering SQL Queries Using Tinder Data Example

Going from zero to one can be daunting in any endeavor. The same is true for learning new programming languages, even simple ones like SQL. In this article, we’ll take a look at some key insights that will help you understand the nuances of mastering SQL queries. If you’ve never used SQL, you’re in the right place. When learning anything new, you’ll find that there are always some key insights or tips that can help you on your way.

Improving Slow Query Performance: When Runtime Matters

As SQL users, we usually focus on writing queries that return correct results. However, there are more things to consider when you're writing a query; one of them is query performance. In this article, we'll look at some examples where query response time is critical. Scene One: 911 Call Center Let's suppose we're at a 911 call center, when the phone rings. One of the operators answers the call; a witness reports that a man has been shot.

Converting Subqueries to Joins

Not all queries are alike, especially in terms of performance. In this article, we'll look at how you can convert SQL subqueries to joins for improved efficiency. When should I use SQL subqueries? Great question! Unfortunately, there's no concrete answer. SQL beginners tend to overuse subqueries. Typically, once they find that SQL construction works in one situation, they try to apply that same approach to other situations. It's only natural.

Learn to Write a SQL Correlated Subquery in 5 Minutes

If you’re familiar with the famous Russian nesting doll, then SQL correlated subqueries should be a peace of cake to understand—subqueries are just queries nested within queries. An SQL subquery is often called an “inner” query; the main query is usually called the “outer” query. This article covers everything you need to know about correlated subqueries. What Exactly is a SQL Correlated Subquery? A correlated SQL subquery is just a subquery that is executed many times—once for each record (row) returned by the outer (main) query.

How to Become a Database Analyst

Curious about becoming a database analyst? Maybe you've taken some database courses at university and they really struck a chord. Or maybe you learned online. Now you're thinking about making a career out of working with databases. Where would you start? What should you expect at each phase of your professional development? In this post, we'll explore the challenging and exciting world of databases analysis. We'll go from the very beginning of a career to the apex of professional success.

Extracting Data From a String: SPLIT_PART in PostgreSQL

Learn how to use split_part in PostgreSQL to extract data from strings. Quite often, we’d like to extract parts of a string when working with text values. A common example is when we have a full name and need to retrieve only the last name. In this article, we’ll examine how to do it using split_part in PostgreSQL, i.e. a string-related function that can be used to extract a substring.

High-Performance Statistical Queries: Dependencies Between Discrete Variables

In my previous article, we looked at how you can calculate linear dependencies between two continuous variables with covariance and correlation. Both methods use the means of the two variables in their calculations. However, mean values and other population moments make no sense for categorical (nominal) variables. For instance, if you denote "Clerical" as 1 and "Professional" as 2 for an occupation variable, what does the average of 1.5 signify?

Digging Into Data: Explore and Analyze Survey Results With SQL

Excel is a powerful beast that lets you analyze complex data. Yet, operating on big chunks of data can sometimes be a daunting task. Let's take a look at how SQL can help. Today, we'll tackle a common problem with importing data to an SQL database, using a real-life example. Suppose your company conducted a survey on the most popular programming trends and preferences, striving to meet the expectations of its users.

SQL Hacks To Control Family Budget On Black Friday Weekend

If you’re in the US, chances are you’ve been eagerly awaiting the approach of Black Friday just as much as Thanksgiving. Though the shopping frenzy takes hold of nearly everyone, some people have to stick to their budgets and shop prudently. In this article, we’ll take a look at how generating an SQL report can help you track how much your family spent shopping on Black Friday. Storing Black Friday Purchases in a Database Before we can create an SQL report, we first need some data we can use.

Introduction to Reporting with SQL — the Ultimate Tutorial for Business Professionals

Working with the financial aspects of large and small enterprises can be a daunting task for a business professional. In this article, we'll look at several ways of constructing the perfect SQL report. You've probably already heard about SQL from your colleagues or in other areas of your career. If you're here, you've likely concluded that learning SQL will make your professional life easier – and you're right!

SQL Statistical Analysis Part 1: Calculating Frequencies and Histograms

Database and Business Intelligence (BI) developers create huge numbers of reports on a daily basis, and data analyses are an integral part of them. If you wonder whether you can perform statistical analysis in SQL, the answer is ‘yes’. Read my article to learn how to do this! Statistics are very useful as an initial stage of a more in-depth analysis, i.e. for data overview and data quality assessment. However, SQL statistical analysis possibilities are somewhat limited as there are not many statistical functions in SQL Server.

Tag: Data analyst

Should I Learn SQL as a Data Analyst?

So, you are a data analyst—someone who relies on data. You like to gather, clean, and transform data and come to conclusions based on data. You are a data detective. Which tool do you choose to do your job in an elegant, reproducible, and simple way? Excel? R? Python? Or should you learn SQL? Stay tuned! In this article, I will explain why SQL is a must-have skill for data analysts.

SQL Statistical Analysis Part 1: Calculating Frequencies and Histograms

Database and Business Intelligence (BI) developers create huge numbers of reports on a daily basis, and data analyses are an integral part of them. If you wonder whether you can perform statistical analysis in SQL, the answer is ‘yes’. Read my article to learn how to do this! Statistics are very useful as an initial stage of a more in-depth analysis, i.e. for data overview and data quality assessment. However, SQL statistical analysis possibilities are somewhat limited as there are not many statistical functions in SQL Server.

Tag: Data driven organization

How SQL supports data-driven organization

Typical business users make decisions based on gut feelings, but this can't get them so far. In this article, we'll look at how learning to write basic SQL queries helps your company become a data-driven organization. Businesses face many decisions. Do we increase our advertising budget in one region or the other? Are certain products selling quickly enough? What we should do if they aren't? Most of these decisions are driven by intuition, but organizations that make the most business impact use data-driven decision-making.

Tag: Data engineering

How Much Do Data Engineers Earn in 2020?

Data engineering is a hot job right now. What does a data engineer do? And just how much do they earn? We’ve done the research for you. If you are reading this, you’re either starting to learn SQL or you already know some and feel it’s time to look around for a SQL job. Maybe you’re in the midst of tackling our Creating Database Structure track. And, let’s be honest, maybe you need some extra motivation to keep on you track.

How to Create a Table in SQL

Creating tables in databases is a very helpful skill, and not just for software engineers or database administrators. It allows you to design or change the structure of a database and store data that’s related to each other. In this article, you’ll learn what a database table is, who creates them, and how to use the syntax of the CREATE TABLE command. What Is a Database Table? A relational database is built of various structures like tables, views, procedures, and triggers.

Who Is a Data Engineer?

A new kind of job has recently emerged in the IT world: Data Engineer. At first sight, it may seem very similar to Data Analyst or Data Scientist positions. However, our article explains all the important differences. We present the skills, tools, and everyday tasks of Data Engineers. We also explain how you can get started with this career path.   Thirty years ago, we typically used terms such as “Computer Scientist” when referring to anyone working with computers.

LearnSQL.com’s New Learning Path: Data Engineering

Calling all future data engineers! Would you like to learn to use SQL? Then our new Data Engineering Learning Path is just for you! We’re very excited to announce the release of a new learning path at LearnSQL.com: Data Engineering, published in July 2020. This is the second learning path offered in our platform. So far, we offered an analytical path, SQL Querying & Reporting, that focuses on writing queries and business reports in SQL.

What Is Data Engineering?

Data Engineering is a fairly new term in IT. And it’s getting more and more attention. You may have heard about a few similar fields like data science, Big Data, and machine learning. This article explains the difference between these concepts and shows how they can be combined to analyze vast amounts of data. When computers first appeared, their storage capacity was very limited. Do you remember floppy disks? They were popular in the late 20th century and typically offered around 1.

TRUNCATE TABLE vs. DELETE vs. DROP TABLE: Removing Tables and Data in SQL

What’s the difference between truncating, deleting, and dropping a table in SQL? Find out in this article. There are a lot of ways to delete data in SQL, including the DELETE, TRUNCATE TABLE and DROP TABLE commands. Which one should you use in a given situation? In this article, you’ll learn the syntax of each command in different database engines like MySQL, PostgreSQL, SQL Server, and Oracle. And you’ll understand the DROP TABLE vs.

Tag: Data modifying

Simplify SQL Code: Recursive Queries in DBMS

Hey SQL users! Are you repeating the same query in every report? Are your queries getting too complicated? Use recursive queries to simplify SQL code! Too many SQL reports can lead to clutter on your desktop and in your head. And is it really necessary to code each of them separately? Ad-hoc queries can share much of the same SQL code with managerial reports and even regulatory reports. Suppose you’ve been writing basic SQL code for a while.

Using CASE with Data Modifying Statements

What happens when you combine CASE with SQL's data modifying statements? Find out in this article. The CASE expression is a very useful part of SQL and one that you'll employ frequently. We've already covered what the CASE expression does, how to format it, and how to use it in a SELECT statement in "Using CASE to Add Logic to a SELECT". Another article, "How to Sort Records with the ORDER BY Clause"

Tag: Data quality

Extracting Data From a String: SPLIT_PART in PostgreSQL

Learn how to use split_part in PostgreSQL to extract data from strings. Quite often, we’d like to extract parts of a string when working with text values. A common example is when we have a full name and need to retrieve only the last name. In this article, we’ll examine how to do it using split_part in PostgreSQL, i.e. a string-related function that can be used to extract a substring.

How to Remove Junk Characters in SQL

Unwanted characters in text data can be a bit of a pain, but there’s an easy way to fix them. Scroll down to learn how to remove junk characters in SQL in the easiest way! Sometimes, we’ll find unwanted characters inside our string data because our SQL queries didn’t work as expected. Moreover, these extra characters may sometimes be invisible, which really complicates things. In this article, we’ll examine some string-related SQL functions that can handle unwanted characters—visible or not!

How to Solve Capitalization Data Quality Issues

Misspelled names, typos, and text data quality issues in your database? Power up your queries! Use SQL string functions to address data quality issues related to capitalization. Sometimes, our SQL queries don't work as expected because of data quality issues. In this article, we will examine some string-related SQL functions that can correct data quality issues related to capitalization. We'll be using PostgreSQL in our examples, but similar functions are available in most database engines.

Tag: Data types

Understanding Numerical Data Types in SQL

-- -- -- Working with databases of any kind means working with data. This data can take a couple of predefined formats. As you start on your learning path with LearnSQL.com, you will start to understand SQL’s different data types. In this article, we will cover different variations of the SQL numeric data type. We’ll also examine some functions that convert data from one type to another.

How to Recognize SQL Text Data Type

How can you store textual information in database tables? Thanks to this post, you’ll learn the characteristics of every text data type in SQL Note: This post is intended for readers familiar with SQL data definition language (DDL) and the DDL CREATE statement. To learn more about DDL, check out LearnSQL.com. Most data types are classified as NUMERIC, CHARACTER, or DATE. In this post, we’re going to focus on each CHARACTER or text data type in SQL.

Tag: Date and time

Useful SQL Patterns: Date Generator

As you start coding in SQL, you will use some statements and techniques over and over again. We call these “SQL patterns”. This series will look at the most common SQL patterns and consider how to use them. SQL patterns, such as the pivot pattern we discussed last week, can save you a lot of time and effort. Suppose you are asked to get a range of days in a financial quarter, but the only records you have are for the start and end dates of each quarter.

Performing Calculations on Date- and Time-Related Values

Relational databases support several date and time data types. In this article, we'll look at several arithmetic operations we can do on these types. These operations are logical and understandable, even for the beginning SQL coder. Let's first briefly explain the main data types used for dates and times. Keep in mind that data types may differ by database engine, so check your database documentation for specifics before you start working with them.

Tag: Date arithmetic

The SQL Coalesce Function: Handling Null Values

You may already know how to return null values in SQL. Now, we’re going to learn how to do the opposite. Though the SQL COALESCE function may seem complex, it’s actually very straightforward and useful. Let’s look at several examples of how the SQL COALESCE function can be used to work with NULL values in SQL. The Need for Coalesce in SQL Before we dive into the SQL COALESCE function in detail, you should understand how NULL values behave in expressions.

How Often Employees Are Running Late for Work: SQL Datetime and Interval SQL Arithmetic

Computing Tardiness: Date, Time, and Interval SQL Arithmetic In this article, we’re going to discuss some interesting operations we can perform with date-related data types in SQL. The SQL standard, which most relational databases comply with these days, specifies the date-related data types that must be present in relational databases. The most important of such data types are date, time, timestamp, and interval. Here’s a brief rundown of the differences between these data types:

Tag: Date functions

18 Useful Important SQL Functions to Learn ASAP

Beginning with SQL: Useful Functions to Master Learning a new programming language can seem intimidating. Like any other language, a programming language has a large vocabulary that you need to master. In this article, we'll look at some of the most useful SQL functions that you need to know. There are many useful SQL functions for working with different data types. Once you practice with some of the most common ones, you'll gain enough confidence to move on to more advanced material.

Tag: Delete

Learn SQL Views in 30 Minutes

Views aren't complicated – if you've got half an hour, we'll get you started writing SQL queries using views! Let's start by answering the question "What is a view in SQL?'. A view is a database object (as is a table, an index, or a stored procedure). Like a table, you can query a view and extract the information in it. It can be used in the FROM clause of a SELECT, and you can reference view columns in clauses like SELECT, WHERE and GROUP BY among other clauses as well.

Using CASE with Data Modifying Statements

What happens when you combine CASE with SQL's data modifying statements? Find out in this article. The CASE expression is a very useful part of SQL and one that you'll employ frequently. We've already covered what the CASE expression does, how to format it, and how to use it in a SELECT statement in "Using CASE to Add Logic to a SELECT". Another article, "How to Sort Records with the ORDER BY Clause"

Tag: Duplication

How to Track Down Duplicate Values in a Table

When it comes to information management, duplicates present one of the most common challenges to data quality. In this article, I'll explain how it is possible to find and distinguish duplicate names with the help of the SQL data programming language. I really like my maiden name. The reason I like it so much is because it's rare. My maiden name (first with last) provided a unique identifier on platforms such as LinkedIn, Facebook, Twitter and similar.

Tag: E learning

Top 5 Beginner Online SQL Courses in 2020

Looking for an exciting new career? Data analysis won’t disappoint you! The simplest way to make this possible is by learning SQL, and online SQL courses are the most effective learning method. Don’t know where to start? Here’s an overview of the best online SQL courses for complete beginners. There are infinite reasons for changing your industry. You may want to land a new job because you’re burnt out. You may be bored and want something more challenging.

Choose the Best Way to Learn SQL

SQL has become a hot topic in the professional world, and many resources have appeared both online and offline for learning SQL. It’s easy to get lost in the jungle of books, tutorials, and courses. Which resources do you choose? If you want to know how to learn SQL quickly and effectively, take a look at my list. There are many reasons for learning SQL. We asked our users about them and learned that there was no universal motive.

Online Education in the Times of COVID-19

LearnSQL.com grants free access to their Interactive courses till 04/20/2020. People around the world are faced with a new challenge. A challenge which requires swift action and adaptability. Students and teachers, employers and employees, families and friends. Many have shown vigilance and decisiveness, while at the same time trying their best to maintain their everyday-life continuity. However, there are those who, due to the current circumstances, need to postpone plans and invest their resources in different areas.

Stay at Home and Learn SQL for Free with LearnSQL.com

Working remotely is a dream come true for some. You ditch commuting and have more time for the people you love and the things you enjoy. For others, it's a challenge to maintain their focus when there are new distractions. It's also an opportunity to invest the few gained hours in learning something new. Staying at home can be a time when you might find yourself busier than you've ever been, but not getting many things done, and worse, not learning what you planned to.

What Programming Language Should You Learn?

If you've ever been wondering which programming language you should learn first, you know that's a tough nut to crack. It’s especially difficult if you are new to IT and programming. In this article, I give suggestions for what to learn first and what perspectives each language can give you in IT. There are hundreds of programming languages, and new ones are showing up all the time. Getting to know all of them is simply impractical and impossible.

How to Study Online: 5 Steps to Becoming an Effective Learner

If you suffer from procrastination or lack of motivation, you’re not alone. We have some online learning tips to make your learning journey smoother and more enjoyable. One of the best things about being an adult is that we can do what we want: go to sleep late at night, party until morning, eat junk food. Besides all those small pleasures, as adults we are responsible for ourselves, our choices, and our mistakes.

Tag: Elearning

A Non-Technical Introduction to Learning SQL on Your Lunch Break

Do you think learning SQL will help you in your career? You are right. SQL is one of the easiest computer languages to learn. These days many non-IT employees have SQL skills and use them to extend their professional capacity. Moreover, more and more companies are encouraging their employees in non-IT areas (like sales, advertising, and finances) to learn and use SQL. One of the benefits of empowering employees with SQL skills is that once you answer one data question, the results will generate a new data question, and then perhaps a cascade of further data questions.

SQL Mythbuster – 5 Reasons Why No One Should Be Afraid of SQL

Anyone can learn SQL. It’s not as hard as you think! In today’s world, even those in non-technical jobs need some technical skills. And you don’t have to be a hard-core nerd to get these skills. Let me tell you my own story. A few years ago, I wasn’t considering learning SQL or anything else that I labelled “technical”. My background is in sociology, journalism, and scriptwriting, and I thought computer languages were pretty sci-fi.

How to Learn SQL: 6 Ideas for Newbies

Learning a new skill can be a daunting task, especially in programming. SQL is not immune to this. Luckily, with the Internet and the explosion of programming-related information out there, there are a lot of options you can use to undergo your SQL training! But we then come to a new roadblock. Where to begin? How will we know which option is best for our budget, skill level, and schedule?

Tag: Extras

SQL INSERT, SQL UPDATE, SQL DELETE – Oh My!

Need to understand SQL INSERT, UPDATE, or DELETE? We'll get you up to speed with a comprehensive How-To and useful examples! SQL INSERT, UPDATE, and DELETE statements—what are they all about? If you're a data engineer, a database administrator, or even just your average data fanboy or girl, one day you're going to find yourself with a database that becomes your "baby." Charged with this special bundle of joy, you're going to need to feed and change the little fella.

SQL, Databases, and Hollywood Movies

Policemen, doctors, lawyers, scientists, teachers: These are the professions that we often see in Hollywood movies. But are movies also trying to show what the work of data analysts looks like? Here is a list of six movies in which screenwriters, directors, and producers decided to cast SQL and databases in the main roles. Data analysis is most often associated with business, reporting, and making key decisions for the company.

Career Change: From Accountant to Database Designer

How do career changes and life choices impact our future? Can we change the path that's been set for us? And if so, where do we begin? I wouldn't blame you if you thought this article is about change. In a sense, it is—it's in the title, after all. But for me, this article is more about what remains constant. If somebody were to ask me what hasn't changed for me since my childhood, I would know the answer immediately: curiosity.

Forget About Excel, High Five With SQL

Find out why you should forget about Excel and start using SQL even if you're not an IT expert. We'll show you how easy it is to learn SQL, how it can make you work better, and how LearnSQL.com makes the learning process fun. "I Don't Deal With Data" We frequently hear the sentence above from people outside the IT industry. Well, it's not entirely true. Data is now almost everywhere.

How to Install PostgreSQL on Windows 10 in 5 Minutes

It may look like a complicated task to install PostgreSQL, Oracle, or SQL Server or any other database software, but it really isn’t! These days, most relational database management systems come with installation wizards that make the process much simpler. In this article, we’ll look at how to install PostgreSQL and test that the installation is working. Install PostgreSQL: Steps Involved To install PostgreSQL, we’ll complete the following tasks:

Our Picks for 2020’s 7 Best Online SQL Schools

If you’re looking for the best online SQL courses but aren’t sure where to start, you’re in the right place. I evaluated the top 7 ranked SQL schools available online to help you find the right solution. While summer is a great time to relax and get away from work, it’s also an excellent opportunity to learn new skills – like SQL! Thanks to SQL schools putting their courses on the internet, learning new tech skills is super easy and you can choose from a variety of formats to suit your needs.

Why Learn SQL Over the Summer

Think summer is reserved for flying to warm places and hanging out at the beach? Sure! But it's also a great time to learn new skills that you haven't had time for. -- If you recently graduated from high school and want to get a head start on computer programming for college, learning SQL over the summer is a great opportunity. You have nothing to lose and everything to gain—SQL is actually really easy to learn, especially with so much free time over the summer.

Essential SQL Terms to Know for Beginners and Pros

Working with databases can seem daunting to a non-technical person. Right away, you’re bombarded with new terms that make your head spin. Database, database instance, table, SQL and others are some of the basic terms that you need to understand just to have a normal conversation with your technical colleagues. In this article, we’ll explore some basic SQL database terminology you need to know to succeed. Imagine you’re attending a meeting with the development staff and suddenly feel as if you’re listening to white noise.

15 Best SQL Articles for Beginners Published in 2017

For this post, I've gathered 15 of the most interesting SQL articles published in 2017. If you're looking for articles on SQL for beginners, want to learn more about databases and SQL queries, or just expand your knowledge of SQL, this article is perfect for you. Let's dive right in! Top 3 Vertabelo Academy Articles I'll start off the list with three of the most popular Vertabelo Academy SQL articles.

How to Draw a Christmas Tree in SQL

You can use SQL to manipulate all kinds of data, from huge analytical queries to brief single-purpose statements. But you can also use SQL just for fun, without any business requirements stifling your creativity. So, get out your jolly hat and prepare to sing O Christmas Tree as we create some quirky art with plain old SQL. Today, we’re going to generate some holiday-themed ASCII art, just for fun. That’s right.

SQL Hacks To Control Family Budget On Black Friday Weekend

If you’re in the US, chances are you’ve been eagerly awaiting the approach of Black Friday just as much as Thanksgiving. Though the shopping frenzy takes hold of nearly everyone, some people have to stick to their budgets and shop prudently. In this article, we’ll take a look at how generating an SQL report can help you track how much your family spent shopping on Black Friday. Storing Black Friday Purchases in a Database Before we can create an SQL report, we first need some data we can use.

What Is Vertabelo’s SQL Cheat Sheet?

Everyone, from rookie programmers to SQL ninjas, needs a bit of help now and again. Enter Vertabelo's SQL Cheat Sheet! Working with databases is hard. There's a lot of data to manage, which can be daunting. But the main challenge many database users face is the SQL commands themselves. It's all right when you're using the same familiar ones day after day, but what about the commands you dust off once or twice a year?

The 5 Highest Paying Jobs That Use SQL

IT provides a wide and growing job market, offering many excellent opportunities in both career development and earning potential. Today we’ll take a look at several very interesting types of database jobs that use SQL. Every year, many in the work force set their sights and aim for new and better jobs. When it comes to jobs, “better” means different things to different people, but earning potential is almost always a top priority.

SQL Mythbuster – 5 Reasons Why No One Should Be Afraid of SQL

Anyone can learn SQL. It’s not as hard as you think! In today’s world, even those in non-technical jobs need some technical skills. And you don’t have to be a hard-core nerd to get these skills. Let me tell you my own story. A few years ago, I wasn’t considering learning SQL or anything else that I labelled “technical”. My background is in sociology, journalism, and scriptwriting, and I thought computer languages were pretty sci-fi.

5 Books That Will Grow Your SQL Skills

Which books will help you build your database skills? We look at five awesome SQL books. There’s a common saying that “all wise men read books”. I would say that all professionals read books – particularly those related to their field. There are many books about databases and SQL; most are tied to specific vendors (DB2, Oracle, MS SQL) but there are also plenty that are vendor-neutral. In this article, I’m going to review a few books that I would recommend to SQL learners at various levels of proficiency.

Should I Learn SQL? 4 Convincing Reasons

There are 250+ computer programming languages in popular use. Why should you learn SQL, or Structured Query Language? Why Should You Learn SQL? Why learn SQL? To answer this question, you should start with reflecting on your professional life. Are you interested in boosting your career? Wondering what skills are worth investing in? If you’re currently in your dream job, still searching for it, or even thinking about starting your own business, it pays to develop your technical skills.

Tag: Fetch

Oracle Top-N Queries for Absolute Beginners

It's common to run a query using only part of a dataset – for example, the top 100 salespeople in a company. In this article, we'll see how to use Oracle's Top-N query method to query just these rows. Top-N queries retrieve a defined number of rows (top or bottom) from a result set. In other words, they find the best or worst of something – the ten best selling cars in a certain region, the five most popular routers, the 20 worst-performing stores, etc.

Tag: Foreign key

Referential Constraints and Foreign Keys in MySQL

Foreign keys and referential constraints allow you to set relationships between tables and modify some of the database engine’s actions. This beginner’s guide explains referential integrity and foreign key use in MySQL. One of the most important aspects of database usage is being able to trust the information you store. Database engines provide several features that help you maintain the quality of your data, like defining required columns as NOT NULL and setting an exact data type for each column.

Tag: Free sql course

Stay at Home and Learn SQL for Free with LearnSQL.com

Working remotely is a dream come true for some. You ditch commuting and have more time for the people you love and the things you enjoy. For others, it's a challenge to maintain their focus when there are new distractions. It's also an opportunity to invest the few gained hours in learning something new. Staying at home can be a time when you might find yourself busier than you've ever been, but not getting many things done, and worse, not learning what you planned to.

Tag: Functions for manipulating sql strings

5 SQL Functions for Manipulating Strings

-- -- -- -- SQL functions used for manipulating strings, commonly called string functions, are among most important SQL’s tools. In this post, we’ll look at five ways you can perform various operations on strings. There are many SQL functions that let you “edit” string data. As you learn SQL, you’ll see how useful they prove. Some sql trim off unneeded spaces or characters; others tell you how long a string is.

Tag: Generators

Useful SQL Patterns: Date Generator

As you start coding in SQL, you will use some statements and techniques over and over again. We call these “SQL patterns”. This series will look at the most common SQL patterns and consider how to use them. SQL patterns, such as the pivot pattern we discussed last week, can save you a lot of time and effort. Suppose you are asked to get a range of days in a financial quarter, but the only records you have are for the start and end dates of each quarter.

Tag: Get started

Join us on Facebook–We Can Learn More Together

We are so happy that you have joined us to learn and develop your SQL skills! We want to invite you to a new Facebook group, We Learn SQL. It is a great place for anyone interested in meeting like-minded people who also want to learn about database-related concepts. Learning together is easier, don't you think? Joining this group is a great opportunity to begin sharing your learning experiences with others.

YouTube Tutorials That Actually Teach You Some SQL

YouTube is not just funny cats, music clips, and viral videos. It can also be a mine of knowledge – if you know where to look. Can YouTube tutorials really help you learn SQL? Let's say you're a marketer or an accountant. You work with databases every day. But when it’s time to write a query and get specific data, you need to call someone from IT. Why not learn to do it yourself?

Career Change: From Accountant to Database Designer

How do career changes and life choices impact our future? Can we change the path that's been set for us? And if so, where do we begin? I wouldn't blame you if you thought this article is about change. In a sense, it is—it's in the title, after all. But for me, this article is more about what remains constant. If somebody were to ask me what hasn't changed for me since my childhood, I would know the answer immediately: curiosity.

Forget About Excel, High Five With SQL

Find out why you should forget about Excel and start using SQL even if you're not an IT expert. We'll show you how easy it is to learn SQL, how it can make you work better, and how LearnSQL.com makes the learning process fun. "I Don't Deal With Data" We frequently hear the sentence above from people outside the IT industry. Well, it's not entirely true. Data is now almost everywhere.

A Non-Technical Introduction to Learning SQL on Your Lunch Break

Do you think learning SQL will help you in your career? You are right. SQL is one of the easiest computer languages to learn. These days many non-IT employees have SQL skills and use them to extend their professional capacity. Moreover, more and more companies are encouraging their employees in non-IT areas (like sales, advertising, and finances) to learn and use SQL. One of the benefits of empowering employees with SQL skills is that once you answer one data question, the results will generate a new data question, and then perhaps a cascade of further data questions.

How to Install PostgreSQL on Windows 10 in 5 Minutes

It may look like a complicated task to install PostgreSQL, Oracle, or SQL Server or any other database software, but it really isn’t! These days, most relational database management systems come with installation wizards that make the process much simpler. In this article, we’ll look at how to install PostgreSQL and test that the installation is working. Install PostgreSQL: Steps Involved To install PostgreSQL, we’ll complete the following tasks:

How SQL supports data-driven organization

Typical business users make decisions based on gut feelings, but this can't get them so far. In this article, we'll look at how learning to write basic SQL queries helps your company become a data-driven organization. Businesses face many decisions. Do we increase our advertising budget in one region or the other? Are certain products selling quickly enough? What we should do if they aren't? Most of these decisions are driven by intuition, but organizations that make the most business impact use data-driven decision-making.

Microsoft SQL Server 2017 Installation Step by Step

-- -- Microsoft SQL Server is one of the most popular professional database servers on the market. In this guide, I’ll show you all SQL Server 2017 installation steps to help you install it on the Windows operating system together with SQL Management Studio. How to Install Microsoft SQL Server 2017 In this guide, I’ll show you the SQL Server 2017 installation step by step.

How to Begin Running SQL Queries

In this article, I’ll explain how to run a SQL query to help you execute your first one. Let’s jump right in! Running SQL queries for the first time is not a complex task, but it can seem intimidating at first if you’re a complete beginner. But once you get past that initial roadblock, you’ll be able to focus on learning SQL and writing more interesting queries to meet your business needs.

How to Use a SQL Wildcard

SQL wildcard allows us to filter data matching certain patterns in SQL. We use SQL wildcards with the LIKE operator in the WHERE clause of a query to filter data. In this beginner’s article, we’ll look at everything you need to know about basic SQL wildcards. If you like playing cards, then you know that wildcards can substitute any other card in your deck. Similarly, SQL wildcards can substitute one or more characters.

Our Picks for 2020’s 7 Best Online SQL Schools

If you’re looking for the best online SQL courses but aren’t sure where to start, you’re in the right place. I evaluated the top 7 ranked SQL schools available online to help you find the right solution. While summer is a great time to relax and get away from work, it’s also an excellent opportunity to learn new skills – like SQL! Thanks to SQL schools putting their courses on the internet, learning new tech skills is super easy and you can choose from a variety of formats to suit your needs.

Why Learn SQL Over the Summer

Think summer is reserved for flying to warm places and hanging out at the beach? Sure! But it's also a great time to learn new skills that you haven't had time for. -- If you recently graduated from high school and want to get a head start on computer programming for college, learning SQL over the summer is a great opportunity. You have nothing to lose and everything to gain—SQL is actually really easy to learn, especially with so much free time over the summer.

Here’s Why You Should Learn SQL

Why learn SQL? We asked our users about it. This is what we’ve learned. At LearnSQL.com, we help people with no computer science background to understand the core concepts of databases and data science. For example, we teach users how to extract the most important data from a database to build simple reports and how to understand key statistical metrics in data analysis. We love to provide easy-to-understand examples that thoroughly depict complex technical concepts.

How to Start Thinking in SQL

Thinking in SQL will help you understand what SQL queries do, how to create and change them, and how to create reports from the data you obtain. If you want to know how to write better SQL queries, you have to change the way you think about the code. One of the greatest skills you can have in SQL programming is the ability to change an existing SQL query so you get the results you need.

Introduction to Reporting with SQL — the Ultimate Tutorial for Business Professionals

Working with the financial aspects of large and small enterprises can be a daunting task for a business professional. In this article, we'll look at several ways of constructing the perfect SQL report. You've probably already heard about SQL from your colleagues or in other areas of your career. If you're here, you've likely concluded that learning SQL will make your professional life easier – and you're right!

5 Great Benefits of Learning SQL

If you want your business to succeed in 2017, it’s absolutely critical that you understand your data; this is why you should get acquainted with SQL ASAP. But there are other reasons to learn it that may not be obvious. In this article, I’ll show you 5 huge benefits of learning SQL! Don’t fall for the common trap—analyzing data isn’t just a concern for those competing at national or corporate levels.

Why Is SQL Worth Learning?

Nowadays, data is gathered from a variety of sources, and information is of great value to organizations. However, with an increasing amount of data comes the need for databases that can store information for retrieval and analysis by trained specialists. That’s where Structured Query Language comes in. Is SQL worth learning? In this article, I’ll explain why it definitely is. Relational databases, which logically group information into chunks, are basically used to store and organize large amounts of data.

SQL Mythbuster – 5 Reasons Why No One Should Be Afraid of SQL

Anyone can learn SQL. It’s not as hard as you think! In today’s world, even those in non-technical jobs need some technical skills. And you don’t have to be a hard-core nerd to get these skills. Let me tell you my own story. A few years ago, I wasn’t considering learning SQL or anything else that I labelled “technical”. My background is in sociology, journalism, and scriptwriting, and I thought computer languages were pretty sci-fi.

5 Books That Will Grow Your SQL Skills

Which books will help you build your database skills? We look at five awesome SQL books. There’s a common saying that “all wise men read books”. I would say that all professionals read books – particularly those related to their field. There are many books about databases and SQL; most are tied to specific vendors (DB2, Oracle, MS SQL) but there are also plenty that are vendor-neutral. In this article, I’m going to review a few books that I would recommend to SQL learners at various levels of proficiency.

The Complete Beginner’s Guide to SQL Fundamentals

LearnSQL.com is a great place to learn SQL. If you’re a complete beginner, it’s best to have an overview of what SQL is, what a database is, and how they work together. In this article, you’ll find a complete guide to SQL fundamentals. SQL Fundamentals: Database Let’s begin our guide to SQL with basic definitions. You might have already heard that SQL is used with databases. What exactly is a database?

How to Learn SQL: 6 Ideas for Newbies

Learning a new skill can be a daunting task, especially in programming. SQL is not immune to this. Luckily, with the Internet and the explosion of programming-related information out there, there are a lot of options you can use to undergo your SQL training! But we then come to a new roadblock. Where to begin? How will we know which option is best for our budget, skill level, and schedule?

Tag: Get started with sql

SQL Indexing 101

Indexes are one of the most misused and misunderstood entities in physical database design. A good understanding of indexes and how they solve database performance problems is necessary for any database novice. In this article, we'll look at basic database indexes and their role in database development. To picture what an index is, consider a textbook. At the end of most textbooks is an index listing all the terms one can find in the text and the pages on which they appear.

Tag: Group by

GROUP BY in SQL Explained

The SQL GROUP BY statement is easy to use, but it can be hard to master. Learn what you can do with GROUP BY, how it works, and how to use it with aggregate functions. GROUP BY is one of the basic SQL tools. However, it might be difficult for beginners to understand how GROUP BY works and how it is used to compute statistics with different aggregate functions. In this article, I’ll use several examples to show exactly how GROUP BY organizes rows and how aggregate functions can be used to calculate statistics on one or more columns.

How to Find Duplicate Values in SQL

Duplicate records waste time, space, and money. Learn how to find and fix duplicate values using SQL’s GROUP BY and HAVING clauses. Database best practices usually dictate having unique constraints (such as the primary key) on a table to prevent the duplication of rows when data is extracted and consolidated. However, you may find yourself working on a dataset with duplicate rows. This could be because of human error, an application bug, or uncleaned data that’s been extracted and merged from external sources, among other things.

How Does SQL GROUP BY Work?

Grouping results is a powerful SQL feature that allows you to compute key statistics for a group of records. GROUP BY is one of SQL’s most powerful clauses. It allows you to see data in a new way and find key metrics (like the average, maximal, and minimal values in a group of records). Without GROUP BY, all the results we obtain are oriented to records. With GROUP BY, we can create groups of records and calculate metrics on each group.

5 Examples of GROUP BY

When you start learning SQL, you quickly come across the GROUP BY clause. Data grouping—or data aggregation—is an important concept in the world of databases. In this article, we’ll demonstrate how you can use the GROUP BY clause in practice. We’ve gathered five GROUP BY examples, from easier to more complex ones so you can see data grouping in a real-life scenario. As a bonus, you’ll also learn a bit about aggregate functions and the HAVING clause.

What Is the Difference Between WHERE and HAVING Clauses in SQL?

As the amount of data in the world grows day by day, the need increases for managing and querying data efficiently. SQL offers ways to manipulate and query data at any scale. As an important part of this, the WHERE and HAVING clauses allow you to filter data as you need, but they are not the same. We will explain the differences between them in detail. One of the most common tasks in manipulating and querying data is filtering using the WHERE and HAVING clauses.

The SQL HAVING Clause Explained

What is the SQL HAVING clause? Why do you need it, and where do you use it? We’ll explain HAVING in detail. HAVING is a very common clause in SQL queries. Like WHERE, it helps filter data; however, HAVING works in a different way. If you are familiar with the GROUP BY clause and have only heard about HAVING – or if you’re not familiar with HAVING at all – this article is what you need.

Using GROUP BY in SQL

Now that you know SQL’s core commands, power up your queries with the GROUP BY clause and aggregate functions. GROUP BY is a SQL clause that arranges data into groups based on a common value (or values). It is widely used to obtain summary information for large datasets as well as for computing basic aggregate statistics. Once you have grasped SQL’s basic commands like SELECT, WHERE, and JOIN, mastering the GROUP BY clause can help you implement your SQL knowledge in real-world business intelligence scenarios.

What Is the Difference Between a GROUP BY and a PARTITION BY?

Window functions are a great addition to SQL, and they can make your life much easier if you know how to use them properly. Today, we will address the differences between a GROUP BY and a PARTITION BY. We’ll start with the very basics and slowly get you to a point where you can keep researching on your own. PARTITION BY vs. GROUP BY The PARTITION BY and the GROUP BY clauses are used frequently in SQL when you need to create a complex report.

Difference between GROUP BY and ORDER BY in Simple Words

For someone who is learning SQL, one of the most common places to get stuck is when learning the GROUP BY command. GROUP BY and ORDER BY are two important keywords in SQL that we use to organize data. The difference between GROUP BY and ORDER BY is that ORDER BY is more simple than GROUP BY and is usually introduced early in an SQL course. Sometimes, people are quite confused over these two concepts (SQL ORDER BY vs.

SQL Hacks To Control Family Budget On Black Friday Weekend

If you’re in the US, chances are you’ve been eagerly awaiting the approach of Black Friday just as much as Thanksgiving. Though the shopping frenzy takes hold of nearly everyone, some people have to stick to their budgets and shop prudently. In this article, we’ll take a look at how generating an SQL report can help you track how much your family spent shopping on Black Friday. Storing Black Friday Purchases in a Database Before we can create an SQL report, we first need some data we can use.

A Beginner’s Guide to SQL Aggregate Functions

Aggregate functions are powerful SQL tools that compute numerical calculations on data, allowing the query to return summarized information about a given column or result set. These functions can be used in conjunction with the GROUP BY statement. Let’s see how they work using some easy examples. SQL Aggregate Functions Suppose we have users residing in a city, and we store their information in two tables. These tables and their relationship are shown below:

Getting the Hang of the GROUP BY Clause

GROUP BY is an important part of the SQL SELECT statement. But new SQL coders can run into some problems when this clause is used incorrectly. Here’s how to avoid those issues. You’re learning SQL. You know how to SELECT some data FROM a table and how to filter the data with a WHERE clause. You can process the data using aggregate functions (MIN, MAX, SUM, AVG, and others). But when you’re dealing with a lot of data, you may need to narrow it down even more.

GROUP BY Clause: How Well Do You Know It?

The database can do different kinds of computations: it can add and subtract, multiply and divide, it can do computations on dates, it can count rows and sum row values, and so on. It can also do quite sophisticated statistics. The GROUP BY clause is the most basic way to compute statistics in SQL. It can be quite tough for beginners but it is really powerful. Let's look at the details of the GROUP BY clause, starting with the basics.

Tag: Guide

The Most Popular Databases in 2020

Which database solution is currently most popular? Which SQL dialect should you study? In this article, I’ll share the results of my research and my personal experience. Here are the databases that are worth learning SQL to use. First, let's answer some simple questions: Is SQL still useful? Is it worth learning? If you complete an online SQL course, will it make your work easier? The answer is YES! Why?

Top 10 Laptops for Learning SQL in 2020

If you want to learn SQL, you’re going to need a device that’s portable and powerful. I recommend a laptop. Here are the features you’ll need, as well as my picks for laptops to get you learning SQL in 2020! I must admit that browsing Amazon’s computer offers or entering any computer store can give you a headache. So many models, with so many options! They differ in components, workmanship, battery life, and screen size and resolution.

What Is a SQL Dialect, and Which one Should You Learn?

SQL, standard SQL, SQL Server, MySQL, PostgreSQL, Oracle, … You’d like to learn SQL, but you feel overwhelmed with keywords and you don’t know where to start. Let’s explain what each of those terms mean. SQL Is the Language for Talking to Databases A database is a computer program that can store and process large amounts of data. There are many different vendors of databases. PostgreSQL, MySQL, Oracle, and SQL Server are all database products by different vendors.

How to Publish a LearnSQL.com Course Certificate on LinkedIn

LinkedIn draws both job seekers and recruiters. Showcasing your knowledge, skills, and experience on this professional networking site can lead to great opportunities. We know this well at LearnSQL.com. Have you finished one of our courses? Great! Tell your future employer about what you have learned. Here's a step-by-step how-to guide for publishing a course certificate on LinkedIn. I will show you how easy it is to publish a LearnSQL.

Last-Minute Preparation Tips for a Database Class Exam

Getting to learn SQL is fun. You don’t really need to spend much time to understand some basic SQL concepts and use them fluently. If you’re a student facing your first database class exam soon, we’ve got you covered. In this article, we explain what you should focus on while learning SQL and studying for an entry-level database exam. Check your knowledge with our 10 sample questions and discover where you can find more SQL practice.

Top 5 Programming Languages to Learn Alongside SQL

If you already know or are about to learn SQL, you’re well on your way to being a sought-after database administrator, database engineer, or just a general database whizz kid! SQL is a modern, widely-used language that finds application in almost every industry. There is no shortage of jobs with SQL. But what if you want to branch out and learn another language to complement your SQL knowledge and skills?

Advanced SQL Courses for Data Analysts – A Complete Review

Even data analysts who already know SQL need to keep their skills sharp. Where can you find the best advanced SQL courses for data analysts? Check out our review of the top online sources! In this article, I present a list of online SQL courses for data analysts. These courses are offered by various platforms. Why wait? Let’s jump right in! 8 Advanced SQL Courses for Data Analysts Let's take a closer look at these courses to decide which platform will be better for you in learning SQL.

What SQL Practice Do You Need to Prepare for a Technical Job Interview?

You’ve scored yourself an interview for an SQL-related job. Nice work! But perhaps uncertainty is creeping in as your interview date looms closer. Do you know enough SQL to make the cut? What questions are you likely to be asked? What SQL practice should you be doing before your interview? Almost all SQL job candidates go through exactly the same nerve-wracking process. Here at LearnSQL.com, we have the lowdown on all the SQL practice and preparation you’ll need to ace those interview questions and take your career to the next level.

Is SQL Worth Learning?

We’re in the 21st century. These are the “ultimate data times” in which loads of information on all kinds of things is available. We want to explore this info even more, slice and dice it, understand where it comes from and what triggers it. With such large amounts of data coming in, people have discovered that spreadsheets aren’t enough. There’s a need for a greater solution, something like a spreadsheet on steroids.

Top 3 Platforms to Learn SQL Online: A Complete Comparison

Do you want to learn SQL online? Where do you start? There are many choices on the internet, and it can be hard to decide. But don’t worry—I tested and compared three major platforms to help you find the best place to learn SQL online! E-learning is on the rise. It gives us infinite possibilities of growing our professional careers without leaving our homes. And increasing our competencies is especially important now that the labor market has become dynamic and unstable.

Choose the Best Way to Learn SQL

SQL has become a hot topic in the professional world, and many resources have appeared both online and offline for learning SQL. It’s easy to get lost in the jungle of books, tutorials, and courses. Which resources do you choose? If you want to know how to learn SQL quickly and effectively, take a look at my list. There are many reasons for learning SQL. We asked our users about them and learned that there was no universal motive.

50 Best Resources for Learning SQL in 2020

Do you want to know where to learn SQL? We’ve got you covered with the ultimate list of 50 resources for learning SQL, including the best SQL courses, tutorials, books, and much, much more! Learning SQL can be hard enough without wading through thousands of websites and articles. So, we thought we’d do you a solid and put the top SQL resources here in this handy slice of the internet.

How to Stay Healthy When Learning SQL

So, maybe you’re learning SQL. Congratulations! Or maybe you already work as a data analyst, DBA, or data scientist. That’s great too! Either way, you are most likely spending hours in front of a computer. I will give you tips on how to avoid bad habits and take care of your health while learning and/or working with SQL. Have you ever wondered how sitting in front of a computer affects your health?

What Programming Language Should You Learn?

If you've ever been wondering which programming language you should learn first, you know that's a tough nut to crack. It’s especially difficult if you are new to IT and programming. In this article, I give suggestions for what to learn first and what perspectives each language can give you in IT. There are hundreds of programming languages, and new ones are showing up all the time. Getting to know all of them is simply impractical and impossible.

How to Study Online: 5 Steps to Becoming an Effective Learner

If you suffer from procrastination or lack of motivation, you’re not alone. We have some online learning tips to make your learning journey smoother and more enjoyable. One of the best things about being an adult is that we can do what we want: go to sleep late at night, party until morning, eat junk food. Besides all those small pleasures, as adults we are responsible for ourselves, our choices, and our mistakes.

How to Install PostgreSQL on Windows 10 in 5 Minutes

It may look like a complicated task to install PostgreSQL, Oracle, or SQL Server or any other database software, but it really isn’t! These days, most relational database management systems come with installation wizards that make the process much simpler. In this article, we’ll look at how to install PostgreSQL and test that the installation is working. Install PostgreSQL: Steps Involved To install PostgreSQL, we’ll complete the following tasks:

Tag: Having

HAVING vs. WHERE in SQL: What You Should Know

This article is about SQL’s WHERE and HAVING clauses. Both clauses are part of the foundations of the SQL SELECT command. They have similar uses, but there are also important differences that every person who uses SQL should know. Let’s see what’s behind the HAVING vs. WHERE debate. In this article, we’ll suppose we work for a government social agency supporting people or families whose income is below a certain threshold.

Tag: Health

How to Stay Healthy When Learning SQL

So, maybe you’re learning SQL. Congratulations! Or maybe you already work as a data analyst, DBA, or data scientist. That’s great too! Either way, you are most likely spending hours in front of a computer. I will give you tips on how to avoid bad habits and take care of your health while learning and/or working with SQL. Have you ever wondered how sitting in front of a computer affects your health?

Tag: How to

Practical Ways to Improve the Performance of SQL Queries

Knowing how to improve SQL query performance is an important skill, especially when working with with large databases. In this article, you'll learn how to write more efficient SQL queries to get results faster. The biggest difference between SQL and other languages is that SQL is a non-procedural language. In a non-procedural language you specify the results that you need but not the methods used to get it. The advantage of a non-procedural language is that it is easier to write programs, therefore it is common for non-programmer business users to generate reports from SQL queries.

SQL Filtering 101

Sometimes, SQL queries return lots of data you don't need. In this article, we'll look at a simple example of filtering SQL queries to reduce the complexity of your data. -- The key to learning how to filter data in SQL is understanding the very basics of Boolean algebra. That's just a fancy term mathematicians use to describe expressions involving logical values (true/false) and their associated operators (and, or, not, etc.

Improving Query Readability with Common Table Expressions

What is a Common Table Expression, or CTE? Where do you use them, and why? This post answers your questions. Simply put, Common Table Expressions (also known as WITH clauses) are essentially named subqueries. They also provide additional features like recursion. If you're new to subqueries, I recommend you read the SQL Subqueries article before continuing. The main purpose of Common Table Expressions is to improve the design and readability of an SQL statement.

SQL Development? Structured Query Language and Apps

You know about using SQL with databases. How does SQL fit in with app development? Is there anything like SQL development? In this post, we look at the app development process, how it intersects with modeling a database, and what developers can do with SQL outside of their app. Obviously, the beginning of this process is defining your app — what it does, who it is for, how it will function and look, etc.

Performing Calculations on Date- and Time-Related Values

Relational databases support several date and time data types. In this article, we'll look at several arithmetic operations we can do on these types. These operations are logical and understandable, even for the beginning SQL coder. Let's first briefly explain the main data types used for dates and times. Keep in mind that data types may differ by database engine, so check your database documentation for specifics before you start working with them.

Getting the Hang of the GROUP BY Clause

GROUP BY is an important part of the SQL SELECT statement. But new SQL coders can run into some problems when this clause is used incorrectly. Here’s how to avoid those issues. You’re learning SQL. You know how to SELECT some data FROM a table and how to filter the data with a WHERE clause. You can process the data using aggregate functions (MIN, MAX, SUM, AVG, and others). But when you’re dealing with a lot of data, you may need to narrow it down even more.

Refine Results with SQL Set Operators

Using UNION, UNION ALL, EXCEPT, and INTERSECT to manage SQL query results. The function of SQL set operators is pretty simple; they allow us to combine results from different SQL queries into one result set. The best way to understand how set operators work is to use visual methods like the Venn diagram. For those of you not familiar with Venn diagrams, they are two circles that represent items or collections of items.

6 Common SQL Syntax Mistakes All Learners Make

We all make mistakes when learning a new language – especially at the beginning. New words, complicated grammar... Everyone needs time to master a language. But when we get immediate feedback, we can progress more quickly. The same goes for learning SQL. In this article, we'll look at 6 common SQL syntax mistakes most SQL learners make. Mastering SQL Queries Interactive SQL courses are one way to get immediate feedback on your queries.

8 Tips Absolute Beginners Can Use to Fix SQL Queries

Code errors are common – and frustrating. And when you're just learning SQL, it can be very challenging to find and fix your mistakes. In this post, we'll show you eight ways to solve or eliminate common SQL coding errors. Today, we'll talk about some tips the SQL beginner can use to avoid several common errors. These tips work in any database environment. As we go along, we'll be showing some error messages.

Five Common SQL Syntax Errors

As you learn SQL, watch out for these common coding mistakes You’ve written some SQL code and you’re ready to query your database. You input the code and …. no data is returned. Instead, you get an error message. Don’t despair! Coding mistakes are common in any programming language, and SQL is no exception. In this post, we’ll discuss five common SQL syntax errors people make when writing code.

SQL Errors: Five Common SQL Mistakes

As you learn SQL, watch out for these common coding mistakes You’ve written some SQL code and you’re ready to query your database. You input the code and …. no data is returned. Instead, you get an error message. Don’t despair! Coding errors are common in any programming language, and SQL is no exception. In this post, we’ll discuss five common mistakes people make when writing SQL. Watch Your Language (and Syntax) The most common SQL error is a syntax error.

Tag: How to in sql

Practical Ways to Improve the Performance of SQL Queries

Knowing how to improve SQL query performance is an important skill, especially when working with with large databases. In this article, you'll learn how to write more efficient SQL queries to get results faster. The biggest difference between SQL and other languages is that SQL is a non-procedural language. In a non-procedural language you specify the results that you need but not the methods used to get it. The advantage of a non-procedural language is that it is easier to write programs, therefore it is common for non-programmer business users to generate reports from SQL queries.

How to Begin Running SQL Queries

In this article, I’ll explain how to run a SQL query to help you execute your first one. Let’s jump right in! Running SQL queries for the first time is not a complex task, but it can seem intimidating at first if you’re a complete beginner. But once you get past that initial roadblock, you’ll be able to focus on learning SQL and writing more interesting queries to meet your business needs.

SQL Indexing 101

Indexes are one of the most misused and misunderstood entities in physical database design. A good understanding of indexes and how they solve database performance problems is necessary for any database novice. In this article, we'll look at basic database indexes and their role in database development. To picture what an index is, consider a textbook. At the end of most textbooks is an index listing all the terms one can find in the text and the pages on which they appear.

How to Use a SQL Wildcard

SQL wildcard allows us to filter data matching certain patterns in SQL. We use SQL wildcards with the LIKE operator in the WHERE clause of a query to filter data. In this beginner’s article, we’ll look at everything you need to know about basic SQL wildcards. If you like playing cards, then you know that wildcards can substitute any other card in your deck. Similarly, SQL wildcards can substitute one or more characters.

SQL Filtering 101

Sometimes, SQL queries return lots of data you don't need. In this article, we'll look at a simple example of filtering SQL queries to reduce the complexity of your data. -- The key to learning how to filter data in SQL is understanding the very basics of Boolean algebra. That's just a fancy term mathematicians use to describe expressions involving logical values (true/false) and their associated operators (and, or, not, etc.

Why Learn SQL Over the Summer

Think summer is reserved for flying to warm places and hanging out at the beach? Sure! But it's also a great time to learn new skills that you haven't had time for. -- If you recently graduated from high school and want to get a head start on computer programming for college, learning SQL over the summer is a great opportunity. You have nothing to lose and everything to gain—SQL is actually really easy to learn, especially with so much free time over the summer.

Key Insights for Mastering SQL Queries Using Tinder Data Example

Going from zero to one can be daunting in any endeavor. The same is true for learning new programming languages, even simple ones like SQL. In this article, we’ll take a look at some key insights that will help you understand the nuances of mastering SQL queries. If you’ve never used SQL, you’re in the right place. When learning anything new, you’ll find that there are always some key insights or tips that can help you on your way.

Improving Slow Query Performance: When Runtime Matters

As SQL users, we usually focus on writing queries that return correct results. However, there are more things to consider when you're writing a query; one of them is query performance. In this article, we'll look at some examples where query response time is critical. Scene One: 911 Call Center Let's suppose we're at a 911 call center, when the phone rings. One of the operators answers the call; a witness reports that a man has been shot.

Converting Subqueries to Joins

Not all queries are alike, especially in terms of performance. In this article, we'll look at how you can convert SQL subqueries to joins for improved efficiency. When should I use SQL subqueries? Great question! Unfortunately, there's no concrete answer. SQL beginners tend to overuse subqueries. Typically, once they find that SQL construction works in one situation, they try to apply that same approach to other situations. It's only natural.

Essential SQL Terms to Know for Beginners and Pros

Working with databases can seem daunting to a non-technical person. Right away, you’re bombarded with new terms that make your head spin. Database, database instance, table, SQL and others are some of the basic terms that you need to understand just to have a normal conversation with your technical colleagues. In this article, we’ll explore some basic SQL database terminology you need to know to succeed. Imagine you’re attending a meeting with the development staff and suddenly feel as if you’re listening to white noise.

Learn to Write a SQL Correlated Subquery in 5 Minutes

If you’re familiar with the famous Russian nesting doll, then SQL correlated subqueries should be a peace of cake to understand—subqueries are just queries nested within queries. An SQL subquery is often called an “inner” query; the main query is usually called the “outer” query. This article covers everything you need to know about correlated subqueries. What Exactly is a SQL Correlated Subquery? A correlated SQL subquery is just a subquery that is executed many times—once for each record (row) returned by the outer (main) query.

New LearnSQL.com Online Practice – Solve Basic SQL Questions with the SQL Practice Set

If you’re looking to retrieve any kind of information from a database, you need to speak its language. But querying databases is an art—and it demands practice. That’s why we created our SQL practice set: a pack of SQL online practice exercises meant to help you master your skills. We spend a lot of time not only developing new courses but also speaking with our users and learning what they expect from SQL online practice exercises.

How to Become a Database Analyst

Curious about becoming a database analyst? Maybe you've taken some database courses at university and they really struck a chord. Or maybe you learned online. Now you're thinking about making a career out of working with databases. Where would you start? What should you expect at each phase of your professional development? In this post, we'll explore the challenging and exciting world of databases analysis. We'll go from the very beginning of a career to the apex of professional success.

Extracting Data From a String: SPLIT_PART in PostgreSQL

Learn how to use split_part in PostgreSQL to extract data from strings. Quite often, we’d like to extract parts of a string when working with text values. A common example is when we have a full name and need to retrieve only the last name. In this article, we’ll examine how to do it using split_part in PostgreSQL, i.e. a string-related function that can be used to extract a substring.

How to Remove Junk Characters in SQL

Unwanted characters in text data can be a bit of a pain, but there’s an easy way to fix them. Scroll down to learn how to remove junk characters in SQL in the easiest way! Sometimes, we’ll find unwanted characters inside our string data because our SQL queries didn’t work as expected. Moreover, these extra characters may sometimes be invisible, which really complicates things. In this article, we’ll examine some string-related SQL functions that can handle unwanted characters—visible or not!

How to Solve Capitalization Data Quality Issues

Misspelled names, typos, and text data quality issues in your database? Power up your queries! Use SQL string functions to address data quality issues related to capitalization. Sometimes, our SQL queries don't work as expected because of data quality issues. In this article, we will examine some string-related SQL functions that can correct data quality issues related to capitalization. We'll be using PostgreSQL in our examples, but similar functions are available in most database engines.

18 Useful Important SQL Functions to Learn ASAP

Beginning with SQL: Useful Functions to Master Learning a new programming language can seem intimidating. Like any other language, a programming language has a large vocabulary that you need to master. In this article, we'll look at some of the most useful SQL functions that you need to know. There are many useful SQL functions for working with different data types. Once you practice with some of the most common ones, you'll gain enough confidence to move on to more advanced material.

Simplify SQL Code: Recursive Queries in DBMS

Hey SQL users! Are you repeating the same query in every report? Are your queries getting too complicated? Use recursive queries to simplify SQL code! Too many SQL reports can lead to clutter on your desktop and in your head. And is it really necessary to code each of them separately? Ad-hoc queries can share much of the same SQL code with managerial reports and even regulatory reports. Suppose you’ve been writing basic SQL code for a while.

Digging Into Data: Explore and Analyze Survey Results With SQL

Excel is a powerful beast that lets you analyze complex data. Yet, operating on big chunks of data can sometimes be a daunting task. Let's take a look at how SQL can help. Today, we'll tackle a common problem with importing data to an SQL database, using a real-life example. Suppose your company conducted a survey on the most popular programming trends and preferences, striving to meet the expectations of its users.

SQL Hacks To Control Family Budget On Black Friday Weekend

If you’re in the US, chances are you’ve been eagerly awaiting the approach of Black Friday just as much as Thanksgiving. Though the shopping frenzy takes hold of nearly everyone, some people have to stick to their budgets and shop prudently. In this article, we’ll take a look at how generating an SQL report can help you track how much your family spent shopping on Black Friday. Storing Black Friday Purchases in a Database Before we can create an SQL report, we first need some data we can use.

SQL Window Functions By Explanation

In our previous post, we explained how SQL window functions work by example. We started with some very simple, basic functions. Let's extend it by explaining subclauses in window functions. -- SQL window functions are a great way to compute results from a set of rows rather than a single row. As you know from our first article, the "window" in window function refers to the set of rows.

The 5 Highest Paying Jobs That Use SQL

IT provides a wide and growing job market, offering many excellent opportunities in both career development and earning potential. Today we’ll take a look at several very interesting types of database jobs that use SQL. Every year, many in the work force set their sights and aim for new and better jobs. When it comes to jobs, “better” means different things to different people, but earning potential is almost always a top priority.

Four Reasons You Must Learn SQL in Data Science

Is SQL important for data science? It certainly is! This language can help you build a foundation for your analytical career. Let’s see how you use SQL in data science. Data science is hot right now. What if you could predict the next market crash? Or contain the spread of Ebola? Or accurately predict a health crisis months or even years before it happens? Data scientists are working hard on these kinds of projects, and they are earning healthy salaries in the process.

SQL Mythbuster – 5 Reasons Why No One Should Be Afraid of SQL

Anyone can learn SQL. It’s not as hard as you think! In today’s world, even those in non-technical jobs need some technical skills. And you don’t have to be a hard-core nerd to get these skills. Let me tell you my own story. A few years ago, I wasn’t considering learning SQL or anything else that I labelled “technical”. My background is in sociology, journalism, and scriptwriting, and I thought computer languages were pretty sci-fi.

Introducing SQL Set Operators: Union, Union All, Minus, and Intersect

-- -- -- -- -- Ever heard terms such as union and intersection in SQL? They’re examples of set operators, and they come in handy when you need to combine information from multiple tables or queries. In this article, we’ll take a closer look at them. SQL queries let us choose the most important bits from large amounts of information.

Improving Query Readability with Common Table Expressions

What is a Common Table Expression, or CTE? Where do you use them, and why? This post answers your questions. Simply put, Common Table Expressions (also known as WITH clauses) are essentially named subqueries. They also provide additional features like recursion. If you're new to subqueries, I recommend you read the SQL Subqueries article before continuing. The main purpose of Common Table Expressions is to improve the design and readability of an SQL statement.

Complete SQL Practice for Interviews

Congratulations! Your SQL skills were strong enough to get you that job interview! Now, if you only knew what SQL que[stions and practical exercises a recruiter might ask you to do… This article is meant as a SQL practice for interviews. I’ll help you prepare for the SQL and database aspects of your job interview. In a previous article, I explained how can you boost your career by learning SQL.

SQL Development? Structured Query Language and Apps

You know about using SQL with databases. How does SQL fit in with app development? Is there anything like SQL development? In this post, we look at the app development process, how it intersects with modeling a database, and what developers can do with SQL outside of their app. Obviously, the beginning of this process is defining your app — what it does, who it is for, how it will function and look, etc.

The Complete Beginner’s Guide to SQL Fundamentals

LearnSQL.com is a great place to learn SQL. If you’re a complete beginner, it’s best to have an overview of what SQL is, what a database is, and how they work together. In this article, you’ll find a complete guide to SQL fundamentals. SQL Fundamentals: Database Let’s begin our guide to SQL with basic definitions. You might have already heard that SQL is used with databases. What exactly is a database?

Performing Calculations on Date- and Time-Related Values

Relational databases support several date and time data types. In this article, we'll look at several arithmetic operations we can do on these types. These operations are logical and understandable, even for the beginning SQL coder. Let's first briefly explain the main data types used for dates and times. Keep in mind that data types may differ by database engine, so check your database documentation for specifics before you start working with them.

Getting the Hang of the GROUP BY Clause

GROUP BY is an important part of the SQL SELECT statement. But new SQL coders can run into some problems when this clause is used incorrectly. Here’s how to avoid those issues. You’re learning SQL. You know how to SELECT some data FROM a table and how to filter the data with a WHERE clause. You can process the data using aggregate functions (MIN, MAX, SUM, AVG, and others). But when you’re dealing with a lot of data, you may need to narrow it down even more.

Refine Results with SQL Set Operators

Using UNION, UNION ALL, EXCEPT, and INTERSECT to manage SQL query results. The function of SQL set operators is pretty simple; they allow us to combine results from different SQL queries into one result set. The best way to understand how set operators work is to use visual methods like the Venn diagram. For those of you not familiar with Venn diagrams, they are two circles that represent items or collections of items.

6 Common SQL Syntax Mistakes All Learners Make

We all make mistakes when learning a new language – especially at the beginning. New words, complicated grammar... Everyone needs time to master a language. But when we get immediate feedback, we can progress more quickly. The same goes for learning SQL. In this article, we'll look at 6 common SQL syntax mistakes most SQL learners make. Mastering SQL Queries Interactive SQL courses are one way to get immediate feedback on your queries.

8 Tips Absolute Beginners Can Use to Fix SQL Queries

Code errors are common – and frustrating. And when you're just learning SQL, it can be very challenging to find and fix your mistakes. In this post, we'll show you eight ways to solve or eliminate common SQL coding errors. Today, we'll talk about some tips the SQL beginner can use to avoid several common errors. These tips work in any database environment. As we go along, we'll be showing some error messages.

How to Learn SQL: 6 Ideas for Newbies

Learning a new skill can be a daunting task, especially in programming. SQL is not immune to this. Luckily, with the Internet and the explosion of programming-related information out there, there are a lot of options you can use to undergo your SQL training! But we then come to a new roadblock. Where to begin? How will we know which option is best for our budget, skill level, and schedule?

Five Common SQL Syntax Errors

As you learn SQL, watch out for these common coding mistakes You’ve written some SQL code and you’re ready to query your database. You input the code and …. no data is returned. Instead, you get an error message. Don’t despair! Coding mistakes are common in any programming language, and SQL is no exception. In this post, we’ll discuss five common SQL syntax errors people make when writing code.

SQL Errors: Five Common SQL Mistakes

As you learn SQL, watch out for these common coding mistakes You’ve written some SQL code and you’re ready to query your database. You input the code and …. no data is returned. Instead, you get an error message. Don’t despair! Coding errors are common in any programming language, and SQL is no exception. In this post, we’ll discuss five common mistakes people make when writing SQL. Watch Your Language (and Syntax) The most common SQL error is a syntax error.

Tag: Insert

Learn SQL Views in 30 Minutes

Views aren't complicated – if you've got half an hour, we'll get you started writing SQL queries using views! Let's start by answering the question "What is a view in SQL?'. A view is a database object (as is a table, an index, or a stored procedure). Like a table, you can query a view and extract the information in it. It can be used in the FROM clause of a SELECT, and you can reference view columns in clauses like SELECT, WHERE and GROUP BY among other clauses as well.

Using CASE with Data Modifying Statements

What happens when you combine CASE with SQL's data modifying statements? Find out in this article. The CASE expression is a very useful part of SQL and one that you'll employ frequently. We've already covered what the CASE expression does, how to format it, and how to use it in a SELECT statement in "Using CASE to Add Logic to a SELECT". Another article, "How to Sort Records with the ORDER BY Clause"

Tag: Installation guide

Microsoft SQL Server 2017 Installation Step by Step

-- -- Microsoft SQL Server is one of the most popular professional database servers on the market. In this guide, I’ll show you all SQL Server 2017 installation steps to help you install it on the Windows operating system together with SQL Management Studio. How to Install Microsoft SQL Server 2017 In this guide, I’ll show you the SQL Server 2017 installation step by step.

How to Begin Running SQL Queries

In this article, I’ll explain how to run a SQL query to help you execute your first one. Let’s jump right in! Running SQL queries for the first time is not a complex task, but it can seem intimidating at first if you’re a complete beginner. But once you get past that initial roadblock, you’ll be able to focus on learning SQL and writing more interesting queries to meet your business needs.

Tag: Jobs and career

How Much Do Data Engineers Earn in 2020?

Data engineering is a hot job right now. What does a data engineer do? And just how much do they earn? We’ve done the research for you. If you are reading this, you’re either starting to learn SQL or you already know some and feel it’s time to look around for a SQL job. Maybe you’re in the midst of tackling our Creating Database Structure track. And, let’s be honest, maybe you need some extra motivation to keep on you track.

Why and How to Find Freelance SQL Jobs

If Covid-19 has you all “I-want-to-stop-working-for-the-man-and-enjoy-a-more-fulfilling-life-as-the-master-of-my-own-destiny”, then I’ve got news for you. Not only is it possible to be an SQL freelancer, it’s also a potentially lucrative and liberating career move. It will allow you to work for a diverse range of clients and march to the beat of your own drum. Of course, SQL freelancing isn’t for everyone. You will need a strong sense of self-motivation, some serious hustling skills, and the ability to sell yourself and your services as THE ABSOLUTE BEST all the time, every time - day in, day out.

How to Convince Your Boss That You Need to Start Learning SQL

Learning SQL is a great goal. Now, if you could only convince your boss that it’s good for the company as well as for you ... You’re aware of the benefits of adding SQL to your skill set. You believe that the rewards gained from you learning SQL will also benefit your employer – it’s not just another way for you to develop your professional profile. But how do you articulate this to your boss?

Which Major Companies Use PostgreSQL? What Do They Use It for?

Which companies use the open-source relational database management system PostgreSQL? Find out … and learn why you should be a PostgreSQL user too. You know the blue elephant logo. You have heard that PostgreSQL is a very good solution. But which companies use it? Here is a list of the largest IT and business companies that use PostgreSQL (or Postgres, for short). Multinationals worth billions of dollars can't be wrong, right?

Advanced SQL Interview Questions (and Answers)

Do you want to move to a job that uses SQL? Are you unsure about what to expect during the job interview or how to benchmark your knowledge? This article will give you a good idea of where you stand. If you feel stuck in your job, you’re not the only one. The modern division of work pushes people to perform very specific tasks, expecting them not to look at what's on the other side.

What SQL Practice Do You Need to Prepare for a Technical Job Interview?

You’ve scored yourself an interview for an SQL-related job. Nice work! But perhaps uncertainty is creeping in as your interview date looms closer. Do you know enough SQL to make the cut? What questions are you likely to be asked? What SQL practice should you be doing before your interview? Almost all SQL job candidates go through exactly the same nerve-wracking process. Here at LearnSQL.com, we have the lowdown on all the SQL practice and preparation you’ll need to ace those interview questions and take your career to the next level.

Are There Any Good SQL Courses for Marketers?

Looking for places to learn SQL online and level up your marketing efforts? Check out these SQL courses. Introduction With the help of IT experts, meticulous marketers analyze information to create advertising strategies. This commonplace state of affairs forces the marketer to rely on data experts and sometimes wait for their availability. But what if marketers could pull the data themselves? They can – by turning into a technical marketer.

Types of Database Jobs: Choose One of Them and Start Being Awesome

Do you dream of high earnings and interesting work? Are you fed up with your boss and his or her annoying vacation stories in exotic countries? Is it time to change your job? Why not learn SQL? Here are some examples of the types of database jobs that may lead you to a better life. What types of database jobs use SQL? Here are some examples, but first, a small caveat.

How Will Learning SQL Improve My Daily Work?

Whether you want to boost your professional development, learn in-demand skills, or start something new and interesting, learning SQL will make your life easier in many ways. Are you thinking of learning SQL but aren’t sure if it's a good idea? At first glance, learning SQL may seem completely useless, especially if the industry you are in is not related to IT. But that's not true. Although your position in the company may not imply that you code every day, you can still gain a lot from SQL.

Should I Learn SQL as a Data Analyst?

So, you are a data analyst—someone who relies on data. You like to gather, clean, and transform data and come to conclusions based on data. You are a data detective. Which tool do you choose to do your job in an elegant, reproducible, and simple way? Excel? R? Python? Or should you learn SQL? Stay tuned! In this article, I will explain why SQL is a must-have skill for data analysts.

Top 10 Websites That Will Help You Find the Perfect SQL Job

People learn SQL for many reasons. In my case, I wanted to find a better job that would allow me to earn more and have more free time to pursue my interests. But where do you find such a job? Here is my list of the 10 best websites with database jobs. Although SQL is almost 40 years old, it is appearing in more and more job advertisements. Data has become an essential tool for entrepreneurs, and they are looking for people to squeeze every bit of information from their databases.

Common Entry Level SQL Developer Interview Questions

Have you ever been interviewed for an entry-level SQL position? Are you planning to apply for such a job? This article will help you to know what to expect and prepare for common SQL developer interview questions. After gaining some basic knowledge of SQL and programming, you're probably wondering what to do next. Or maybe you're not wondering! You know that what you've learned will soon disappear if you don't use it regularly.

How to Become an SQL Developer

There is no simple answer to the question “How do you become an SQL developer?” However, if the answer were too complex, there would be no point in writing this article, and yet I’m doing it. So, somewhere along the way, we’ll find the answer. As said in the intro, there is no magic wand that will turn you into an SQL developer. But reading this article will save you some time and help you focus on what is important to achieve your goal.

Why Use SQL Over Excel

SQL is replacing Excel in many fields, and data analysis is certainly one of them. If you are still using Excel as a data analyst, you are missing something very valuable. SQL can make your life easier, as it's more efficient and faster than Excel. So, how and from where can you learn SQL? How Can SQL Help Data Analyst? You can use SQL to help you with the following work:

Career Change: From Accountant to Database Designer

How do career changes and life choices impact our future? Can we change the path that's been set for us? And if so, where do we begin? I wouldn't blame you if you thought this article is about change. In a sense, it is—it's in the title, after all. But for me, this article is more about what remains constant. If somebody were to ask me what hasn't changed for me since my childhood, I would know the answer immediately: curiosity.

Complete SQL Practice for Interviews

Congratulations! Your SQL skills were strong enough to get you that job interview! Now, if you only knew what SQL que[stions and practical exercises a recruiter might ask you to do… This article is meant as a SQL practice for interviews. I’ll help you prepare for the SQL and database aspects of your job interview. In a previous article, I explained how can you boost your career by learning SQL.

Finding the Perfect SQL Job

So you have some SQL skills and you're looking for a job that will use them. What are your options? SQL is everywhere, and there's a huge demand for people with database management skills. This is especially the case when companies start implementing Big Data solutions and strategies. There's no arguing that SQL is a must-have skill. If you're already proficient, how can you put your expertise to practical use in the job market?

A Day in the Life of a SQL Developer

What is a SQL developer? And what does a SQL developer do? Describing a “typical” day for a SQL developer is not easy. When your daily work is using various technologies to create interesting database-oriented products, very few days are alike! Each day brings a new and intriguing challenge. Nevertheless, I’ll have a go at explaining what everyday things a SQL developer might do. -- Morning: Arrive at Work What does a SQL developer do after arriving at the office?

Tag: Join

How to Join Two Tables in SQL

Querying data from multiple tables is very common when working with relational databases. It is not difficult if you know how to use the dedicated SQL operators for doing this. In this article, you will learn how to join two tables by using WHERE and by using a special operator JOIN, and you will see how to filter rows in the result set. How to Query a Single Table First, a quick refresher on how to select data from a single table.

How to Practice SQL JOINs

There is no better way to learn SQL joins than through practice. However, there will probably be obstacles along the way. I’ll cover some of these obstacles and give ideas for how to overcome them. While this article won’t turn you into SQL JOINs expert, it will show you how to become one. So, let’s start! Challenges When Practicing SQL JOINs It’s hard to answer “How do you master SQL JOINs?

Converting Subqueries to Joins

Not all queries are alike, especially in terms of performance. In this article, we'll look at how you can convert SQL subqueries to joins for improved efficiency. When should I use SQL subqueries? Great question! Unfortunately, there's no concrete answer. SQL beginners tend to overuse subqueries. Typically, once they find that SQL construction works in one situation, they try to apply that same approach to other situations. It's only natural.

SQL Hacks To Control Family Budget On Black Friday Weekend

If you’re in the US, chances are you’ve been eagerly awaiting the approach of Black Friday just as much as Thanksgiving. Though the shopping frenzy takes hold of nearly everyone, some people have to stick to their budgets and shop prudently. In this article, we’ll take a look at how generating an SQL report can help you track how much your family spent shopping on Black Friday. Storing Black Friday Purchases in a Database Before we can create an SQL report, we first need some data we can use.

An Illustrated Guide to Multiple Join

So far, our articles in the "An Illustrated Guide" series have explained several join types: INNER JOINs, OUTER JOINs (LEFT JOIN, RIGHT JOIN, FULL JOIN), CROSS JOIN, self-join and non-equi join. In this final article of the series, we show you how to create SQL queries that match data from multiple tables using one or more join types. -- Join Types in SQL Queries Before we start discussing example SQL queries that use multiple join types, let's do a short recap of the join types we've covered so far, just to be sure you understand the differences.

An Illustrated Guide to the SQL Non Equi Join

Did you know that in SQL, a join doesn’t have to be based on identical matches? In this post, we look at the SQL non equi join, which uses ‘non-equal’ operators to match records. -- We’ve already discussed several types of joins, including self joins and CROSS JOIN, INNER JOIN and OUTER JOIN. These types of joins typically appear with the equals sign (=). However, some joins use conditions other than the equals (=) sign.

An Illustrated Guide to the SQL Self Join

What is an SQL self join and how does it work? When should it be used? We’ll provide answers to those questions! -- In SQL, we can combine data from multiple tables by using a JOIN operator. JOIN has several variants; we’ve already discussed CROSS JOIN, INNER JOIN, and OUTER JOIN. Most of the time, these operators join data from two or more different tables. You can practice all the different types of JOINs in our interactive SQL JOINs course.

How to Track Down Duplicate Values in a Table

When it comes to information management, duplicates present one of the most common challenges to data quality. In this article, I'll explain how it is possible to find and distinguish duplicate names with the help of the SQL data programming language. I really like my maiden name. The reason I like it so much is because it's rare. My maiden name (first with last) provided a unique identifier on platforms such as LinkedIn, Facebook, Twitter and similar.

An Illustrated Guide to the SQL OUTER JOIN

We’ve already discussed the SQL CROSS JOIN and INNER JOIN statements. It’s time to explore another: OUTER JOIN. What is it? How does it work? Let’s find out! -- If you’ve read our other posts, you know that you can link the data in two or more database tables using one of the many types of SQL join operator. Today, we’ll discuss the three kinds of OUTER JOIN: LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN.

An Illustrated Guide to the SQL INNER JOIN

What is an SQL INNER JOIN, and how does it work? Let's find out! In my last article, I discussed the CROSS JOIN operation in SQL. Today, we'll look at INNER JOIN and how to use it. Is it the same as a JOIN? How many tables can you link with an INNER JOIN? These are all good questions. Let's look at the answers! What is an INNER JOIN? INNER JOIN combines data from multiple tables by joining them based on a matching record.

An Illustrated Guide to the SQL CROSS JOIN

What is an SQL CROSS JOIN statement? When should you use it? When shouldn't you use it? This post will tell you what you need to know about CROSS JOIN. -- You already know that you can use the SQL JOIN statement to join one or more tables that share a matching record. And if you're read the LearnSQL's post Learning SQL JOINs Using Real Life Situations, you know that there are many types of JOINs.

An Introduction to Using SQL Aggregate Functions with JOINs

-- Previously, we've discussed the use of SQL aggregate functions with the GROUP BY statement. Regular readers of the our blog will also remember our recent tutorial about JOINs. If you're a bit rusty on either subject, I encourage you to review them before continuing this article. That's because we will dig further into aggregate functions by pairing them with JOINs. This duo unleashes the full possibilities of SQL aggregate functions and allows us to perform computations on multiple tables in a single query.

Learning JOINs With Real World SQL Examples

-- The JOIN statement lets you work with data stored in multiple tables. In this article, I’ll walk you through the topic of JOIN clauses using real world SQL examples. -- Imagine if you could only work with one database table at a time. Fortunately, this isn’t anything we have to worry about. Once you learn the JOIN statement, you can start linking data together.

SQL JOINs

A SQL JOIN is a method to retrieve data from two or more database tables. This article presents a basic overview of what data from a particular SQL join will look like. A popular way of understanding SQL joins is to visualize them using Venn diagrams, so each example have corresponding Venn diagram, appropriate SELECT statement and the result table. There are a few major kinds of SQL joins:

SQL JOINs for Beginners

You’re probably already familiar with simple SQL queries, such as SELECT * FROM table. Now you are wondering what to do when you have multiple tables, and you want to join them. Exactly! JOIN is the key. In this SQL JOINs tutorial for beginners, you will learn how to connect data from multiple tables. What are SQL JOINs? Databases usually have more than one table. JOINs are an SQL construction used to join data from two or more tables.

Tag: Joins

Can you Join two Tables Without a Common Column?

Yes, you can! The longer answer is yes, there are a few ways to combine two tables without a common column, including CROSS JOIN (Cartesian product) and UNION. The latter is technically not a join but can be handy for merging tables in SQL. In this article, I’ll guide you through the different solutions with examples. When Do you Need to Join Tables Without a Common Column? Beginners just getting started with SQL are usually introduced to standard equi joins, in which two tables are combined by a common column.

What's the Difference Between Having Multiple Tables in FROM and Using JOIN?

What’s your approach to joining tables in SQL? In this article, we discuss two approaches and explain why many SQL developers have a definite preference for JOIN. Do you prefer to list multiple tables in FROM and use WHERE to set the join conditions? Or do you use the JOIN keyword? SQL supports both, but there are significant differences between them. Let’s look at each one in detail and then discuss why JOIN is generally preferred.

Practical Examples of When to Use Non-Equi JOINs in SQL

If you think that two tables in SQL can be joined only using the common field, you will be excited to learn that there are other ways of joining. Non-equi JOINs use different kinds of comparison operators in the JOIN condition. In this article, I’ll guide you through non-equi JOIN examples to show the common use cases for this type of JOIN. Equi JOIN vs. Non-Equi JOIN How do you usually join two tables in SQL?

How to Learn SQL JOINs

JOINs are one of the most fundamental and commonly used SQL commands for manipulating and querying real-world data sets. They are also one of the more challenging SQL topics to master! In this article, you’ll learn an effective strategy to learn the different types of SQL JOINs. When data is stored in a single table, we can easily retrieve rows and get all the information we need. But when businesses scale, so does their data.

Subquery vs. JOIN

One of the challenges in writing SQL queries is choosing whether to use a subquery or a JOIN. There are many situations in which a JOIN is the better solution, and there are others where a subquery is better. Let’s consider this topic in detail. Subqueries are used in complex SQL queries. Usually, there is a main outer query and one or more subqueries nested within the outer query.

How to Join 3 Tables (or More) in SQL

Using JOIN in SQL doesn’t mean you can only join two tables. You can join 3, 4, or even more! The possibilities are limitless. If you’ve just learnt JOINs in SQL, you might think that it’s limited to two tables. That’s not surprising – this concept can be hard to understand, and the idea that JOINs can get even more complicated may be really scary at first. The truth is that you can easily extend this idea to three tables or even more.

How to LEFT JOIN Multiple Tables in SQL

Can you LEFT JOIN three tables in SQL? Yes, indeed! You can use multiple LEFT JOINs in one query if needed for your analysis. In this article, I will go through some examples to demonstrate how to LEFT JOIN multiple tables in SQL and how to avoid some common pitfalls when doing so. What Is a LEFT JOIN? Let’s start by reminding ourselves what a LEFT JOIN is and how to use it.

Tag: Kurtosis

High Performance Statistical Queries –Skewness and Kurtosis

In descriptive statistics, the first four population moments include center, spread, skewness, and kurtosis or peakedness of a distribution. In this article, I am explaining the third and fourth population moments, the skewness and the kurtosis, and how to calculate them. Mean uses the values on the first degree in the calculation; therefore, it is the first population moment. Standard deviation uses the squared values and is therefore the second population moment.

Tag: Language

What Programming Language Should You Learn?

If you've ever been wondering which programming language you should learn first, you know that's a tough nut to crack. It’s especially difficult if you are new to IT and programming. In this article, I give suggestions for what to learn first and what perspectives each language can give you in IT. There are hundreds of programming languages, and new ones are showing up all the time. Getting to know all of them is simply impractical and impossible.

Tag: Learn sql

How Much Do Data Engineers Earn in 2020?

Data engineering is a hot job right now. What does a data engineer do? And just how much do they earn? We’ve done the research for you. If you are reading this, you’re either starting to learn SQL or you already know some and feel it’s time to look around for a SQL job. Maybe you’re in the midst of tackling our Creating Database Structure track. And, let’s be honest, maybe you need some extra motivation to keep on you track.

How to Use 2 CTEs in a Single SQL Query

Have you ever wondered how to use multiple CTEs in one SQL query? Read this article and find out about recursive CTEs. After learning common table expressions or CTEs, a natural question is “Can I use several CTEs in one query?” Yes, you can! And you can do it quite easily, especially if you already have some basic knowledge of CTEs. Whether you know a bit about CTEs or you’re entirely new to the CTE world, reading about what a CTE is is always a good start.

How to Join Two Tables in SQL

Querying data from multiple tables is very common when working with relational databases. It is not difficult if you know how to use the dedicated SQL operators for doing this. In this article, you will learn how to join two tables by using WHERE and by using a special operator JOIN, and you will see how to filter rows in the result set. How to Query a Single Table First, a quick refresher on how to select data from a single table.

GROUP BY in SQL Explained

The SQL GROUP BY statement is easy to use, but it can be hard to master. Learn what you can do with GROUP BY, how it works, and how to use it with aggregate functions. GROUP BY is one of the basic SQL tools. However, it might be difficult for beginners to understand how GROUP BY works and how it is used to compute statistics with different aggregate functions. In this article, I’ll use several examples to show exactly how GROUP BY organizes rows and how aggregate functions can be used to calculate statistics on one or more columns.

Top 5 Beginner Online SQL Courses in 2020

Looking for an exciting new career? Data analysis won’t disappoint you! The simplest way to make this possible is by learning SQL, and online SQL courses are the most effective learning method. Don’t know where to start? Here’s an overview of the best online SQL courses for complete beginners. There are infinite reasons for changing your industry. You may want to land a new job because you’re burnt out. You may be bored and want something more challenging.

Behind the Scenes at LearnSQL.com: How Our SQL Courses Are Created

Take a peek behind the scenes and learn our secret for creating great SQL courses! Have you ever wondered how LearnSQL.com courses are created? Are we looking at a lot of hard work or just a bit of magic? Or maybe both? Here’s a hint: we rely on proven methods to create user-friendly online courses. But it’s not easy! Read on to see the 8 steps we take when creating a new SQL course.

Why and How to Find Freelance SQL Jobs

If Covid-19 has you all “I-want-to-stop-working-for-the-man-and-enjoy-a-more-fulfilling-life-as-the-master-of-my-own-destiny”, then I’ve got news for you. Not only is it possible to be an SQL freelancer, it’s also a potentially lucrative and liberating career move. It will allow you to work for a diverse range of clients and march to the beat of your own drum. Of course, SQL freelancing isn’t for everyone. You will need a strong sense of self-motivation, some serious hustling skills, and the ability to sell yourself and your services as THE ABSOLUTE BEST all the time, every time - day in, day out.

Six Examples Using MySQL Window Functions

Window functions are an advanced SQL feature available in most popular databases. MySQL had not supported them for a long time, but that changed in Version 8.0. They are helpful not only for analysts and people who create reports, but also for other professionals who use databases to select data needed. In this article, we explain the syntax of some popular window functions with practical examples. What Is a Window Function?

What a Moving Average Is and How to Compute it in SQL

Want to dive deep into time series data and examine long-term trends? Want to know what a moving average is and how to compute it in SQL? Then this article is for you. I’ll explain a powerful feature in SQL called window functions and show how you can calculate moving averages using them. What Is a Moving Average? The moving average is a time series technique for analyzing and determining trends in data.

LearnSQL Track of the Season: SQL from A to Z

During Fall 2020, our main SQL track, SQL from A to Z, will be in the spotlight. In this article, we answer the most frequently asked questions about this track. At LearnSQL.com, our SQL courses are organized into tracks. A track is a sequence of courses designed to help you achieve a specific learning goal. The courses in the track are in a recommended order that progresses from the easiest to the most challenging.

How to Find Duplicate Values in SQL

Duplicate records waste time, space, and money. Learn how to find and fix duplicate values using SQL’s GROUP BY and HAVING clauses. Database best practices usually dictate having unique constraints (such as the primary key) on a table to prevent the duplication of rows when data is extracted and consolidated. However, you may find yourself working on a dataset with duplicate rows. This could be because of human error, an application bug, or uncleaned data that’s been extracted and merged from external sources, among other things.

SQL Course of the Month - Analyzing Revenue Trends in SQL

We work hard, we learn SQL, and we develop professionally. But why? For our own satisfaction, but also for money! The knowledge of SQL will increase your income significantly. If you are proficient in SQL, you can better analyze your company's revenue. How? I asked Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo. In this article, she answers your questions about our September SQL Course of the Month: Analyzing Revenue Trends in SQL.

How CTEs Work

The SQL language offers a feature named Common Table Expressions, or CTEs. Also known as WITH clauses, CTEs are a fairly new addition to SQL. They help you break longer queries into smaller chunks, making your queries much easier to understand. Read the article to find out how to use CTEs and how they differ from traditional subqueries. Common Table Expressions (CTEs), which are essentially named subqueries, were first mentioned in the SQL standard between 1999 and 2000.

How Does SQL GROUP BY Work?

Grouping results is a powerful SQL feature that allows you to compute key statistics for a group of records. GROUP BY is one of SQL’s most powerful clauses. It allows you to see data in a new way and find key metrics (like the average, maximal, and minimal values in a group of records). Without GROUP BY, all the results we obtain are oriented to records. With GROUP BY, we can create groups of records and calculate metrics on each group.

SQL CTEs Explained with Examples

Learn how you can leverage the power of Common Table Expressions (CTEs) to improve the organization and readability of your SQL queries. The commonly used abbreviation CTE stands for Common Table Expression. However, that simple fact doesn’t add much to your understanding. What does a CTE do? Why might you want to use one in your SQL code? Let’s answer those questions. What Is a CTE? A Common Table Expression is a named temporary result set.

How to Calculate the Length of a Series with SQL

What is a time series and why bother to calculate its length using SQL? How do we calculate the length of a series in SQL? I can answer that in two words: window functions! Yes, you’ll need some knowledge of SQL window functions to calculate series length. But what is a time series, and why would you want to find out how long it is? What Is a Series?

Where Can I Find Free Online Data Sets to Practice SQL?

Okay, you've installed the RDBMS of your choice. You know the basics of SQL and ... what's next? You would like to be able to practice SQL functions you learned in our course. Maybe you have even done our SQL Practice Set course and are hungry for more. To work with a database, first of all, you need—yes, this is not a surprise—a database! Where do you get the data for your SQL queries?

5 Examples of GROUP BY

When you start learning SQL, you quickly come across the GROUP BY clause. Data grouping—or data aggregation—is an important concept in the world of databases. In this article, we’ll demonstrate how you can use the GROUP BY clause in practice. We’ve gathered five GROUP BY examples, from easier to more complex ones so you can see data grouping in a real-life scenario. As a bonus, you’ll also learn a bit about aggregate functions and the HAVING clause.

How to Create a Table in SQL

Creating tables in databases is a very helpful skill, and not just for software engineers or database administrators. It allows you to design or change the structure of a database and store data that’s related to each other. In this article, you’ll learn what a database table is, who creates them, and how to use the syntax of the CREATE TABLE command. What Is a Database Table? A relational database is built of various structures like tables, views, procedures, and triggers.

The Most Popular Databases in 2020

Which database solution is currently most popular? Which SQL dialect should you study? In this article, I’ll share the results of my research and my personal experience. Here are the databases that are worth learning SQL to use. First, let's answer some simple questions: Is SQL still useful? Is it worth learning? If you complete an online SQL course, will it make your work easier? The answer is YES! Why?

What Is the Difference Between WHERE and HAVING Clauses in SQL?

As the amount of data in the world grows day by day, the need increases for managing and querying data efficiently. SQL offers ways to manipulate and query data at any scale. As an important part of this, the WHERE and HAVING clauses allow you to filter data as you need, but they are not the same. We will explain the differences between them in detail. One of the most common tasks in manipulating and querying data is filtering using the WHERE and HAVING clauses.

How to Spend Less by Mastering the Monthly Budget in SQL

Do you struggle to keep your budget under control? You must have heard about various budget planning materials available as printouts, Excel spreadsheets, or smartphone apps. In this article, we’ll show you another possibility. You’ll learn how to use databases and SQL to identify the weak points of your home budget and spend less. We all need to pay for everyday necessities such as groceries or medical appointments. With money coming in and out of our pockets, it’s easy to lose track of how much we spend and if we have any savings.

Is There any Demand for SQL Language Nowadays?

SQL is 46 years old. That’s 14 years older than I am, and at least 23 years older than the jar of pickles in my refrigerator. SQL is the still-hip granddaddy of the programming world. You know the one: non-ironic suspenders, twirled mustache, tattoo peeking out over his spotted socks. He may be old, but boy, is he fly. If you’ve heard of the NoSQL movement, you may be wondering: why learn SQL in this day and age?

5 Reasons You Might Fail to Learn SQL

Learning SQL isn’t hard, but that doesn’t mean you’ll sail through, problem-free. Here are five things that might cause unwary SQL learners to fail. For me, learning SQL wasn’t always about the joy of discovery. Learning itself is not all about curiosity and the satisfaction of succeeding. Sometimes there is a sense of failure. We’re often told it is better to focus on positives. I believe this. However, it is also crucial to find out what went wrong when we don’t succeed at something.

Learning SQL When You Work and Have a Family

Do you want to learn SQL but feel you can’t squeeze one more thing into your jam-packed life? Here are my tips on learning SQL when you work and have kids. You work full-time and have a family. Daily responsibilities overwhelm you. I’ve been there. Heck, I live there. I work from home and have a family. While I was writing this article, I was also waiting for a call on Zoom, doing the laundry, and cooking some pasta for my son’s dinner.

Can you Join two Tables Without a Common Column?

Yes, you can! The longer answer is yes, there are a few ways to combine two tables without a common column, including CROSS JOIN (Cartesian product) and UNION. The latter is technically not a join but can be handy for merging tables in SQL. In this article, I’ll guide you through the different solutions with examples. When Do you Need to Join Tables Without a Common Column? Beginners just getting started with SQL are usually introduced to standard equi joins, in which two tables are combined by a common column.

Who Should Learn SQL Window Functions?

Do you want to learn how SQL window functions can help you at your job? This article will show you examples from various business applications where they can be very useful. I won’t be explaining what SQL window functions are in this article, but rather how to use them. If you’re not familiar with window functions or their syntax, don’t worry. Here’s an article that can help you with an introduction to SQL window functions.

SQL Course of the Month - Recursive Queries

Recursive Queries is one of SQL’s more advanced features. You could say they divide SQL users into beginners and experts. But how do you learn recursive queries? And why do you need them, anyway? Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo, is here to help. In this article, she answers your questions about our August SQL Course of the Month: Recursive Queries. Recursive queries … that sounds very serious. What are they?

The SQL HAVING Clause Explained

What is the SQL HAVING clause? Why do you need it, and where do you use it? We’ll explain HAVING in detail. HAVING is a very common clause in SQL queries. Like WHERE, it helps filter data; however, HAVING works in a different way. If you are familiar with the GROUP BY clause and have only heard about HAVING – or if you’re not familiar with HAVING at all – this article is what you need.

How to Use Subqueries in INSERT, UPDATE, and DELETE Statements

Did you know that subqueries can also be used in UPDATE, INSERT, and DELETE statements? Subqueries in SQL are like building blocks that can be used in a variety of statements, not just SELECT. If you find subqueries useful in SELECT, read this article to find out how useful they can be in other instructions. You will be able to create much more complex and powerful SQL queries in no time!

Our 6 Favorite SQL Books for 2020

So you want to learn SQL and query databases? Great! Check out these six SQL books for an in-depth look at the language and you’ll be writing queries in no time! You take SQL courses, participate in internet discussions and forums, watch tutorials on YouTube... What else can you do to develop your skills? Sometimes it’s good to reach for old-fashioned sources of knowledge: SQL books. Which book(s) should you choose?

Who Is a Data Engineer?

A new kind of job has recently emerged in the IT world: Data Engineer. At first sight, it may seem very similar to Data Analyst or Data Scientist positions. However, our article explains all the important differences. We present the skills, tools, and everyday tasks of Data Engineers. We also explain how you can get started with this career path.   Thirty years ago, we typically used terms such as “Computer Scientist” when referring to anyone working with computers.

What's the Difference Between Having Multiple Tables in FROM and Using JOIN?

What’s your approach to joining tables in SQL? In this article, we discuss two approaches and explain why many SQL developers have a definite preference for JOIN. Do you prefer to list multiple tables in FROM and use WHERE to set the join conditions? Or do you use the JOIN keyword? SQL supports both, but there are significant differences between them. Let’s look at each one in detail and then discuss why JOIN is generally preferred.

How to Analyze a Time Series in SQL

Values ordered by time are called a time series. In this article, I’ll show you the most frequent patterns and teach you how to write queries for time series in SQL with the help of window functions. Maybe you’ve had the opportunity to analyze some variables where each value was associated with a time value. Such data – where values are ordered by time – is called time series data.

LearnSQL.com’s New Learning Path: Data Engineering

Calling all future data engineers! Would you like to learn to use SQL? Then our new Data Engineering Learning Path is just for you! We’re very excited to announce the release of a new learning path at LearnSQL.com: Data Engineering, published in July 2020. This is the second learning path offered in our platform. So far, we offered an analytical path, SQL Querying & Reporting, that focuses on writing queries and business reports in SQL.

Using GROUP BY in SQL

Now that you know SQL’s core commands, power up your queries with the GROUP BY clause and aggregate functions. GROUP BY is a SQL clause that arranges data into groups based on a common value (or values). It is widely used to obtain summary information for large datasets as well as for computing basic aggregate statistics. Once you have grasped SQL’s basic commands like SELECT, WHERE, and JOIN, mastering the GROUP BY clause can help you implement your SQL knowledge in real-world business intelligence scenarios.

The LAG Function and the LEAD Function in SQL

LAG() and LEAD() are positional functions. A positional function is a type of window function. If you are not familiar with when and how to use them, what the syntax of each function is, why you might want to use them, and what the differences are, read on! LAG() and LEAD() are positional functions. These are window functions and are very useful in creating reports, because they can refer to data from rows above or below the current row.

When Should I Use a Common Table Expression (CTE)?

Interested in hearing more about common table expressions or CTEs? Would you like to know when CTEs are useful? Read on—we’ll discuss in this article. If you’ve heard of common table expressions, you’ve probably wondered what they do. Even if you have not, it’s good that you’re here! CTEs can be very useful, especially if you have already mastered the basics of SQL, such as selecting, ordering, filtering data, and joining tables.

How to Learn SQL Fast

Are you in a hurry to improve your data skills? I’ve got good news: you can learn SQL fast and move to a whole new level of data proficiency. You work with data every day, but you've had enough of how long it takes to process your giant table in Excel. The time has come for a much better tool: SQL! But how long does it take to learn SQL?

How to Calculate the Difference Between Two Rows in SQL

Calculating the difference between two rows in SQL can be a challenging task. It is possible – and there’s more than one way to do it. In this article, I’ll explain how to use the SQL window functions LEAD() and LAG() to find the difference between two rows in the same table. I like to think of this as a “happy hour" article – you can learn about two topics (calculating the difference between two rows and SQL window functions) by reading just one article.

What Is Data Engineering?

Data Engineering is a fairly new term in IT. And it’s getting more and more attention. You may have heard about a few similar fields like data science, Big Data, and machine learning. This article explains the difference between these concepts and shows how they can be combined to analyze vast amounts of data. When computers first appeared, their storage capacity was very limited. Do you remember floppy disks? They were popular in the late 20th century and typically offered around 1.

What Is a CTE?

After mastering statements like SELECT, DELETE, INSERT, and GROUP BY, you might search for ways to improve code maintainability, reproducibility, and readability. At that point, you will probably start learning about modern SQL concepts that were introduced in the early 2000s. One such SQL technique is the CTE? (common table expression) —?a temporary named result set. In this article, you will learn what a CTE is and how to use it to improve the maintenance and the readability of your code.

Top 10 Laptops for Learning SQL in 2020

If you want to learn SQL, you’re going to need a device that’s portable and powerful. I recommend a laptop. Here are the features you’ll need, as well as my picks for laptops to get you learning SQL in 2020! I must admit that browsing Amazon’s computer offers or entering any computer store can give you a headache. So many models, with so many options! They differ in components, workmanship, battery life, and screen size and resolution.

What Is a SQL Dialect, and Which one Should You Learn?

SQL, standard SQL, SQL Server, MySQL, PostgreSQL, Oracle, … You’d like to learn SQL, but you feel overwhelmed with keywords and you don’t know where to start. Let’s explain what each of those terms mean. SQL Is the Language for Talking to Databases A database is a computer program that can store and process large amounts of data. There are many different vendors of databases. PostgreSQL, MySQL, Oracle, and SQL Server are all database products by different vendors.

Why Learn SQL for iOS and Android Development?

App and program development with iOS and Android is a huge and rapidly growing field in the software world. While some developers get through their careers knowing only their chosen development language, there are plenty of reasons to add SQL to that skill set. Here at LearnSQL.com, we are often asked: “why Learn SQL for iOS and Android development?” To answer that question, we’ve put together a little explanation about exactly why learning SQL makes sense for those in the app development space.

SQL Course of the Month - PostGIS

It's summer, and it's travel time ... at least it would be under normal conditions. The pandemic is still going on, but that doesn't stop us from dreaming about distant trips and visits to beautiful places. For now, most of us will have to do it on a map. Did you know that databases can store geographical data? With interactive maps, if you find a nice summer house on the internet, you can accurately track it and plan the best route there.

Listen to These 7 SQL Podcasts in 2020

Are you learning SQL online but craving more? If you're looking for a way to squeeze some sweet SQL knowledge into your day, try listening to a SQL podcast. Choose one of our picks and get ready to amp up your SQL game! If you're like me, you like to get deep into a topic. You’re practicing it whenever there’s an opportunity. Of course, It’s hard to make time. I cherish the days I’m able to sit down and just get some hands-on learning done.

How ORDER BY and NULL Work Together in SQL

Do NULL values come first or last when you use ORDER BY? Are they considered higher or lower than non-NULL values? In this article, I’ll explain how different relational databases treat NULL values when sorting output and how to change the default behavior of the ORDER BY clause. When LearnSQL users practice the ORDER BY clause in our SQL Basics course, they often ask why NULL values appear first in the output and how they can change this behavior.

How to Publish a LearnSQL.com Course Certificate on LinkedIn

LinkedIn draws both job seekers and recruiters. Showcasing your knowledge, skills, and experience on this professional networking site can lead to great opportunities. We know this well at LearnSQL.com. Have you finished one of our courses? Great! Tell your future employer about what you have learned. Here's a step-by-step how-to guide for publishing a course certificate on LinkedIn. I will show you how easy it is to publish a LearnSQL.

TRUNCATE TABLE vs. DELETE vs. DROP TABLE: Removing Tables and Data in SQL

What’s the difference between truncating, deleting, and dropping a table in SQL? Find out in this article. There are a lot of ways to delete data in SQL, including the DELETE, TRUNCATE TABLE and DROP TABLE commands. Which one should you use in a given situation? In this article, you’ll learn the syntax of each command in different database engines like MySQL, PostgreSQL, SQL Server, and Oracle. And you’ll understand the DROP TABLE vs.

How to Learn the SQL Syntax

Read about what SQL is, and choose the best way for you among a wide variety of possibilities for learning SQL and remembering its syntax. What Is SQL? “SQL” stands for “Structured Query Language,” and as it sounds, it is a language dedicated to querying a relational database. In practice, it is used for creating, designing, and managing a relational database. People use SQL to: Create sets of tables and rows Modify database tables and index structures Insert, update, and delete data Retrieve information from a database for a variety of uses such as analytics Relational databases consist of a set of tables containing rows and columns of data.

A Mathematician in the World of SQL

She has a PhD in Mathematics and over 10 years’ experience teaching mathematics and computer science at the University of Warsaw. She knows SQL better than just about anyone I’ve met. Let’s get to know Agnieszka Kozubek-Krycuń, Vertabelo’s Chief Content Officer at Vertabelo. Let's go back in time. How did your adventure with math start? I’ve always enjoyed abstract concepts and problem solving. I was fascinated by variables when we learned to solve simple equations like x+2=5 in primary school.

Last-Minute Preparation Tips for a Database Class Exam

Getting to learn SQL is fun. You don’t really need to spend much time to understand some basic SQL concepts and use them fluently. If you’re a student facing your first database class exam soon, we’ve got you covered. In this article, we explain what you should focus on while learning SQL and studying for an entry-level database exam. Check your knowledge with our 10 sample questions and discover where you can find more SQL practice.

How to Practice SQL Window Functions at Home

Are you looking for a way to maintain your knowledge of SQL window functions? What’s the best way to practice them at home? Here are some suggestions. Learning something new feels great, but it’s also arguably the easiest part of gaining knowledge. You’ve probably experienced that yourself. You struggle with learning an idea, and then you finally get it! There’s the feeling you’ve learned something. And then, very soon, you practically have to start all over again with the very same concepts.

The Best SQL Social Media Groups and Channels to Follow in 2020

We get news, advice, and funny videos from Facebook, Twitter, and YouTube. Why not use social media to help you learn SQL? You wake up and the first thing you do is check for Facebook notifications. Do you take a photo of your breakfast and share it with friends on Instagram? Maybe you argue with someone on Twitter about which James Bond was the best? Or maybe you are recording a short TikTok video of you singing Lady Gaga?

What’s an SQL Inline Query?

Have you ever heard the term “inline query”? How are they different from subqueries and derived tables? Have you looked this up in numerous places and still don’t know the answer? Let’s embark on a journey and find out together! The first time I heard the term “inline query”, I was a little bit surprised. It doesn’t sound like one of SQL’s nuances and I thought I knew all the basic concepts.

Monthly SQL Challenges

SQL learners sometimes need challenges. Do you want to test your problem-solving skills or your knowledge of SQL? Then take our monthly SQL Challenges! We prepare them on LearnSQL.com every month. Each Challenge relates to a different interesting topic and will help you keep your SQL game sharp. In this article, you'll discover what our LearnSQL.com Monthly Challenges are and where to find them. We’ll also look at the Challenges collected in our Monthly SQL Challenge Mini Track.

Practical Examples of When to Use Non-Equi JOINs in SQL

If you think that two tables in SQL can be joined only using the common field, you will be excited to learn that there are other ways of joining. Non-equi JOINs use different kinds of comparison operators in the JOIN condition. In this article, I’ll guide you through non-equi JOIN examples to show the common use cases for this type of JOIN. Equi JOIN vs. Non-Equi JOIN How do you usually join two tables in SQL?

SQL Course of the Month - SQL Practice Set

It is said that practice makes perfect. I agree with this statement one hundred percent. What is applicable in basketball training, playing an instrument, or learning a foreign language is also useful in learning SQL. Practicing writing queries, using functions, and putting together clauses is the basis for learning the true power of SQL. But how and where do you practice SQL? I spoke with Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo about this.

How to Convince Your Boss That You Need to Start Learning SQL

Learning SQL is a great goal. Now, if you could only convince your boss that it’s good for the company as well as for you ... You’re aware of the benefits of adding SQL to your skill set. You believe that the rewards gained from you learning SQL will also benefit your employer – it’s not just another way for you to develop your professional profile. But how do you articulate this to your boss?

Top 5 Programming Languages to Learn Alongside SQL

If you already know or are about to learn SQL, you’re well on your way to being a sought-after database administrator, database engineer, or just a general database whizz kid! SQL is a modern, widely-used language that finds application in almost every industry. There is no shortage of jobs with SQL. But what if you want to branch out and learn another language to complement your SQL knowledge and skills?

How to Learn SQL JOINs

JOINs are one of the most fundamental and commonly used SQL commands for manipulating and querying real-world data sets. They are also one of the more challenging SQL topics to master! In this article, you’ll learn an effective strategy to learn the different types of SQL JOINs. When data is stored in a single table, we can easily retrieve rows and get all the information we need. But when businesses scale, so does their data.

What Are the Different Types of SQL Subqueries?

Subqueries can be used in many business cases. What subquery types does SQL offer? And how can you use them efficiently? In this article, I’ll guide you through different subquery types and the typical situations when they are useful. What Is an SQL Subquery? A subquery, or nested query, is a query placed within another SQL query. There are many different scenarios where you may want to include a query in the WHERE, FROM, or SELECT clauses of your main query.

Subquery vs. JOIN

One of the challenges in writing SQL queries is choosing whether to use a subquery or a JOIN. There are many situations in which a JOIN is the better solution, and there are others where a subquery is better. Let’s consider this topic in detail. Subqueries are used in complex SQL queries. Usually, there is a main outer query and one or more subqueries nested within the outer query.

5 Advanced SQL Constructions Every Data Analyst Should Learn

Does your job involve data analysis? Here are five examples of how advanced SQL can help you in your daily work. I’m a data analyst and I have to say – data analysts can be quite strange. Other people are usually afraid of immense amounts of data; we enjoy it. The deeper we get into data, the happier we are. An important tool for getting into data (and thus being a happier data analyst) is SQL.

Is it Difficult to Learn SQL?

It’s the number one question asked by the students of SQL and those new to the IT world. Is it difficult to learn SQL? If you came here because you’ve been pondering that very same question, take some comfort in the fact that in no way are you alone. Even the idea of SQL can be intimidating to those of us without a tech background, but it doesn’t have to be that way.

Subquery vs. CTE: A SQL Primer

Have you ever wondered about the differences between a subquery and a common table expression (CTE) in SQL? The concepts seem very similar, but knowing the difference – and when to use each one – will help you write efficient and readable queries. First, we’ll explain the concepts underlying subqueries and CTEs. Then we’ll look at a few examples and finally analyze the pros and cons of each technique.

How to Number Rows in an SQL Result Set

Have you ever needed to add a sequential number to the records in the result of an SQL query? It’s not as simple as it looks! Find out how to do it correctly in this article. To number rows in a result set, you have to use an SQL window function called ROW_NUMBER(). This function assigns a sequential integer number to each result row. However, it can also be used to number records in different ways, such as by subsets.

SQL Course of the Month - Creating Basic SQL Reports

In May, we chose Creating Basic SQL Reports as our course of the month. Why? Because the basis of every successful business is making the right decisions based on proven data and good SQL reports. I asked Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo, about this. She knows SQL better than just about anyone and is probably the best person to talk about SQL Reporting. What does it mean to create SQL reports?

Overview of Ranking Functions in SQL

SQL ranking functions make working with relational databases easier, especially for data analysts, marketers, and financial specialists. These functions are used to assign a ranking number for each record and allow you to efficiently create useful reports. SQL ranking functions are window functions. Window functions compute the result based on a set of rows. The word “window” refers to this set of rows. Let’s look at the syntax of ranking functions:

Beginner’s Guide to the SQL Subquery

Subqueries are a powerful SQL resource, allowing us to combine data from multiple tables in a single query. In this article, we’ll teach you everything you need to begin using subqueries. Perhaps the simplest definition of a SQL subquery is “A query inside a query”. Subqueries are so easy to understand that they often appear in the opening chapters of SQL courses. However, there are many variants of subqueries that need to be explained.

Advanced SQL Interview Questions (and Answers)

Do you want to move to a job that uses SQL? Are you unsure about what to expect during the job interview or how to benchmark your knowledge? This article will give you a good idea of where you stand. If you feel stuck in your job, you’re not the only one. The modern division of work pushes people to perform very specific tasks, expecting them not to look at what's on the other side.

SQL in Google Sheets? Yes, We Can!

Did you know that you can write SQL-like queries in Google spreadsheets? This feature is incredibly powerful, versatile, and can replace most of the functionalities offered by Excel’s pivot tables. Read our article to find out how you can easily use the QUERY function to efficiently work with your Google Sheets data. Relational databases share many features with spreadsheets. When we explain what databases are, we often say that they are a bit like spreadsheets except they give us more control over larger amounts of data.

Why Should I Learn SQL Window Functions?

SQL has been around for more than 25 years. Its basic syntax – like SELECT, WHERE, GROUP BY, HAVING, and ORDER BY – is well known. But is there something besides traditional SQL? Can you go beyond the basics and improve your skills? The answer to this question is yes. There is a modern version of SQL. In this article, we are going to dive into the modern version and learn about SQL window functions.

What Is a Nested Query in SQL?

Have you ever wished that you could build a query with several SELECT statements? Good news! You can do this – and a lot more – with SQL’s nested queries. If you’ve been learning SQL (and maybe writing some queries) for a while, you’ve probably encountered cases where it looks like you need another SELECT statement inside your main statement. You may wonder “Is it possible to use nested SELECTs in SQL?

Advanced SQL Courses for Data Analysts – A Complete Review

Even data analysts who already know SQL need to keep their skills sharp. Where can you find the best advanced SQL courses for data analysts? Check out our review of the top online sources! In this article, I present a list of online SQL courses for data analysts. These courses are offered by various platforms. Why wait? Let’s jump right in! 8 Advanced SQL Courses for Data Analysts Let's take a closer look at these courses to decide which platform will be better for you in learning SQL.

You Want to Learn SQL? You've Come to the Right Place!

It is difficult to list all the benefits of learning SQL. You will work faster and more efficiently with a database, you will no longer be dependent on the IT department, and you will be able to analyze the data yourself and draw appropriate conclusions, among others. Add reporting to this, and you will get a very wide range of cool and useful skills. Maybe you want to change jobs or get a promotion?

What SQL Practice Do You Need to Prepare for a Technical Job Interview?

You’ve scored yourself an interview for an SQL-related job. Nice work! But perhaps uncertainty is creeping in as your interview date looms closer. Do you know enough SQL to make the cut? What questions are you likely to be asked? What SQL practice should you be doing before your interview? Almost all SQL job candidates go through exactly the same nerve-wracking process. Here at LearnSQL.com, we have the lowdown on all the SQL practice and preparation you’ll need to ace those interview questions and take your career to the next level.

Is SQL a Programming Language?

SQL is a powerful tool for communicating with database management systems. When you write SQL queries, you give instructions to the computer, and it performs these instructions—it sounds like programming. However, you cannot build an application with SQL as you can with Python or Java. So, is SQL a programming language? What Is SQL? Let’s start with the basic definition. SQL, or Structured Query Language, is a language used for communication with relational databases.

SQL Course of the Month - Window Functions

Spring has come. It is nicer outside. It's a great time to learn something new. Which course should you choose? In April, it's worth it to bet on SQL window functions. What are they, what are they used for, and why are they worth knowing? I asked Agnieszka Kozubek-Krycuń, Chief Content Officer at Vertabelo, these questions. She has a PhD in mathematics and over 10 years’ experience teaching mathematics and computer science at the University of Warsaw.

What Is a SQL Running Total and How Do You Compute It?

The SQL running total is a very common pattern, used frequently in finance and in trend analysis. In this article, you’ll learn what a running total is and how to write a SQL query to compute it. So, without further ado, let’s get started on the first part of the question. What’s a SQL Running Total? In SQL, a running total is the cumulative sum of the previous numbers in a column.

Is SQL Worth Learning?

We’re in the 21st century. These are the “ultimate data times” in which loads of information on all kinds of things is available. We want to explore this info even more, slice and dice it, understand where it comes from and what triggers it. With such large amounts of data coming in, people have discovered that spreadsheets aren’t enough. There’s a need for a greater solution, something like a spreadsheet on steroids.

Top 3 Platforms to Learn SQL Online: A Complete Comparison

Do you want to learn SQL online? Where do you start? There are many choices on the internet, and it can be hard to decide. But don’t worry—I tested and compared three major platforms to help you find the best place to learn SQL online! E-learning is on the rise. It gives us infinite possibilities of growing our professional careers without leaving our homes. And increasing our competencies is especially important now that the labor market has become dynamic and unstable.

When Do I Use SQL Window Functions?

Have you heard one of your colleagues bragging about using SQL window functions? Do you know basic SQL but not much, or anything, about window functions? If you want to learn about window functions and how to use them in a business context, you’re in the right place! This happens often. You reach a certain level of knowledge, and you feel like the king (or queen) of the world. Then, you overhear your colleagues talking about something you have never heard of (in this case, window functions).

How to Join 3 Tables (or More) in SQL

Using JOIN in SQL doesn’t mean you can only join two tables. You can join 3, 4, or even more! The possibilities are limitless. If you’ve just learnt JOINs in SQL, you might think that it’s limited to two tables. That’s not surprising – this concept can be hard to understand, and the idea that JOINs can get even more complicated may be really scary at first. The truth is that you can easily extend this idea to three tables or even more.

Why Take the “SQL Basics” Course at LearnSQL.com

LearnSQL.com’s interactive “SQL Basics” course teaches the foundations of SQL. Discover why we built this online course, our philosophy behind it, and what it contains! What Is SQL, and Why Should You Learn It? SQL is a language used to talk to databases, computer programs that hold data and can process it efficiently. SQL can select data from a database and perform various computations on the data, be they simple or complex.

What Is the Difference Between a GROUP BY and a PARTITION BY?

Window functions are a great addition to SQL, and they can make your life much easier if you know how to use them properly. Today, we will address the differences between a GROUP BY and a PARTITION BY. We’ll start with the very basics and slowly get you to a point where you can keep researching on your own. PARTITION BY vs. GROUP BY The PARTITION BY and the GROUP BY clauses are used frequently in SQL when you need to create a complex report.

What is the Best SQL Training Online?

In today’s data-driven world, SQL is a highly sought-after skill, but it cannot be mastered merely over a fortnight. With so many resources at your disposal to learn SQL, where do you even consider beginning, and how do you practice SQL? Savvy and knowledgeable database professionals have consistently been in high demand over the last five years. If you are aiming to advance your career as a database developer, administrator, warehousing specialist, or analyst, SQL training and mastery is an absolute necessity.

How to Analyze Time Series COVID-19 Data with SQL Window Functions

The COVID-19 pandemic really changed the way we live. No matter where you are, you're being impacted by this unpredictable virus. We do not know what the future holds, but we do believe in science and in better days to come. One thing that makes me as a data analyst particularly happy is that we have publicly available data. We can analyze that data and learn something from it. If you want to explore COVID-19 with the help of modern SQL constructions, keep reading — this article is intended for you.

SQL Window Functions vs. GROUP BY: What’s the Difference?

A very common misconception among SQL users is that there is not much difference between SQL window functions and aggregate functions or the GROUP BY clause. However, the differences are very significant. Perhaps the only similar point between GROUP BY and window functions is that both allow you to execute a function (such as AVG, MAX, MIN, or COUNT) on a group of records. I’d say that window functions’ special power is that they allow us to obtain results that otherwise would be almost impossible to achieve.

Choose the Best Way to Learn SQL

SQL has become a hot topic in the professional world, and many resources have appeared both online and offline for learning SQL. It’s easy to get lost in the jungle of books, tutorials, and courses. Which resources do you choose? If you want to know how to learn SQL quickly and effectively, take a look at my list. There are many reasons for learning SQL. We asked our users about them and learned that there was no universal motive.

SQL Cookbook with Recipes for Success

The internet holds a lot of information and can provide solutions to various problems. SQL users, both beginners and advanced, often turn to the internet for help with SQL queries. This article will help you find the right SQL queries to solve your problems. Learn what the SQL Cookbook is and why you should use it. You will also find a list of the most important recipes, from which you will prepare a great SQL dish with the taste of success.

Are There Any Good SQL Courses for Marketers?

Looking for places to learn SQL online and level up your marketing efforts? Check out these SQL courses. Introduction With the help of IT experts, meticulous marketers analyze information to create advertising strategies. This commonplace state of affairs forces the marketer to rely on data experts and sometimes wait for their availability. But what if marketers could pull the data themselves? They can – by turning into a technical marketer.

How to Get the First Day of the Week in SQL Server

This is additional content for the LearnSQL.com course Customer Behavior Analysis in SQL Server. In the previous article, we talked about how you can use the SQL Server DATEPART() function with week or iso_week to group events by week. The query might look like this: SELECT DATEPART(week, RegistrationDate) AS Week, COUNT(CustomerID) AS Registrations FROM Customers WHERE '20180101' The result looks something like this: WeekRegistrations 1 58 2 123 .

How to Group Data by Week in SQL Server

This is additional content for the LearnSQL.com course Customer Behavior Analysis in SQL Server. In this course, we showed you how you can analyze the customer lifecycle (customer acquisition, conversion, activity, retention, and churn) with SQL. We discussed customer registration cohorts, or groups of customers who registered during the same period (e.g. same week, same month). Analyzing customer registration cohorts lets you see registration trends and relate registration cohorts with marketing campaigns.

Types of Database Jobs: Choose One of Them and Start Being Awesome

Do you dream of high earnings and interesting work? Are you fed up with your boss and his or her annoying vacation stories in exotic countries? Is it time to change your job? Why not learn SQL? Here are some examples of the types of database jobs that may lead you to a better life. What types of database jobs use SQL? Here are some examples, but first, a small caveat.

50 Best Resources for Learning SQL in 2020

Do you want to know where to learn SQL? We’ve got you covered with the ultimate list of 50 resources for learning SQL, including the best SQL courses, tutorials, books, and much, much more! Learning SQL can be hard enough without wading through thousands of websites and articles. So, we thought we’d do you a solid and put the top SQL resources here in this handy slice of the internet.

Why Window Functions Are Not Allowed in WHERE Clauses

Window functions are extremely powerful, but there are a lot of nuances and little details you need to learn about using window functions in order to use them correctly and efficiently. A fairly common question SQL users have is why window functions are not allowed in WHERE. TL;DR: You can use window functions in SELECT and ORDER BY. You cannot use window functions in WHERE, GROUP BY, or HAVING.

How to Practice SQL After a Video Course

When you're just starting to learn coding, the most obvious first step is to watch online video courses. They're one of the most popular ways to learn the basics of a new technology without investing a lot of time and money. But you need to do more than that to master the topic. What should be your next step? When someone asks me about how to start learning to code, I often recommend trying video tutorials first.

How to Rank Rows in SQL: A Complete Guide

Don’t struggle with SQL ranking functions anymore! This article will guide you through the most common ranking use cases. Rankings are used around us every day. Sports tournaments, the best movies and TV series on Netflix, stores with the cheapest products—these are only a few examples of rankings you might’ve seen recently. Using SQL RANK functions might be hard sometimes. The variety of different constructions is enormous. You can easily get lost in everything there is to learn about ranking.

How to Practice SQL JOINs

There is no better way to learn SQL joins than through practice. However, there will probably be obstacles along the way. I’ll cover some of these obstacles and give ideas for how to overcome them. While this article won’t turn you into SQL JOINs expert, it will show you how to become one. So, let’s start! Challenges When Practicing SQL JOINs It’s hard to answer “How do you master SQL JOINs?

Stay at Home and Learn SQL for Free with LearnSQL.com

Working remotely is a dream come true for some. You ditch commuting and have more time for the people you love and the things you enjoy. For others, it's a challenge to maintain their focus when there are new distractions. It's also an opportunity to invest the few gained hours in learning something new. Staying at home can be a time when you might find yourself busier than you've ever been, but not getting many things done, and worse, not learning what you planned to.

Video Tutorial or Interactive SQL Course – Which Is Better?

Are you ready to get started with SQL but unsure which learning method is the most effective? In this post, we’ll talk about the pros and cons of learning SQL from an instructional video vs. an interactive online course. Are you a chronic Internet-using student who’s planning to learn SQL? Maybe you did some research but still don’t know which kind of training is worth your (limited) time. We all have families, hobbies, and other after-work commitments, and finding the right resource for learning SQL will save you some time.

The Top 7 Platforms with the Best SQL Courses for 2020

Are you struggling to narrow down which platforms are the best for learning SQL online? We have all been there. I know how confusing it can be when choosing amongst the hundreds of resources available. Find out below which platforms offer the most enriching and seamless SQL learning experiences online. In this article, I will review the platforms with the best online SQL courses offered this year. Whether you are a student looking for your first job, a professional hoping to transition to a data analysis, or an experienced data practitioner, there are plenty of great opportunities to learn SQL online at various levels of technical ability.

Learning SQL? 12 Ways to Practice SQL Online

If you’re currently learning SQL, you may have found yourself knee-deep in reading material and may be wondering how on earth you can bridge the gap between book knowledge and real-life SQL application. In this article, we bring you 12 of the most effective ways to practice SQL online, taking you from a bookworm to a database butterfly in no time at all! All theory and no practice will make you a frustrated SQL user!

How to Stay Healthy When Learning SQL

So, maybe you’re learning SQL. Congratulations! Or maybe you already work as a data analyst, DBA, or data scientist. That’s great too! Either way, you are most likely spending hours in front of a computer. I will give you tips on how to avoid bad habits and take care of your health while learning and/or working with SQL. Have you ever wondered how sitting in front of a computer affects your health?

How to Become an SQL Developer

There is no simple answer to the question “How do you become an SQL developer?” However, if the answer were too complex, there would be no point in writing this article, and yet I’m doing it. So, somewhere along the way, we’ll find the answer. As said in the intro, there is no magic wand that will turn you into an SQL developer. But reading this article will save you some time and help you focus on what is important to achieve your goal.

How Long Does It Take to Learn SQL? Top Tips for SQL Proficiency

Is it hard to learn SQL? How long does SQL mastery take? This article will answer those questions and get you started with the most useful SQL commands. How long does it take to learn SQL? If you’ve ever dabbled in Spanish or French, you know that learning a new language is tough and can take years. Luckily, mastering SQL is a much faster journey than conquering por/para or un, deux, trois.

HAVING vs. WHERE in SQL: What You Should Know

This article is about SQL’s WHERE and HAVING clauses. Both clauses are part of the foundations of the SQL SELECT command. They have similar uses, but there are also important differences that every person who uses SQL should know. Let’s see what’s behind the HAVING vs. WHERE debate. In this article, we’ll suppose we work for a government social agency supporting people or families whose income is below a certain threshold.

19 Top SQL Articles for Beginners Published in 2019

In 2019, a lot of new SQL articles were written for beginners. This kind of resource is useful not only for professionals. SQL articles allow you to develop skills, expand your knowledge, and use SQL in practice. They are a very good way to learn SQL. In this post, I gathered 19 top SQL articles of 2019. Let’s also learn SQL from articles! List of Top SQL Articles Published in 2019 We will start with five of the best articles published on the LearnSQL.

How to Practice SQL

Do you already know what SQL aggregation functions are, what JOINs are, and how i“group by” is different than“order by”? Great, congratulations. But don't you think that in order to master SQL and be able to apply it, you need to practice? We advise you on how to practice SQL to prepare for a data analyst job interview or to simply boost your knowledge effectively. Because, as they say, SQL practice makes perfect.

SQL INSERT, SQL UPDATE, SQL DELETE – Oh My!

Need to understand SQL INSERT, UPDATE, or DELETE? We'll get you up to speed with a comprehensive How-To and useful examples! SQL INSERT, UPDATE, and DELETE statements—what are they all about? If you're a data engineer, a database administrator, or even just your average data fanboy or girl, one day you're going to find yourself with a database that becomes your "baby." Charged with this special bundle of joy, you're going to need to feed and change the little fella.

SQL, Databases, and Hollywood Movies

Policemen, doctors, lawyers, scientists, teachers: These are the professions that we often see in Hollywood movies. But are movies also trying to show what the work of data analysts looks like? Here is a list of six movies in which screenwriters, directors, and producers decided to cast SQL and databases in the main roles. Data analysis is most often associated with business, reporting, and making key decisions for the company.

Difference between GROUP BY and ORDER BY in Simple Words

For someone who is learning SQL, one of the most common places to get stuck is when learning the GROUP BY command. GROUP BY and ORDER BY are two important keywords in SQL that we use to organize data. The difference between GROUP BY and ORDER BY is that ORDER BY is more simple than GROUP BY and is usually introduced early in an SQL course. Sometimes, people are quite confused over these two concepts (SQL ORDER BY vs.

Join us on Facebook–We Can Learn More Together

We are so happy that you have joined us to learn and develop your SQL skills! We want to invite you to a new Facebook group, We Learn SQL. It is a great place for anyone interested in meeting like-minded people who also want to learn about database-related concepts. Learning together is easier, don't you think? Joining this group is a great opportunity to begin sharing your learning experiences with others.

Grouping Data in SQL Server

People who work with data know that data grouping can sometimes be a chore. If you struggle and waste hours with Excel, OpenOffice, or some other tool trying to group various sets of data, take a look at this article and learn how to do the work much quicker and easier by using SQL. You often find yourself in a situation where you need to analyze data and present the results in a form other than the one in which the data is stored.

SQL Order of Operations

SQL is not a traditional programming language in which you write a sequence of instructions in a given order of execution. Instead, SQL is a "declarative" language, which means that by writing a SQL query, you declare what data you expect as a result of the query, but you don't indicate how to obtain it. Six Operations to Order: SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY By using examples, we will explain the execution order of the six most common operations or pieces in an SQL query.

The Most Important SQL Queries for Beginners

How do you get data from a table? How do you create or delete a table? How do you display distinct records? How do you select rows which store a specific value in a column? You can easily do all of this by writing basic SQL queries. This guide discusses the 30 most important SQL queries for beginners. Let's take a look. 1. Retrieving Data From All Columns This is a very basic query to display all data from a table.

YouTube Tutorials That Actually Teach You Some SQL

YouTube is not just funny cats, music clips, and viral videos. It can also be a mine of knowledge – if you know where to look. Can YouTube tutorials really help you learn SQL? Let's say you're a marketer or an accountant. You work with databases every day. But when it’s time to write a query and get specific data, you need to call someone from IT. Why not learn to do it yourself?

24 Rules to the SQL Formatting Standard

Writing queries to a database requires knowledge about SQL syntax, but this is not all you should know. Best practices for writing professional SQL code require good formatting skills. In this article I discuss why this is so important and what are the basic rules you should follow. Why is it Worthwhile to Format SQL Code? Beginner SQL programmers often don't pay much attention to formatting their code. If you think formatting is something that can be safely ignored, look at the code below:

SQL INNER JOIN Explained in Simple Words

In this article, I will cover perhaps the most important element of the SQL language. That's right! I'm talking about the SQL INNER JOIN clause. As you know, in a database the data are stored in several tables. In my last article, I covered how to create SQL queries when the data you need is in only one table. But what if the data you need is in two tables?

Forget About Excel, High Five With SQL

Find out why you should forget about Excel and start using SQL even if you're not an IT expert. We'll show you how easy it is to learn SQL, how it can make you work better, and how LearnSQL.com makes the learning process fun. "I Don't Deal With Data" We frequently hear the sentence above from people outside the IT industry. Well, it's not entirely true. Data is now almost everywhere.

14 Differences Between Standard SQL and Transact-SQL

In my last article, I roughly described how standard SQL differs from T-SQL and who should learn which. Now I'd like to focus on the syntax differences and illustrate these differences with examples. If you think T-SQL is an extension implementing all the features from standard SQL, you aren't right. However, in SQL Server you will find almost all the features of the SQL standard. In this article you will find examples of some of the differences in syntax between standard SQL and Transact-SQL.

Get to Know the Power of SQL Recursive Queries

Level: Advanced -- Most commonly, the SQL queries we run on a database are quite simple. Well, that depends on your role, of course. Analysts in data warehouses retrieve completely different sorts of information using (very often) much more complicated queries than software engineers creating CRUD applications. However, sometimes it's simpler or more elegant to run a query that is a little bit more sophisticated without needing further data processing in the code.

What's the Difference Between SQL and T-SQL?

If you are beginning to learn SQL and are confused by the differences between standard SQL and other similar languages like T-SQL, this article will help make things clear. You’ll not only learn about the difference between SQL and T-SQL but also find explanations concerning which topics would be better to start learning first: standard SQL or something more specific like MS SQL Server. What is Standard SQL? SQL (Structured Query Language) is a basic ANSI/ISO standard programming language designed to operate on data stored in relational databases.

Microsoft SQL Server Pros and Cons

Thinking about using Microsoft SQL Server? If so, you’re in the right place. In this article, we’ll go over the pros and cons of Microsoft SQL Server and evaluate the platform from both a company’s and a data specialist’s perspective. What Is Microsoft SQL Server? Before diving into the pros and cons of Microsoft SQL Server, I’ll explain what it is. In technical terms, it is a relational database management system (RDBMS) developed by Microsoft.

How to Install PostgreSQL on Windows 10 in 5 Minutes

It may look like a complicated task to install PostgreSQL, Oracle, or SQL Server or any other database software, but it really isn’t! These days, most relational database management systems come with installation wizards that make the process much simpler. In this article, we’ll look at how to install PostgreSQL and test that the installation is working. Install PostgreSQL: Steps Involved To install PostgreSQL, we’ll complete the following tasks:

How SQL supports data-driven organization

Typical business users make decisions based on gut feelings, but this can't get them so far. In this article, we'll look at how learning to write basic SQL queries helps your company become a data-driven organization. Businesses face many decisions. Do we increase our advertising budget in one region or the other? Are certain products selling quickly enough? What we should do if they aren't? Most of these decisions are driven by intuition, but organizations that make the most business impact use data-driven decision-making.

Microsoft SQL Server 2017 Installation Step by Step

-- -- Microsoft SQL Server is one of the most popular professional database servers on the market. In this guide, I’ll show you all SQL Server 2017 installation steps to help you install it on the Windows operating system together with SQL Management Studio. How to Install Microsoft SQL Server 2017 In this guide, I’ll show you the SQL Server 2017 installation step by step.

How to Begin Running SQL Queries

In this article, I’ll explain how to run a SQL query to help you execute your first one. Let’s jump right in! Running SQL queries for the first time is not a complex task, but it can seem intimidating at first if you’re a complete beginner. But once you get past that initial roadblock, you’ll be able to focus on learning SQL and writing more interesting queries to meet your business needs.

Our Picks for 2020’s 7 Best Online SQL Schools

If you’re looking for the best online SQL courses but aren’t sure where to start, you’re in the right place. I evaluated the top 7 ranked SQL schools available online to help you find the right solution. While summer is a great time to relax and get away from work, it’s also an excellent opportunity to learn new skills – like SQL! Thanks to SQL schools putting their courses on the internet, learning new tech skills is super easy and you can choose from a variety of formats to suit your needs.

Here’s Why You Should Learn SQL

Why learn SQL? We asked our users about it. This is what we’ve learned. At LearnSQL.com, we help people with no computer science background to understand the core concepts of databases and data science. For example, we teach users how to extract the most important data from a database to build simple reports and how to understand key statistical metrics in data analysis. We love to provide easy-to-understand examples that thoroughly depict complex technical concepts.

5 Great Benefits of Learning SQL

If you want your business to succeed in 2017, it’s absolutely critical that you understand your data; this is why you should get acquainted with SQL ASAP. But there are other reasons to learn it that may not be obvious. In this article, I’ll show you 5 huge benefits of learning SQL! Don’t fall for the common trap—analyzing data isn’t just a concern for those competing at national or corporate levels.

LearnSQL.com Review: “SQL Cookbook” by Anthony Molinaro

Recipes that make querying easy, even for the novice. In today’s information age, we have at our fingertips almost an overabundance of teaching and information on any and every subject. In the midst of this glut of information, it can be hard to decide which is the best source for our needs. But, fear not; we are here to assist you as you navigate through decisions about books on SQL topics!

Tag: Left join

How to LEFT JOIN Multiple Tables in SQL

Can you LEFT JOIN three tables in SQL? Yes, indeed! You can use multiple LEFT JOINs in one query if needed for your analysis. In this article, I will go through some examples to demonstrate how to LEFT JOIN multiple tables in SQL and how to avoid some common pitfalls when doing so. What Is a LEFT JOIN? Let’s start by reminding ourselves what a LEFT JOIN is and how to use it.

Tag: Like

How to Use LIKE in SQL: SQL Pattern Matching

SQL pattern matching is a very important and useful ability. In this article, we look at how you can perform it using LIKE in SQL. -- SQL Pattern matching is a very simple concept. It allows you to search strings and substrings and find certain characters or groups of characters. Apart from SQL, this operation can be performed in many other programming languages. In this article, we’ll examine how you can use LIKE in SQL to search substrings.

Tag: Marketing

Are There Any Good SQL Courses for Marketers?

Looking for places to learn SQL online and level up your marketing efforts? Check out these SQL courses. Introduction With the help of IT experts, meticulous marketers analyze information to create advertising strategies. This commonplace state of affairs forces the marketer to rely on data experts and sometimes wait for their availability. But what if marketers could pull the data themselves? They can – by turning into a technical marketer.

Tag: Masking nulls

Useful SQL Patterns: Matching Nulls by Masking Nulls

As you start coding in SQL, you will use some statements and techniques over and over again. We call these “SQL patterns”. This series will look at the most common SQL patterns and consider how to use them. In database development, SQL developers often find themselves returning to the same SQL statements. Learning about these now, early in your SQL journey, will help you work more efficiently. Today, in the first post of this series, we will consider the match by null SQL pattern related to SQL data matching.

Understanding the Use of NULL in SQL Three-Valued Logic

NULLs are necessary in relational databases, and learning to use them is fundamental to SQL success. However, NULLs should also be handled with care, as we explain in this post. In relational databases, we don’t always have a value to put in a column. For example, suppose we have a table called “persons” that has “first_name”, “last_name”, “birth_date” and “marriage_date” columns. What value will we store in the “marriage_date” column for single persons?

Tag: Matching nulls

Useful SQL Patterns: Matching Nulls by Masking Nulls

As you start coding in SQL, you will use some statements and techniques over and over again. We call these “SQL patterns”. This series will look at the most common SQL patterns and consider how to use them. In database development, SQL developers often find themselves returning to the same SQL statements. Learning about these now, early in your SQL journey, will help you work more efficiently. Today, in the first post of this series, we will consider the match by null SQL pattern related to SQL data matching.

Understanding the Use of NULL in SQL Three-Valued Logic

NULLs are necessary in relational databases, and learning to use them is fundamental to SQL success. However, NULLs should also be handled with care, as we explain in this post. In relational databases, we don’t always have a value to put in a column. For example, suppose we have a table called “persons” that has “first_name”, “last_name”, “birth_date” and “marriage_date” columns. What value will we store in the “marriage_date” column for single persons?

Tag: Matching patterns in sql

How to Use LIKE in SQL: SQL Pattern Matching

SQL pattern matching is a very important and useful ability. In this article, we look at how you can perform it using LIKE in SQL. -- SQL Pattern matching is a very simple concept. It allows you to search strings and substrings and find certain characters or groups of characters. Apart from SQL, this operation can be performed in many other programming languages. In this article, we’ll examine how you can use LIKE in SQL to search substrings.

Tag: Miscellaneous functions

18 Useful Important SQL Functions to Learn ASAP

Beginning with SQL: Useful Functions to Master Learning a new programming language can seem intimidating. Like any other language, a programming language has a large vocabulary that you need to master. In this article, we'll look at some of the most useful SQL functions that you need to know. There are many useful SQL functions for working with different data types. Once you practice with some of the most common ones, you'll gain enough confidence to move on to more advanced material.

Tag: Molinaro

LearnSQL.com Review: “SQL Cookbook” by Anthony Molinaro

Recipes that make querying easy, even for the novice. In today’s information age, we have at our fingertips almost an overabundance of teaching and information on any and every subject. In the midst of this glut of information, it can be hard to decide which is the best source for our needs. But, fear not; we are here to assist you as you navigate through decisions about books on SQL topics!

Tag: Ms sql server

14 Differences Between Standard SQL and Transact-SQL

In my last article, I roughly described how standard SQL differs from T-SQL and who should learn which. Now I'd like to focus on the syntax differences and illustrate these differences with examples. If you think T-SQL is an extension implementing all the features from standard SQL, you aren't right. However, in SQL Server you will find almost all the features of the SQL standard. In this article you will find examples of some of the differences in syntax between standard SQL and Transact-SQL.

What's the Difference Between SQL and T-SQL?

If you are beginning to learn SQL and are confused by the differences between standard SQL and other similar languages like T-SQL, this article will help make things clear. You’ll not only learn about the difference between SQL and T-SQL but also find explanations concerning which topics would be better to start learning first: standard SQL or something more specific like MS SQL Server. What is Standard SQL? SQL (Structured Query Language) is a basic ANSI/ISO standard programming language designed to operate on data stored in relational databases.

Microsoft SQL Server Pros and Cons

Thinking about using Microsoft SQL Server? If so, you’re in the right place. In this article, we’ll go over the pros and cons of Microsoft SQL Server and evaluate the platform from both a company’s and a data specialist’s perspective. What Is Microsoft SQL Server? Before diving into the pros and cons of Microsoft SQL Server, I’ll explain what it is. In technical terms, it is a relational database management system (RDBMS) developed by Microsoft.

Microsoft SQL Server 2017 Installation Step by Step

-- -- Microsoft SQL Server is one of the most popular professional database servers on the market. In this guide, I’ll show you all SQL Server 2017 installation steps to help you install it on the Windows operating system together with SQL Management Studio. How to Install Microsoft SQL Server 2017 In this guide, I’ll show you the SQL Server 2017 installation step by step.

Finding Maximum Values in Rows

Problem: You want to find which rows store the largest numeric value in a given column. Example: Our database has a table named student with data in the following columns: id, first_name, last_name, and grade. idfirst_namelast_namegrade 1LisaJackson3 2GaryLarry5 3TomMichelin2 4MartinBarker2 5EllieBlack5 6MarySimpson4 Let’s find the students who have the highest grades.

How to Count Distinct Values in SQL

Problem: You’d like to count how many different non-NULL values there are in a given column. Example: Our database has a table named customer with data in the following columns: id, first_name, last_name, and city. idfirst_namelast_namecity 1JohnWilliamsChicago 2TomBrownAustin 3LucyMillerChicago 4EllieSmithDallas 5BrianJonesAustin 6AllanDavisNULL Let’s find the number of different (and non-NULL) cities.

How to Count the Number of Rows in a Table in SQL

Problem: You’d like to determine how many rows a table has. Example: Our database has a table named pet with data in the following columns: id, eID (electronic identifier), and name. ideIDname 123456sparky 223457mily 3NULLlessy 4NULLcarl 534545maggy Let’s count all rows in the table. Solution: COUNT(*) counts the total number of rows in the table:

How to Eliminate Duplicate Rows in SQL

Problem: You’d like to eliminate any duplicate rows from the result set of a query so that each row appears only once. Example: Our database has a table named clothes with data in the following columns: id, name, color, and year_produced. idnamecoloryear_produced 1T-shirtyellow2015 2jacketblue2016 3jeansblack2015 4jacketblue2015 5jacketgreen2016 6jacketyellow2017 7hatyellow2017 Let’s get the non-repeated names and colors of clothes produced before 2017.

How to Filter Records with Aggregate Function AVG

Problem: You want to find groups of rows in which the average of values in a column is higher or lower than a given value. Example: Our database has a table named product with data in the following columns: id, name, grocery and price. idnamegroceryprice 1milkGreen Shop2.34 2breadClark’s Grocery3.56 3breadSuper Market4.15 4milkSuper Market1.80 5breadGrocery Amanda2.26 6milkViolet Grocery3.

How to Filter Records with Aggregate Function COUNT

Problem: You want to find groups of rows with a specific number of entries in a group. Example: Our database has a table named product with data in the following columns: id, name and category. idnamecategory 1sofafurniture 2glovesclothing 3T-Shirtclothing 4chairfurniture 5deskfurniture 6watchelectronics 7armchairfurniture 8skirtclothing 9radio receiverelectronics Let’s find the category of products with more than two entries.

How to Filter Records with Aggregate Function SUM

Problem: You need to find rows in which groups have a sum of values in one column less than a given value. Example: Our database has a table named company with data in the following columns: id, department, first_name, last_name, and salary. iddepartmentfirst_namelast_namesalary 1marketingLoraBrown2300 2financeJohnJackson3200 3marketingMichaelThomson1270 4productionTonyMiller6500 5productionSallyGreen2500 6financeOlivierBlack3450 7productionJenifferMichelin2800 8marketingJeremyLorson3600 9marketingLouisSmith4200 Let’s find the names of departments that have sums of salaries of its employees less than 7000.

How to Filter Rows without NULL in a column

Problem: You want to find records without a NULL in a column. Example: Our database has a table named product with data in three columns: id, name, and price. idnameprice 1butterNULL 2milk2.35 3bread3.25 4cheeseNULL Let’s find the names and prices of products that have a price (without a NULL). Do this by using the IS NOT NULL operator.

How to Find Duplicate Rows in SQL?

Problem: You have duplicate rows in your table, with only the IDs being unique. How do you find those duplicate entries? Example: Our database has a table named product with data in the following columns: id, name, and category. idnamecategory 1steakmeat 2cakesweets 3dsteakmeat 4porkmeat 5cakesweets 6cakesweets Let’s find duplicate names and categories of products.

How to Find Minimum Values in Columns

Problem: You want to find rows that store the smallest numeric value in a column. Example: Our database has a table named weather with data in the following columns: id, city, and temperature. idcitytemperature 1Houston23 2Atlanta20 3Boston15 4Cleveland15 5Dallas34 6Austin28 Here’s how to find cities with the lowest temperature.

How to Find Records with NULL in a Column

Problem: You want to find records with NULL in a column. Example: Our database has a table named children with data in four columns: id, first_name, middle_name, and last_name. idfirst_namemiddle_namelast_name 1JohnCarlJackson 2TomNULLThomson 3LisaAliceNULL 4AnneNULLSmith Let’s find the id, first name, and last name of children without a middle name (NULL in column middle_name). We use the IS NULL operator for this. Solution: SELECT id, first_name, last_name FROM children WHERE middle_name IS NULL; Here’s the result:

How to Find the Maximum Value of a Numeric Column in SQL

Problem: You’d like to find the maximum value of a numeric column. Example: Our database has a table named product with data in the following columns: id, name, year, and items. idnameyearitems 1bread roll2018345 2chocolate2017123 3butter201934 4bread roll2019456 5butter201856 6butter201778 7chocolate201987 8chocolate201876 Let’s find the maximum number of items sold over all years.

How to Find the Minimum Value of a Column in SQL

Problem: You’d like to find the smallest numeric value in a column. Example: Our database has a table named employment with data in the following columns: id, first_name, last_name, department, and salary. idfirst_namelast_namedepartmentsalary 1EllieMartinesmarketing1200 2MartinJohnsonfinance2300 3MichaelJacobsproduction1100 4StephenKowalskimarketing4300 5StanleyMillermarketing3500 6JenyBrownfinance5000 7MargaretGreenmarketing1500 8LisaThomasproduction2800 Let’s find the lowest salary among all employees.

How to Handle Divide by Zero In SQL

Problem: You want to perform division in your SQL query, but the denominator is an expression that can be zero. The database will give you an error when the denominator is in fact zero. Example: Our database has a table named investor_data with data in the following columns: id, investor_year, price_per_share, income, and expenses. idinvestor_yearprice_per_shareincomeexpenses 120162032002300 2201713020002000 3201840200100 420191559004900 Let’s divide the price per share by the difference between income and expenses to determine the P/E ratio (price-earnings ratio) for each year.

How to Join Multiple (3+) Tables in One Statement

Problem: You’d like to combine data from more than two tables using only one SELECT statement. Example: There are four tables in our database: student, teacher, subject, and learning. The student table contains data in the following columns: id, first_name, and last_name. idfirst_namelast_name 1TomMiller 2JohnSpring 3LisaWilliams 4EllieBarker 5JamesMoore The teacher table contains data in the following columns: id, first_name, last_name, and subject.

How to Join on Multiple Columns

Problem: You want to join tables on multiple columns by using a primary compound key in one table and a foreign compound key in another. Example: Our database has three tables named student, enrollment, and payment. The student table has data in the following columns: id (primary key), first_name, and last_name. idfirst_namelast_name