Mastering the COUNT Function

Introduction and Overview

Welcome to the first lesson of the course "Mastering the COUNT Function". In this introductory lesson, you will learn about the SQL COUNT function and how it is used to perform quantitative analysis on datasets, specifically in the context of an online shopping platform.

SQL, or Structured Query Language, is a powerful tool for querying and managing data in relational databases. It is widely used in data analysis, business intelligence, and various other fields for retrieving meaningful insights from data.

What You Will Learn

In this lesson, you will:

  • Understand what the COUNT function does.
  • Learn the basic syntax of the COUNT function.
  • See an example of counting rows in a table.
  • Apply the COUNT function in a real-world context, using online shopping analytics as an example.

By the end of this lesson, you will be able to use the COUNT function to obtain quantitative insights from a dataset.

Dataset Introduction

In case you haven't done any of our other courses using this dataset, here is a quick overview for you. Below are some sample rows to give you an idea of the structure starting from the simplest table:

Categories Table

category_idcategory_name
1Flashcards
2Worksheets
3Guides
4Podcasts
5Courses

This table lists the five product categories available on the platform.

Customers Table

customer_idcustomer_name
1John Doe
2Jane Smith

This table provides details about the customers using the platform.

Products Table:

product_idproduct_nameproduct_pricecategory_id
1Vocabulary Flashcards9.341
2Math Problems Flashcards12.841

The Products table lists products available in the online store.

Orders Table:

order_idcustomer_idorder_dateorder_status
1412021-08-17Delivered
2162022-04-03Processed

The Orders table contains details of customer orders, including the order date and status.

OrderItems Table:

order_item_idorder_idproduct_idextended_support
11250
22120

The OrderItems table includes information about each item in an order, such as the order it belongs to, the product, and whether it has support.

Sign up

Join the 1M+ learners on CodeSignal

Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal