-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWHERE Clause and equal operator.txt
More file actions
34 lines (31 loc) · 1.28 KB
/
WHERE Clause and equal operator.txt
File metadata and controls
34 lines (31 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// WHERE
-> is used to search for a specific data;
1. Specifi data from all column
Syntax: SELECT * FROM table_name WHERE column_name operators 'value';
ex: SELECT * FROM student_reg WHERE s_id='102';
+------+------+---------+------------+-----------+
| s_id | name | address | dob | fees |
+------+------+---------+------------+-----------+
| 102 | SITA | KTM | 2001-10-11 | 200000.12 |
+------+------+---------+------------+-----------+
Note: Value can be text or numeric. if it is text then we have to put single quotes.
SQL Comparison Operators
Operator Description Example
= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to
<> or != Not equal
BETWEEN Between an inclusive range
LIKE search for a pattern
In To specifY MULTIPLE POSSIBLE VALUE OF A COLUMN
2. specific data from specific column
Syntax: SELECT column_name From table_name WHERE column_name operator 'value';
Ex: SELECT * from student_reg WHERE name='SITA';
+------+------+---------+------------+-----------+
| s_id | name | address | dob | fees |
+------+------+---------+------------+-----------+
| 102 | SITA | KTM | 2001-10-11 | 200000.12 |
+------+------+---------+------------+-----------+