CRM Order Details
Beginner Mode

Start your terminal to use beginner mode.

Objective

You are working on a CRM platform that manages customers, orders, and products in separate tables.

Task

Join all three DataFrames together and produce a single output containing the order details. Create a customer_name column by combining the customer's first and last name with a space in between. Rename email to customer_email and category to product_category. Save your result as result_df.

File Path

  • Customers: /home/interview/customers.csv
  • Orders: /home/interview/orders.csv
  • Products: /home/interview/products.csv
  • Starter script: /home/interview/crm_orders.py

Schema

customers.csv

Column Type
customer_id integer
first_name string
last_name string
email string

orders.csv

Column Type
order_id integer
customer_id integer
product_id integer
order_date string

products.csv

Column Type
product_id integer
product_name string
category string

Expected output schema

Column Type
order_id integer
customer_name string
customer_email string
product_name string
product_category string
order_date string

Example

Given this sample input:

customers

customer_id first_name last_name email
1 John Doe [email protected]
2 Jane Smith [email protected]

orders

order_id customer_id product_id order_date
1001 1 101 2023-01-10
1002 2 102 2023-01-11

products

product_id product_name category
101 Product A Electronics
102 Product B Clothing

The output would be:

order_id customer_name customer_email product_name product_category order_date
1001 John Doe [email protected] Product A Electronics 2023-01-10
1002 Jane Smith [email protected] Product B Clothing 2023-01-11

Terminal requires a larger screen

Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.

Linux Terminal Environment

Write and execute your solution in the terminal below.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →