How to test SQL queries
producing a table of expected results. Run the queries and check that the actual results match the expected results
when is a database fit for purpose
if it meets the end-user requirements and the functional requirements set out at the analysis stage
when is a database output accurate
when the actual results match the expected results