Advanced SQL: subqueries, WITH (CTEs) and window functions
No reviews yet
Intermediate
2 h
750 credits
First lab free
Important
This workshop only asks questions: nothing in it justifies an UPDATE or a DELETE, and the validation checks that the shop has not been modified. The queries get longer: type them in pieces, and run each piece before adding the next. The sandbox lives for three hours.
Tip
Any division involving a percentage or an average: convert one of the two numbers with ::numeric, otherwise PostgreSQL divides in integers and throws away what comes after the decimal point, without warning. And before joining two tables that each have several rows per product, group each one in a WITH step: otherwise the amounts multiply.
sql
with
subquery
window functions
dates
challenge
Advanced SQL: subqueries, WITH (CTEs) and window functions · MonPremierLab