SQL Airthmetic Operators-interview
Q1. What are arithmetic operators in SQL?
Operators like +, -, *, /, % used to perform calculations on numeric columns.
Q2. How do you calculate total price in SQL?
SELECT price * quantity AS total_price FROM Products;
Q3. How do you calculate the average value?
SELECT total_marks / students AS average FROM Exams;
Q4. Can arithmetic operators be used with WHERE clause?
Yes, you can filter using calculations.
SELECT * FROM Employees WHERE salary + bonus > 50000;
Q5. What is the modulus operator and its use?
% gives the remainder of division. Example: marks % 10 returns the remainder when marks are divided by 10.