Back to articles list Articles Cookbook
6 minutes read

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.

Let's start at the beginning. We will talk about revenue analysis. Is it an accounting issue?

Yes, revenue trends are vital for accounting, but they are also important for all departments within a company. They are critical for the finance department. To the marketing department, they show which marketing campaigns are the most successful. They are important to the sales department, because they can reveal whether sales efforts are actually bringing revenue. Revenue trends are also indispensable for product managers; looking into the details of revenue trends shows which products bring the most money, which new products and features are getting popular, etc. Revenue trends are important for the operations department to understand, too.

Basically, the knowledge of revenue trends helps make informed business decisions throughout the entire company.

So, it's all about SQL reporting. Can you give a practical example of using SQL reports?

There are a number of standard revenue reports used in finance. One common report is the total revenue in a given period of time such as a month or a year. Another common report type is month-to-date (MTD) or year-to-date (YTD) revenue which is the total revenue earned in the current month or year so far. Next we have month-over-month, quarter-over-quarter, or year-over-year reports which compare revenue in the current month, quarter, or year against the previous month, quarter, or year. This report lets you check if your revenue is growing or declining, or if there are any seasonal trends in your revenue.

Of course, each of these reports can be prepared not just at the company level but also for each category of products or services and even for each individual product. You can also compare revenue from different products or categories. These reports help you see how well your business is doing to help you make business decisions.

In our course, we teach you how to prepare these reports in SQL. You can prepare them for whatever period and level of detail you need, be it for a single product feature, a single product, or an entire category of products. All of these deal with trends over time, so you can modify the queries easily to analyze other business metrics.

Does it mean that almost all companies need an analysis like this?

Absolutely! All companies need to look at their past results and forecast their future results. Revenue may not be the best metric for certain situations, but you can easily modify the SQL queries from the course to compute other business metrics that are more relevant for you. Maybe it’s the number of user registrations, the volume of transactions, the number of bookings, or the count of feature requests.

I imagine that many entrepreneurs can use Excel for revenue analysis. Why would they start doing this with SQL?

The knowledge of SQL allows you to work with raw data. This means you can work at whatever level of detail you need at any time. Maybe you want to keep track of a single product, a whole category of products, or the whole company. Maybe you want to compare different categories or products against each other. Learning SQL allows you to do all these things with ease.

With SQL and the access to your sales database, you no longer depend on your IT department to prepare a report for you. No more waiting for a report! Generating SQL reports yourself is also more flexible: if you don’t like the way it looks, or if you want to include more information, you can modify the report yourself.

What topics does this course cover? What will I learn? How long does it take?

We estimate it will take about 10 hours to complete this course. It is focused on the types of reports you can prepare. First, you learn how to compute revenue for different time periods: the current month, some other month, month-to-date, etc. Next, you learn how to compare revenue between time periods: consecutive months or years, a given month/quarter in the current year with the corresponding period from another year, and the difference and the percentage change between the two periods. Finally, you learn how to apply these report types to different levels of detail, such as product categories or individual products.

We use these techniques for analyzing revenue trends, but you can apply the same techniques on other business metrics. We carefully explain how to build each SQL query. The goal of the course is not to get you to memorize the query but rather to arm you with the knowledge so that you can build it yourself.

SQL reporting

This course is part of our SQL Reporting track, designed for people who need to use SQL in a business context to prepare reports. The first course in the track is Creating Basic SQL Reports, which gives you the foundations for creating reports in SQL. (We talked about this course in May.) The second course is this month’s Analyzing Revenue Trends in SQL. We’re still working on one more course in this track, which will be about analyzing customer behavior with SQL reports.

Who should take this course?

This course is perfect for anyone doing data analysis in SQL, especially those who need to do time trend analysis in SQL. I recommend this course to data analysts, financial analysts, marketing specialists, sales managers, product managers, operations managers, and anyone who needs to make business decisions based on past trends. If you're one of them, don't hesitate any longer and start learning today.

Will I receive a certificate to post on my LinkedIn profile?

Yes. As with all of our courses, users who complete the course will receive a certificate that they can upload to their LinkedIn profiles.

You are Vertabelo’s Chief Content Officer. This means you’re involved in the creation of all courses on What do you remember about working on this course?

This is a fairly new course, so I remember working on it very well. After creating the courses in our complete SQL From A to Z track, we wanted to focus on developing courses that would help our users create reports in a realistic business context. This is how we came up with the idea for the SQL Reporting track.

We were looking for reports that are useful in all kinds of businesses. Revenue is the most important metric for many businesses, so we decided to prepare a SQL course on revenue trends analysis. The queries introduced in this course can be translated easily for use in other businesses and in analyzing other trends over time.

The biggest challenge in creating this SQL course was finding a suitable data set. We wanted a data set that would be easily understandable by the users regardless of their experience, that could be adapted to other business domains easily, and that was not too overwhelming or complex. We landed on Northwind, a sample Microsoft database for a simple store, as a starting point then adapted it quite a bit for our course.