A running sum is partitioned by customer. A's amounts are 6 then 4; B's only amount is 9. How is B's total calculated?
Three order rows, ids 21, 22 and 23, reach a window function. With no later filtering or grouping, which rows remain when its result column is added?
Customer A has only two rows, with amounts 3 and 8. SUM(a) OVER(PARTITION BY c), with no window ORDER BY, gives 11 on both A rows.
Circle one: True False
Within one customer's partition, scores are 95, 81, 81 and 70. Which function, using OVER(PARTITION BY c ORDER BY score DESC), gives ranks 1, 2, 2 and 4?
Sales(c,id,a) has several customers; id is a unique non-null order key. Which PostgreSQL query keeps each order and adds its customer's running sum in id order?
Sales has unique non-null order ids. A query uses SUM(a) OVER(PARTITION BY c) and ends with ORDER BY c,id. It repeats full totals. Which change makes each customer's sum run row by row in id order?
One customer's rows have (id,a) values (2,11), (5,7), (9,18). LAG(a) OVER(PARTITION BY c ORDER BY id), with no default, returns 0,11,7 in id order.
Circle one: True False
A's scores are 88, 88, 72, 60 and 60; B has a score of 99. What ranks does A get from DENSE_RANK() OVER(PARTITION BY c ORDER BY score DESC), in A's listed order?