BI & Analytics Quiz
Business intelligence and analytics — reporting, dashboards, and turning raw data into decisions.
This category currently has 100 questions in the SERVBG quiz bank. Below are a few sample questions — the full interactive quiz shuffles through the whole set with instant scoring.
Sample questions
Which window function clause restricts the frame to rows between the start of the partition and the current row, inclusive?
- RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
- RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
- ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
- ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
- ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING
A query uses LAG(revenue, 1) OVER (PARTITION BY region ORDER BY month). What is the value returned for the first row of each partition?
- 0
- An error is raised
- The global average of revenue
- NULL
- The value of the last row in the partition
To perform gap-fill on a sparse time-series table, which SQL technique generates a complete date spine before a LEFT JOIN?
- CROSS APPLY with DATEADD to expand only existing rows
- A CTE using GENERATE_SERIES (PostgreSQL) or equivalent date-spine expression to produce every date in the range
- WINDOW FILL FORWARD applied directly to the sparse table without a spine
- A recursive CTE that doubles the date range on each iteration via CROSS JOIN
- PIVOT on the date column to transpose sparse values into columns
In sessionisation logic, a new session is defined when the gap between consecutive events exceeds 30 minutes. Which window function approach correctly flags session boundaries?
- Use LEAD to get the next event timestamp and flag rows where the next gap exceeds 30 minutes, then apply ROW_NUMBER
- Use NTILE(30) OVER (PARTITION BY user ORDER BY event_time) to split events into 30-minute buckets
- Use LAG to get the previous event timestamp, then flag a new session where the difference exceeds 30 minutes, and use SUM of flags OVER (PARTITION BY user ORDER BY event_time) to assign session IDs
- Use FIRST_VALUE(event_time) OVER (PARTITION BY user) and subtract from every row to detect 30-minute gaps
- Use DENSE_RANK() OVER (PARTITION BY user ORDER BY event_time) to number each event as a separate session
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary) differs from PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY salary) because:
- PERCENTILE_CONT interpolates between adjacent values to return the exact median, while PERCENTILE_DISC returns the first actual value that meets or exceeds the percentile threshold
- Both functions return identical results for even-numbered datasets with no duplicates
- PERCENTILE_DISC interpolates between adjacent values; PERCENTILE_CONT always returns an existing row value
- PERCENTILE_DISC returns the median of the top half; PERCENTILE_CONT returns the median of all values
- PERCENTILE_CONT only operates on integer columns; PERCENTILE_DISC works on any orderable type
Related categories
Python (Coding)
Python syntax, standard-library usage, and the language idioms that come up in day-to-day scripting and application work.
JavaScript (Coding)
Core JavaScript language behavior, async patterns, and the quirks that trip up both beginners and experienced developers.
Linux
Linux command-line usage, file permissions, process management, and the everyday admin tasks every sysadmin and developer needs.
Security
General information security concepts — threats, defenses, and the fundamentals every IT professional should know.
Hardware
Computer hardware components, how they interact, and the troubleshooting knowledge behind keeping systems running.