Please answer the questions below. Enter your SQL queries that provide the appropriate answers into the code chunks below the question.
The questions are designed to reflect the kinds of insights that you might be asked by a data team manager or executive. As a data scientist/analyst, it is your job to translate real life requests into code that can answer these questions. The most important part of this assignment, and all the ones that follow, is to develop a line of reasoning that you can implement with code in order to get the answer that you want to.
select
count(*) as 'Number of transactions'
from
transactions;
select
count(*) as 'Number of customers'
from
customers;569887, now let us check number of
distict customer is transaction table
select
count(distinct customer)
from
transactions;569887, this
means that to make transaction must be registered in customer table,and
means that at least each customer they have made one transaction.
select
distinct transaction_id
from
transactions;
select
transaction_id,count(*)
from
transactions
group by transaction_id
order by count(*) desc
limit 1;select
transaction_id, round(sum(amount),2) as 'total amount',avg(amount) 'Average'
from
transactions
group by transaction_id
order by round(sum(amount),2) desc
limit 1;
select
transaction_id,customer, count(*)
from
transactions
group by
customer
order by
count(*) desc
limit 1;select
count(*)
from
customers
where age =24;
select
count(*)
from
customers
where age =60;