Although you may often want to list all entries in a database table sometimes you will just want a summary of some sort. For example, you might want to list total order values for customers:
$query="SELECT customerId, SUM(price) FROM orders GROUP BY customerId";




