SQL allows you to calculate the fields of a table. The basic arithmetic operations to calculate the fields are addition(+), subtraction(-), multiplication(*), and division(/).
Example: Calculate the sub totals of each product in the TblProduct below:
Note: We use the AS keyword to assign the new name(Subtotal) to the new field that derive from the calculation of other fields. This is called aliasing the field name.
This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages: