0% found this document useful (0 votes)
2 views

sql

Parch and Posey is a company that sells three types of paper and has accumulated data over several years stored in four CSV files. As a data analyst, the task is to analyze this data to provide insights for the management and answer specific questions from various departments. Key components of the dataset include customer accounts, web events, sales representatives, and orders, with a focus on SQL operations and functions for data retrieval and analysis.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

sql

Parch and Posey is a company that sells three types of paper and has accumulated data over several years stored in four CSV files. As a data analyst, the task is to analyze this data to provide insights for the management and answer specific questions from various departments. Key components of the dataset include customer accounts, web events, sales representatives, and orders, with a focus on SQL operations and functions for data retrieval and analysis.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Parch and Posey is a comapny that sells 3 paper types

(standard, gloss, poster). The company's data is


accumulated for the several years and stored in 4 csv
files ; orders, accounts, sales_persons and regions. As a
data analyst you are required to help the management
to make informed decisions by analyzing the the data
and generate business insights. The management wants
to acquire general knowledge of the data, and get
answers for specific questions from the departments of
Sales & Marketing, HR and Finance.

- Customer Accounts represent clients(company) who buy paper products


from the company. These clients could be individuals, businesses, or
organizations purchasing items like standard paper, posters, or glossy
paper.
- Web Events in the context of the Parch & Posey
Business Dataset represent online interactions or
activities related to customer accounts on the
company’s digital platforms. These events are
tracked to understand how customers engage with
the company’s website, marketing efforts, or
online services.

- Sales Representatives (or sales_reps) in the Parch


& Posey Business Dataset represent the employees
of the company responsible for managing customer
accounts, building relationships, and driving sales.
They are the direct link between the company and its
customers, ensuring that the clients’ needs are met
and that sales targets are achieved.

- The Orders table in the Parch & Posey Business Dataset contains detailed
information about purchases made by customer accounts. It tracks every
order, including the quantity and total sales amounts for the various types of
paper products.

Applay (inner join – left join – right join – full outer


join )
Select statement

 A SELECT statement in SQL is used to retrieve data from a database. Here's a


basic example:
Multiple orders :
Limit :

Limit with offset

Logical operations :
And , Not , OR , Between , like , not like , not in
AND

OR
Not

Between

Like

Not like
NOT IN

 SQL Aggregation Functions on the Table


✅ Aggregation with GROUP BY - Total Salary by Department
✅ Having

✅ Distinct
Difference between unique, Distinct

✅ Case Sql
✅ SubQuery
✅ SQL String Functions: LEFT(), RIGHT(), and POSITION()
✅ Concat

Upper() , Lower() , Replace()


✅ COALESCE()
✅ JOIN

Inner join (join) , left join , right join , outer join


✅ JOIN Union vs Union All
✅ Intersect
✅ REVERSE() and SUBSTRING()
✅ Window Function

ROW_NUMBER()
RANK()

DENSE_RANK()

Sum()
Avg()

Without Order by ()
LAG() , LEAD()

You might also like