Querying Data for a User Need

A query is meaningful when it answers a user question. Begin with the need, then choose fields, filters, calculations and order.

Example need

A participant wants to find the strongest fictional teams and inspect their performance.

SELECT team_name,
       SUM(wins) AS total_wins,
       SUM(losses) AS total_losses
FROM team_results
GROUP BY team_name
ORDER BY total_wins DESC, team_name ASC;

This processes many stored rows into one summary per team. It is stronger evidence of processing than simply displaying the imported table.

Plan the output

Document:

Check


Revision #1
Created 2026-08-18 23:36:24 UTC by Mr Napper
Updated 2026-08-18 23:36:28 UTC by Mr Napper