SlideShare a Scribd company logo
1 of 8
Arithmetic operators
• SQL Addition Operator (+)
• SQL Subtraction Operator (-)
• SQL Multiplication Operator (*)
• SQL Division Operator (/)
• SQL Modulus Operator (%)
SQL Addition Operator (+)
• The SQL Addition Operator performs the addition on the numerical
columns in the table.
• If you want to add the values of two numerical columns in the table, then
you have to specify both columns as the first and second operand. You can
also add the new integer value in the value of the integer column.
• SELECT Column_Name_1 Addition_Operator Column_Name2 FROM Table_
Name;
• SELECT Column_Name_1 Addition_Operator Column_Name2 FROM Table_
Name WHERE Condition;
mployee_Id Emp_Name Emp_City Emp_Salary Emp_bonus
101 Anuj Ghaziabad 25000 2000
102 Tushar Lucknow 29000 1000
103 Vivek Kolkata 35000 2500
104 Shivam Goa 22000 3000
SELECT Emp_Salary + Emp_Bonus AS Emp_Total_Salary FROM Employee;
SELECT Emp_Salary + 15000 AS Emp_Updated_Salary FROM Employee;
SELECT Emp_Salary + Emp_Bonus AS Emp_Total_Salary FROM Employee
WHERE Emp_Salary > 25000;
Employee_Id Emp_Name Emp_City Emp_Salary Emp_Panelty
101 Anuj Ghaziabad 25000 500
102 Tushar Lucknow 29000 1000
103 Vivek Kolkata 35000 700
104 Shivam Goa 22000 500
SELECT Emp_Salary - Emp_Panelty AS Emp_Total_Salary FROM Employee;
SELECT Emp_Panelty - Emp_Salary AS Emp_Total_Salary FROM Employee WHERE Employee_ID = 104;
SELECT Emp_Salary - 10000 AS Emp_Updated_Salary FROM Employee;
Car_Number Car_Name Car_Amount Car_Price
2578 Creta 3 1500000
9258 Audi 2 3000000
8233 Venue 6 900000
6214 Nexon 7 1000000
SELECT Car_Amount * Car_Price AS Car_Total_Price FROM Cars;
SELECT Car_Amount * Car_Price AS Car_Total_Price FROM Cars WHERE Car_Price >= 1000000;
SELECT Car_Price / Car_Amount AS One_Car_Price FROM Cars;
Student_Id Student_Name Student_Maths Student_English
201 Anuj 30 60
202 Tushar 25 100
203 Vivek 30 90
204 Shivam 40 80
SELECT Student_English % Student_Maths AS Remainder FROM Student;
11-Arithmetic operators.pptx

More Related Content

Similar to 11-Arithmetic operators.pptx

MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
gilpinleeanna
 

Similar to 11-Arithmetic operators.pptx (20)

SQL Notes
SQL NotesSQL Notes
SQL Notes
 
Manipulating data
Manipulating dataManipulating data
Manipulating data
 
Les03 Single Row Function
Les03 Single Row FunctionLes03 Single Row Function
Les03 Single Row Function
 
MYSQL using set operators
MYSQL using set operatorsMYSQL using set operators
MYSQL using set operators
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 
Les01 Writing Basic Sql Statements
Les01 Writing Basic Sql StatementsLes01 Writing Basic Sql Statements
Les01 Writing Basic Sql Statements
 
Operators in C#
Operators in C#Operators in C#
Operators in C#
 
Week7a.pptx
Week7a.pptxWeek7a.pptx
Week7a.pptx
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
C++ chapter 2
C++ chapter 2C++ chapter 2
C++ chapter 2
 
Select To Order By
Select  To  Order BySelect  To  Order By
Select To Order By
 
Integrity constraint fundamentals of dbms.pdf
Integrity constraint fundamentals of dbms.pdfIntegrity constraint fundamentals of dbms.pdf
Integrity constraint fundamentals of dbms.pdf
 
sql language
sql languagesql language
sql language
 
Introduction to sql_02
Introduction to sql_02Introduction to sql_02
Introduction to sql_02
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
 
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docxMSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
MSCD650 Final Exam feedback FormMSCD650 Final Exam Grading For.docx
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Oracle: Joins
Oracle: JoinsOracle: Joins
Oracle: Joins
 
Les03
Les03Les03
Les03
 
COIS 420 - Practice01
COIS 420 - Practice01COIS 420 - Practice01
COIS 420 - Practice01
 

Recently uploaded

Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
Kamal Acharya
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
Sampad Kar
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
MaherOthman7
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 

Recently uploaded (20)

Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
 
Microkernel in Operating System | Operating System
Microkernel in Operating System | Operating SystemMicrokernel in Operating System | Operating System
Microkernel in Operating System | Operating System
 
Introduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of ArduinoIntroduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of Arduino
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
AI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdfAI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdf
 
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdf
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
BORESCOPE INSPECTION for engins CFM56.pdf
BORESCOPE INSPECTION for engins CFM56.pdfBORESCOPE INSPECTION for engins CFM56.pdf
BORESCOPE INSPECTION for engins CFM56.pdf
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Online book store management system project.pdf
Online book store management system project.pdfOnline book store management system project.pdf
Online book store management system project.pdf
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 

11-Arithmetic operators.pptx

  • 2. • SQL Addition Operator (+) • SQL Subtraction Operator (-) • SQL Multiplication Operator (*) • SQL Division Operator (/) • SQL Modulus Operator (%)
  • 3. SQL Addition Operator (+) • The SQL Addition Operator performs the addition on the numerical columns in the table. • If you want to add the values of two numerical columns in the table, then you have to specify both columns as the first and second operand. You can also add the new integer value in the value of the integer column. • SELECT Column_Name_1 Addition_Operator Column_Name2 FROM Table_ Name; • SELECT Column_Name_1 Addition_Operator Column_Name2 FROM Table_ Name WHERE Condition;
  • 4. mployee_Id Emp_Name Emp_City Emp_Salary Emp_bonus 101 Anuj Ghaziabad 25000 2000 102 Tushar Lucknow 29000 1000 103 Vivek Kolkata 35000 2500 104 Shivam Goa 22000 3000 SELECT Emp_Salary + Emp_Bonus AS Emp_Total_Salary FROM Employee; SELECT Emp_Salary + 15000 AS Emp_Updated_Salary FROM Employee; SELECT Emp_Salary + Emp_Bonus AS Emp_Total_Salary FROM Employee WHERE Emp_Salary > 25000;
  • 5. Employee_Id Emp_Name Emp_City Emp_Salary Emp_Panelty 101 Anuj Ghaziabad 25000 500 102 Tushar Lucknow 29000 1000 103 Vivek Kolkata 35000 700 104 Shivam Goa 22000 500 SELECT Emp_Salary - Emp_Panelty AS Emp_Total_Salary FROM Employee; SELECT Emp_Panelty - Emp_Salary AS Emp_Total_Salary FROM Employee WHERE Employee_ID = 104; SELECT Emp_Salary - 10000 AS Emp_Updated_Salary FROM Employee;
  • 6. Car_Number Car_Name Car_Amount Car_Price 2578 Creta 3 1500000 9258 Audi 2 3000000 8233 Venue 6 900000 6214 Nexon 7 1000000 SELECT Car_Amount * Car_Price AS Car_Total_Price FROM Cars; SELECT Car_Amount * Car_Price AS Car_Total_Price FROM Cars WHERE Car_Price >= 1000000; SELECT Car_Price / Car_Amount AS One_Car_Price FROM Cars;
  • 7. Student_Id Student_Name Student_Maths Student_English 201 Anuj 30 60 202 Tushar 25 100 203 Vivek 30 90 204 Shivam 40 80 SELECT Student_English % Student_Maths AS Remainder FROM Student;