A Pivot Table is used for mathematical operations in a database table. Pivot Table performs count, summarize, arrange, rearrange, total, or average operations. It let users transform rows into columns and columns into rows. It enables advanced calculations in any field. In databases, a pivot table is a spreadsheet method that makes tables to be reorganized in different ways for the distinct presentation of the same data.
A pivot table groups rows/records/items into categories, counts what's the total number of an item in each category, then sum the item's value, or calculate average, as well as finding minimum and maximum value.
The purpose of putting items/records into categories is to make data handling easy. For example, there's a database table that has an attribute containing data for balls (an item). To sort it out, items can be categorized by their colors, let's say the pivot table separates black and red balls and counts their total.