How to Use Arithmetic Expression in SQL

In this article I am going to explain how to work with arithmetic expression in SQL
  • 3686


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

  1.  Multiplication  ( * )
  2.  Division  (/)
  3.  Modulo (%)
  4.  Addition (+)
  5.  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


© 2020 DotNetHeaven. All rights reserved.