"Hi, my solution gives the exact numerical values as the proposed solution, but it doesn't pass the tests. Am I missing something, or is this a bug?
def findrevenueby_city(transactions: pd.DataFrame,
users: pd.DataFrame,
exchange_rate: pd.DataFrame) -> pd.DataFrame:
gets user city for each user id
userids = users[['id', 'usercity']]
and merge on transactions
transactions = transactions.merge(user_ids, how='left"
Gabriel P. - "Hi, my solution gives the exact numerical values as the proposed solution, but it doesn't pass the tests. Am I missing something, or is this a bug?
def findrevenueby_city(transactions: pd.DataFrame,
users: pd.DataFrame,
exchange_rate: pd.DataFrame) -> pd.DataFrame:
gets user city for each user id
userids = users[['id', 'usercity']]
and merge on transactions
transactions = transactions.merge(user_ids, how='left"See full answer
"Schema is wrong - id from product is mapped to id from transactions, id from product should point to product_id in transcations table"
Arshad P. - "Schema is wrong - id from product is mapped to id from transactions, id from product should point to product_id in transcations table"See full answer
"SELECT upsellcampaignid, COUNT(DISTINCT trans.userid) AS eligibleusers
FROM campaign
JOIN "transaction" AS trans
ON transactiondate BETWEEN datestart AND date_end
JOIN user
ON trans.userid = user.userid
WHERE iseligibleforupsellcampaign = 1
GROUP BY upsellcampaignid
`"
Alina G. - "SELECT upsellcampaignid, COUNT(DISTINCT trans.userid) AS eligibleusers
FROM campaign
JOIN "transaction" AS trans
ON transactiondate BETWEEN datestart AND date_end
JOIN user
ON trans.userid = user.userid
WHERE iseligibleforupsellcampaign = 1
GROUP BY upsellcampaignid
`"See full answer
"with cte as (
select c.firstname, c.lastname, t.receipt_number,
count(t.receiptnumber) over(partition by c.customerid) as noofoffences
from customers c
join transactions t
on c.customerid = t.customerid
where t.receipt_number like '%999%' or
t.receipt_number like '%1234%' or
t.receipt_number like'%XYZ%')
select *
from cte
where noofoffences>=2
`"
Gowtami K. - "with cte as (
select c.firstname, c.lastname, t.receipt_number,
count(t.receiptnumber) over(partition by c.customerid) as noofoffences
from customers c
join transactions t
on c.customerid = t.customerid
where t.receipt_number like '%999%' or
t.receipt_number like '%1234%' or
t.receipt_number like'%XYZ%')
select *
from cte
where noofoffences>=2
`"See full answer