A query

Report a typo

Here we have a query that aggregates values based on dates of transactions.

SELECT 
     count(id) as daily_transactions,
     sum(turnover) as daily_turnover,
     date(finished_at) as tx_date
FROM transactions
GROUP BY date(finished_at);

We know that the table only has data for 10 days total. Still, we only need to see the last five of them not counting the last.

SELECT 
     count(id) as daily_transactions,
     sum(turnover) as daily_turnover,
     date(finished_at) as tx_date
FROM transactions
GROUP BY date(finished_at)
ORDER BY date(finished_at) desc
LIMIT 5
OFFSET 1;

For how many days (records) will our query perform calculations?

Select one option from the list
___

Create a free account to access the full topic