Advanced tasks

Advanced SQL Tasks

Task #1: Top 3 Best-Selling Books for Each Genre

This task aims to uncover the most popular titles within each genre, offering valuable insights into customer preferences and market trends. By highlighting the top sellers across various categories, the bookstore can tailor its inventory and marketing strategies to meet customer demand effectively.

Objective: Identify the top three best-selling books in each literary genre at your bookstore, such as mystery, romance, or science fiction.

Expected Result: A list of the top three best-selling books for each genre, including their titles, genres, total sales, and sales rank within the genre.

Data Source: dataacademykz.bookstore.{table_name}

 

Task #2: Creating a Pivot Table of Customer Age Groups Split by Order Year

In this task, we'll utilize the PIVOT function in Google BigQuery, which is akin to creating pivot tables in Excel. The pivot table will arrange customers into age groups across columns while breaking down these groups by order year in rows.

Objective: Develop a pivot table in Google BigQuery that categorizes customers into different age groups and analyzes these groups based on the year they placed orders. This task is aimed at understanding customer behavior across various age demographics over time.

Expected Result: A pivot table that displays the distribution of customer orders across different age groups for each order year, providing insights into the purchasing patterns of various age demographics over time.

Note: For example, in 2020 customers aged 18-30 made 128 orders in total

Data Source: dataacademykz.bookstore.{table_name}

 

Task #3: Analyzing authors' contributions to total genre sales

This task involves analyzing how much each author's books contribute to the total sales of their genre. By determining the percentage of genre sales attributable to each author, we can identify key contributors and understand their impact on the genre's market performance.

Objective: Evaluate the contribution of each author to the total sales within their respective book genres.

Expected Result: A detailed analysis showing each author's contribution to the total sales of their book genre, expressed as a percentage of the genre's total sales.

Data Source: dataacademykz.bookstore.{table_name}