Note -f shows filesystem type, label, UUID, and mount points. Useful for identifying disks before mounting or partitioning. Linux only; on macOS, use diskutil list.
-- department_id | first_name | salary | dept_rank
-- 1 | Alice | 95000 | 1
-- 1 | Bob | 82000 | 2
-- 2 | Carol | 105000 | 1
-- 2 | Dave | 78000 | 2
Note PARTITION BY divides rows into groups and applies the window function independently within each group. It is like GROUP BY but without collapsing rows. You can partition by multiple columns.
Frequently asked questions
How does Bash & Linux handle partitions?
This task is covered in 2 stacks on this page: Bash & Linux, SQL. The "List Block Devices" snippet in Bash & Linux uses `lsblk [options]`.
Which command does the Bash & Linux example use?
The "List Block Devices" snippet uses `lsblk [options]`, from the System Info section of the Bash & Linux cheat sheet.
Which stacks cover "partitions" on this page?
Bash & Linux, SQL. Together they hold 2 copy-ready snippets for this task.
Is there anything to watch out for?
Yes. For "List Block Devices": -f shows filesystem type, label, UUID, and mount points. Useful for identifying disks before mounting or partitioning. Linux only; on macOS, use diskutil list.