Day 6 | SQL Interview Questions: SQL Joins | Product Sales Analysis | LeetCode Problem

Опубликовано: 26 Декабрь 2024
на канале: Your Analyst
96
8

This particular problem can be found on Leetcode SQL study plan
The link for the same is added here:-
https://leetcode.com/problems/product...
Link for the study plan:
https://leetcode.com/studyplan/top-sq...


In case you want to check the previous videos, you can check here:-
Day5:    • Day 5 | SQL Interview Question | Find...  
Day4:    • Day 4 | SQL Interview Question | Leet...  
Day 3:    • Day 3 | SQL interview Question | Leet...  
Day 2:    • Day 2 Mastering SQL Queries | LeetCod...  
Day 1:    • Day 1: Mastering SQL Queries | LeetCo...  


SQL
LeetCode
Joins
SQL Tutorial
SQL Problem Solving
NOT IN Operator
Distinct
Order By
SQL Query Optimization
Database Management
Data Analysis
SQL Tips and Tricks
Programming Challenges
SQL Mastery
Technical Skills
Data Manipulation

#sql #leetcode #productsales #sal#etweets #sqlserver
#analytics #dataanalytics #technology
#coding #computerscience #datascience #data
#sqltutorial #sqlforbeginners #salesanalytics #productsalesanalysis

tags: product sales analysis i leetcode, SQL, MYSQL, SQL query, SQL tutorial, SQL for beginners, create table in SQL, SQL server, SQL database, datascience, data analytics, business analytics, Excel tips, SQL tips, SQL interview questions, SQL interview preparation, SQL hacks, Excel to SQL, product sales analysis, product analytics, product analysis, solve leetcode problem


Table: Sales

+-------------+-------+
| Column Name | Type |
+-------------+-------+
| sale_id | int |
| product_id | int |
| year | int |
| quantity | int |
| price | int |
+-------------+-------+
(sale_id, year) is the primary key (combination of columns with unique values) of this table.
product_id is a foreign key (reference column) to Product table.
Each row of this table shows a sale on the product product_id in a certain year.
Note that the price is per unit.


Table: Product

+--------------+---------+
| Column Name | Type |
+--------------+---------+
| product_id | int |
| product_name | varchar |
+--------------+---------+
product_id is the primary key (column with unique values) of this table.
Each row of this table indicates the product name of each product.


Write a solution to report the product_name, year, and price for each sale_id in the Sales table.

Return the resulting table in any order.