Oracle SQL Advanced Features Flashcards
6 cards from real Oracle SQL practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Oracle SQL Advanced Features flashcards as text
Which Oracle SQL analytic function calculates a running total?
Answer: SUM() OVER (ORDER BY)
SUM() used as an analytic function with OVER (ORDER BY column) computes a cumulative running total up to each row.
What does the LISTAGG function do in Oracle SQL?
Answer: Aggregates string values from multiple rows into a single delimited string
LISTAGG(column, delimiter) concatenates values from multiple rows into a single string with the specified separator.
Which Oracle SQL function returns the cumulative distribution of a value within a partition?
Answer: CUME_DIST()
CUME_DIST() calculates the cumulative distribution (fraction of partition rows at or before the current row) as a value between 0 and 1.
What is the purpose of the UNPIVOT clause in Oracle SQL?
Answer: Converts columns into rows
UNPIVOT rotates columns into rows, the opposite of PIVOT, transforming wide data formats into tall (normalized) formats.
Which Oracle SQL clause creates a window frame for analytic functions based on a range of rows?
Answer: ROWS BETWEEN
ROWS BETWEEN n PRECEDING AND n FOLLOWING (or CURRENT ROW/UNBOUNDED) defines the sliding window of rows for analytic function calculations.
What does the LEAD analytic function do in Oracle SQL?
Answer: Accesses data from a row after the current row
LEAD(column, n) accesses data from a row n positions after the current row, the forward-looking complement to LAG.