- select one row of data somehow - select another row of data (either in the same way, or differently) - do some arithmetic on the two pieces of data and compare the results - Insert or otherwise store some suitable result data somewhere