SQL Operators: What Is SQL Operator?
SQL Operators: What Is SQL Operator?
The manipulation and retrieving of the data are performed with the
help of reserved words and characters, which are used to perform
arithmetic operations, logical operations, comparison operations,
compound operations, etc.
Add Operator:
SELECT cust_name, opening_amt,
receive_amt, (opening_amt + receive_amt)
FROM customer
WHERE (opening_amt + receive_amt)>15000;
Subtract operator:
SELECT cust_name,opening_amt, payment_amt,
outstanding_amt
FROM customer
WHERE(outstanding_amt-payment_amt)=receive_amt;
Multiply operator:
SELECT agent_code, agent_name,
working_area, (commission*2)
FROM agents
WHERE (commission*2)>0.25;
Divide Operator:
Medulo Operator:
SELECT 150%7
Comparison Operators:
SELECT *
FROM agents
WHERE commission = 0.15;
SELECT *
FROM agents
WHERE commission> 0.14;
SELECT *
FROM agents
WHERE commission >= 0.14;
SELECT *
FROM agents
WHERE commission <> 0.15;
Logical Operators
SELECT cust_code, cust_name,
cust_city,cust_country,grade
FROM customer
WHERE cust_country = 'UK' AND grade = 2;
SELECT cust_code,cust_name,
cust_city,cust_country,grade
FROM customer
WHERE cust_country = 'USA' OR grade = 3;