Skip to main content

Find Customers by Department

MediumPremium

You are given the following tables:

orders table:

order_idcustomer_idorder_dateorder_amountdepartment_id
integerintegerdateintegerinteger

departments table:

department_iddepartment_name
integerstring

customers table:

customer_idfirst_namelast_name
integerstringstring

Find how many customers ordered from the electronics and the fashion department respectively in 2022. Your output should have the following columns: customers, department_name