The following covers code samples of database computations. Each sample includes four parts – the problem, the tip, the code, and the result.