---
title: "Assignment 2"
subtitle: "Exploring Retail Data: A Practical Data Science Project"
format: 
  html:
    embed-resources: true
---

While purchasing items either online or in-store, customers often share some of their personal information. Your client has collected such data and now seeks insights to answer a few specific questions based on it. Your task is to assist the client by analyzing the dataset and providing meaningful answers. 
The dataset `customer_data.csv` required for this task is [available here](customer_data.csv). ***Answer all the questions by using the tidyverse functions.***



**1. Load tidyverse and read the csv file.**

```{r}
#| warning: false
#| echo: true
library(tidyverse)
df <- readr::read_csv('customer_data.csv')
```


**2. View the first 5 rows of the dataset to understand its structure.**

```{r}

```


**3. How many rows and columns are in the dataset?**

```{r}

```


**4. Find the maximum, minimum, and mean age of the customers.**

```{r}

```


**5. What are the three most common customer names?**

```{r}

```


**6. Identify the customers who have the same phone number.?**

```{r}

```


**7. How many customers have the profession "Structural Engineer"?**

```{r}

```


**8. How many male customers are Structural Engineers?**

```{r}

```


**9. Find the female Structural Engineers from the province of Alberta (AB)** 

```{r}

```


**10. What is the maximum, minimum, and average spending amount?**

```{r}

```


**11. Who did not spend anything? Company wants to send a deal to encourage the customer to buy stuff!**

```{r}

```


**12. As a loyalty reward, company wants to send thanks coupon to those who spent 100CAD or more, please find out the customers?**

```{r}

```


**13. How many emails are associated with this credit card number '5020000000000230'?**

```{r}

```


**14. We need to send new cards to the customers well before the expire, how many cards are expiring in 2019?**

```{r}

```


**15. How many people use Visa as their Credit Card Provider?**

```{r}

```


**16. Can you find the customer who spent 100 CAD using Visa?**

```{r}

```


**17. What are two most common professions?**

```{r}

```


**18. Can you tell the top 5 most popular email providers? (e.g. gmail.com, yahoo.com, etc...)**

```{r}
# use stringr package if needed
# Try learning new things!!

```


**19. Is there any customer who is using email with "am.edu"?**

```{r}
# use stringr::str_detect() to find customers with "am.edu" in their email.

```


**20. Which day of the week, the store gets more customers?**

```{r}

```
