Phone cases and screen protectors
A phone shop looks at its sales. Nobody asked a question. But a computer finds something: people who buy a phone case often buy a screen protector in the same week.
Now the shop puts the screen protectors next to the cases. Sales go up. This is what happens when a business learns from its data.
Key words
| Word | What it means | Example |
|---|---|---|
| Data mining | Searching a large amount of data for patterns nobody asked for. | Cases and screen protectors are bought together |
| Reporting | Answering known questions on a regular schedule. | Sales each month |
| Business intelligence | Using data to help a business decide. | Which shop should open late? |
| Financial planning and analysis | Using data to plan money: a budget (a plan for money), costs and a forecast (a guess about next year). | What will we earn next year? |
| CRM | Customer relationship management: software that holds what a business knows about each customer. | A list of customers and their orders |
| Customer analytics | Studying customer data: who buys what, and when. | Who has stopped buying? |
| Pattern | Something that repeats in the data. | Sales rise every December |
| Scale | How much data there is, and how fast it grows. | 50 rows or 50 million rows |
| Database | An organised store of data that you can ask questions of. | Customers and orders |
| Data warehouse | A store of cleaned data (checked and fixed) in one agreed shape, for reports. | All sales of a chain |
| Data lake | A store of raw data (not changed yet) in any format. | Shop payment logs and emails |
The cells students fill in are left blank in this preview.
Data mining: find what nobody asked
Data mining searches a large amount of data for patterns. You do not start with a question. The computer looks for things that repeat or go together.
Mining needs a lot of data. A pattern in 10 rows may be luck. A pattern in 10 million rows is much more likely to be real.
Quick check: mining or reporting?
Have a go
Quick check: mining or reporting?
3 questionsBusiness intelligence helps people decide
Business intelligence means using data to decide better. Reports, charts and mining all give it facts.
Two big uses are money and customers. Finance teams use data to plan. Customer teams use data to look after customers and to write to them.
What business intelligence does
| Use | What it does | Example |
|---|---|---|
| Financial planning and analysis | Plans money. Compares real costs and the money coming in with the plan. | The shop sees that costs are rising and changes its budget. |
| CRM: customer analytics | Studies what customers buy and when. | Finds the customers who have not ordered this year. |
| CRM: communications | Sends the right message to the right customer. | Sends a discount email to customers who stopped buying. |
The cells students fill in are left blank in this preview.
Match the job to the use
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
The tool depends on the scale
A small club with 50 members can keep a spreadsheet. A shop with 10,000 orders needs a database.
A chain (many shops with one name) with millions of sales a day needs a data warehouse, a data lake and mining tools. The bigger the scale, the stronger the tool must be.
Scale and tool
| Scale | Example | Tool that fits | Why |
|---|---|---|---|
| Small: tens of rows | A club list | A spreadsheet | Easy and cheap |
| Medium: thousands of rows | One shop's orders | A database | Fast questions, safe storage |
| Big: millions of rows | A chain's sales | A data warehouse and mining tools | Too much for one spreadsheet or one server |
The cells students fill in are left blank in this preview.
Try it: find the big orders
orders = [
[1, "Sam", "2025-03-02", 20.0],
[2, "Sam", "2025-05-10", 35.5],
[3, "Aisha", "2024-11-20", 12.0],
[4, "Leo", "2025-02-14", 50.0],
[5, "Leo", "2025-04-01", 15.0],
[6, "Leo", "2025-06-30", 27.5],
[7, "Tom", "2023-12-25", 40.0],
[8, "Aisha", "2024-12-01", 18.0],
]
# Each order is: [order id, customer, date, total in pounds]
# Reporting: show the big orders, more than 20 pounds.
for order in orders:
if order[3] > 20:
print("Order", order[0], "by", order[1], "costs", order[3])
# Change 20 to 30 and run it again.
Make a free account to save your work and track your progress.
Your turn: the biggest orders
The shop wants a report of its big orders. Fill in two functions. The first lists the ids of the orders of a set amount or more. The second finds the id of the biggest order. Press Run Tests to check.
def big_orders(orders, limit):
# Each order is: [order id, customer, date, total in pounds].
# Give back a list of the ids of the orders whose total is limit or more.
# Keep them in the same order as the list.
return None
def biggest_order(orders):
# Give back the id of the order with the biggest total.
# The list is never empty.
return None
Make a free account to save your work, or press Start lab to work through the whole lesson.
Who has stopped buying?
A CRM team wants to write to customers who have not bought for a long time. A first step is to list the old orders. The customers in that list may need a message.
Try it: old orders
orders = [
[1, "Sam", "2025-03-02", 20.0],
[2, "Sam", "2025-05-10", 35.5],
[3, "Aisha", "2024-11-20", 12.0],
[4, "Leo", "2025-02-14", 50.0],
[5, "Leo", "2025-04-01", 15.0],
[6, "Leo", "2025-06-30", 27.5],
[7, "Tom", "2023-12-25", 40.0],
[8, "Aisha", "2024-12-01", 18.0],
]
# Each order is: [order id, customer, date, total in pounds]
# Old orders, from before 2025. A year-month-day date compares as text.
for order in orders:
if order[2] < "2025-01-01":
print(order[1], "ordered on", order[2])
# Who is in the list? Did they also order after 2025 began?
Make a free account to save your work and track your progress.
Your turn: the old orders
The CRM team wants to write to customers who have stopped buying. Fill in two functions. The first says if one customer has ordered since a date. The second lists every customer who has not. Press Run Tests to check.
def bought_since(orders, name, date):
# Each order is: [order id, customer, date, total in pounds].
# Give back True if this customer has an order on or after the date.
# Dates are written year-month-day, so you can compare them as text.
return None
def lapsed(orders, date):
# Give back a list of the customers with NO order on or after the date.
# Each name appears once, in the order it first appears in orders.
return None
Make a free account to save your work, or press Start lab to work through the whole lesson.
Extra: Try it: CRM questions in SQL
-- 1. How much has each customer spent? SUM adds. GROUP BY makes one row per customer.
SELECT customers.name, SUM(orders.total) AS spent
FROM customers
JOIN orders ON orders.customer_id = customers.id
GROUP BY customers.id
ORDER BY spent DESC;
-- 2. Who has NOT ordered since 1 January 2025? This also finds Maya, who never ordered.
SELECT name FROM customers
WHERE id NOT IN (SELECT customer_id FROM orders WHERE order_date >= '2025-01-01')
ORDER BY name;
Make a free account to save your work and track your progress.
Key words crossword
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Watch: from a pattern to the right tool
Press Play on the short film below. It starts with the phone shop and its pattern, then shows business intelligence and the tool for each scale. Listen for the myth about mining and reporting.
Film: Mining, reports and customer data
Mining, reports and customer data
Every scene, as text
- Phone cases and screen protectors. People who buy a phone case often buy a screen protector in the same week (pattern: something that repeats in the data). The shop puts the screen protectors next to the cases (because: a computer found the pattern). Sales go up (so: the business learns from its data).
- Data mining: find what nobody asked. You do not start with a question (looks for: what repeats or goes together). A pattern in 10 rows may be luck. A pattern in 10 million rows is much more likely to be real (so: mining needs a lot of data).
- Myth (false): mining is reporting. That is not true: reporting answers known questions. Mining finds new ones. Sales each month (reporting: a known question, on a schedule). Cases and screen protectors are bought together (mining: a new pattern a computer found).
- What business intelligence does. Financial planning and analysis: plans money (example: costs rise, so the budget changes). CRM: customer analytics: who buys what, and when (example: Leo bought three times in 2025). CRM: communications: the right message to the right customer (example: a thank-you to every new customer).
- The tool depends on the scale. Tens of rows: a spreadsheet (why: easy and cheap). Thousands of rows: a database (why: fast questions, safe storage). Millions of rows: a data warehouse, a data lake and mining tools (why: too much for one spreadsheet or server).
Final check
Have a go
Final check
5 questionsRemember
Important
Reporting answers known questions. Mining finds new ones. Business intelligence uses both to decide, for money and for customers. The bigger the data, the stronger the tool.