Perform Calculations (Cambridge (CIE) IGCSE ICT): Revision Note
Exam code: 0417 & 0983
Perform calculations
How do you perform calculations in a database?
In a database, you can use arithmetic operations or numeric functions to perform calculations
Calculated fields are fields that carry out a calculation based on other number fields in the database
For example, a 'products' table with a
stockandunit_pricefieldsYou could use a calculated field named
stockvalueto calculateunit_price*stockThis calculation multiplies the price of each item by its quantity to find the total value of the stock

Calculated controls are objects you place on forms or reports to display the result of an expression
For example, a form in a sales database where you input the
QuantitySoldandUnitPriceA calculated control could be used to display the
TotalSaleTotalSale = QuantitySold * UnitPriceThis displays the total sale on the form without storing it in the database
Using formulae and functions to perform calculations
Databases allow you to use formulae and functions to perform calculations at run time
This can include basic arithmetic operations: addition, subtraction, multiplication, and division
For example, you have a discount field and you want to subtract it from the total cost, you could use a subtraction operation like this:
FinalCost = TotalCost - Discount
Aggregate functions
You can also use aggregate functions to calculate statistical information about a set of records
Some examples include:
Sum | Adds together all the numbers in a column |
|
|---|---|---|
Average | Computes the average of a set of numbers in a column |
|
Maximum | Finds the highest number in a column |
|
Minimum | Finds the lowest number in a column |
|
Count | Counts the number of rows in a column |
|
Remember that the actual syntax and function names might differ slightly depending on the specific database system being used.
Unlock more, it's free!
Did this page help you?