8.SQL Operators
8.SQL Operators
IB
1) Arithmatic
4) Concatenation ( | | )
5) Like (% - Unknown length, _ - One Unknown Character)
7) in/ Not in
8) Between / Not between.
1. Arithmatic ( + , - , , / )
Arithmetic operations is a branch of mathematics, that involves the
study of numbers, operation of numbers that are useful in all the
other branches of mathematics. It basically comprises operations
such as Addition, Subtraction, Multiplication and Division.
DESC EMP_info;
Raw Data:
INSERT INTO EMP_INFO VALUES (1,'Ashish', 92000, 11000, 'Navi Mumbai');
INSERT INTO EMP_INFO VALUES (2,'Amit', 83000, 19000, 'Pune');
INSERT INTO EMP_INFO VALUES (3,'Sumit', 77000, 15000, 'Mumbai');
INSERT INTO EMP_INFO VALUES (4,'Pratap', 78000, 16000, 'Nagpur');
INSERT INTO EMP_INFO VALUES (5,'Suprabhat', 82000, 14000, 'Akola');
INSERT INTO EMP_INFO VALUES (6,'Minal', 85000, 12000, 'Amravati');
INSERT INTO EMP_INFO VALUES (7,'Akshay', 75000, 16000, 'Nashik');
INSERT INTO EMP_INFO VALUES (8,'Sonam', 80000, 25000, 'Nagpur');
INSERT INTO EMP_INFO VALUES (9,'Ruksar', 85000, 17000, 'Navi Mumbai');
INSERT INTO EMP_INFO VALUES (10,'Neha', 60000, 22000, 'Mumbai');
INSERT INTO EMP_INFO VALUES (11,'Harish', 95000, 15000, 'Mumbai Thane');
INSERT INTO EMP_INFO VALUES (12,'Rani', 70000, 18000, 'Navi Mumbai Panvel');
RISE Institute Mumbai, 797-213-1295, RiseInstitute.tech
Head Office – Akshar Building, Navi Mumbai – 410209 | New Branch – Murtijapur, Dt. Akola, Maharashtra – 444107.
©
Select from emp_info;
SQL Aliases
SQL aliases are used to give a table, or a column in a
table, a temporary name.
@ PRACTICAL @
1. ANS:-
____________________________________________________
3. Between Operator
---- It displays the possible range of values from column. It
applies on Numeric and date values.
__________________________________________________________________
4. In Operator
1. Do u know In Operator?
5. Logical Operator
SQL logical operators are used to test for the truth of the
condition. A logical operator like the Comparison operator returns
a boolean value of TRUE, FALSE, or UNKNOWN.
And , Or , Not…
@ PRACTICAL @
@ PRACTICAL @
@ ASSIGNMENTS @
Certainly! Here are some scenario-based interview questions on SQL
operators:
5. IN Operator Scenario:
- Scenario: Your e-commerce database has a table named `Products`
with a column named `Category`. You want to retrieve all products in
the 'Electronics' and 'Clothing' categories.
- Question: How would you use the `IN` operator to achieve this in a
SQL query?