This project was completed as part of a Data Technician bootcamp, focusing on developing core SQL skills to extract, analyse, and interpret insights from retail and sales datasets.
Using SQL, I explored the northwind database. The project involved writing and optimizing queries to simulate answering real-world business questions, such as filtering by countries, employee data, and joining different tables.
- Writing queries using
SELECT
,WHERE
,ORDER BY
, andGROUP BY
- Merging tables using the
JOIN
function to combine data across multiple sources - Filtering and sorting data to highlight key insights
- Aggregating data to calculate totals, averages, and other metrics
- Interpreting query results to support data-driven decision-making
The first thing I did was explore the data, pulling all info from a table before eventually exploring specific columns. The first step for this is to use the SELECT
and FROM
functions. *
is a quick way of selecting all the columns from a table.



Using the DISTINCT
function I could then see specific values in certain columns such as the differnt countries within the data.

This can be combined with the COUNT
function in order to just show the number of unique values in a column.

Filtering was then the next step, using WHERE
can easily make only the required data in the columns appear.

Combined with the COUNT
function again here is an exmaple of quickly seeing the number of customers located in the USA.


You can use multiple filters either pulling more info with the OR
or refine down the data even more using AND
where all requirements must be met.


NOT
can also be used to exclude data.

The ORDER BY
function is used to arrange the data in a table.


If only a certain amount of data needs to be shown either for top results or just to check the prompt use has worked as intended, LIMIT
can be used.

min()
and max()
can be used on columns within a table.


Below are also examples of avg
for an average and sum
for a total.


It is possible to search and filter results based upon partial match to string data within the rows. The LIKE
function makes it easy to scan data and %
is used to represent any string.



_
is wildcard and is a way of denoting a character in the function, this means that you can specify a certain number or certain length of a string you are searching for without knowing what letters there actually are.

IN
can also be used if all of the variables are in the same column.


There is also a way to search a range just using the BETWEEN
and AND
function.

There is a way to only pull data from one table based upon details present in another, this is done with a sub query.

However, there is a function JOIN
which allows you to merge two tables and show all of the data connected into one place.

When merging all data NULL
values can be present.


If you wish to use aggregate functions such as count
and sum
within table results the GROUP BY
function must be used.
