How to Use Arithmetic Expression in SQL
In this article I am going to explain how to work with arithmetic expression in SQL
Introduction
In this article I am going to explain how to perform arithmetic operations on data stored in database table. We can perform operation on data stored in two or more than two columns and resultant data can be stored in new column. SQL support all arithmetic operators ( multiplication, division, modulo, addition, subtraction).
Order of precedence of arithmetic expression
- Multiplication ( * )
- Division (/)
- Modulo (%)
- Addition (+)
- Subtraction (-)
A Statement that create mcninvoices table
Statements that insert data in mcninvoices table
A Statement that is used to fetch data from mcninvoices table
A Statement that calculate the balance due
A Statement that calculate discount