Custom functions used in Google Sheets for ease of use and improved functionality.
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
select sum(quantity*price), month(date) from booksales where year(date) = 2022 group by month(date);
select concat(convert(substr(customers.phone,1,3),char), booksales.date), count(*)
from booksales
join customers on booksales.customer_id = customers.id
group by concat(convert(substr(customers.phone,1,3),char), booksales.date)