The WHERE clause is used to filter records.
The WHERE Clause
The WHERE clause is used to extract only those records that fulfill a specified criterion.
SQL WHERE Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name operator value
WHERE Clause Example
The "student" table:
Student _No
|
Student_Name
|
Address
|
Year_Study
|
Sex
|
Date_of_birth
|
Course_No
|
ST100
|
K.Ranjan
|
Kandy
|
1
|
Male
|
17/01/1988
|
C1
|
ST101
|
N.Kumanan
|
Jaffna
|
2
|
Male
|
15/12/1989
|
C2
|
ST102
|
S.Ranjini
|
Vavuniya
|
1
|
Female
|
17/01/1989
|
C1
|
ST103
|
K.Dias
|
Colombo
|
3
|
Male
|
22/07/1987
|
C1
|
ST104
|
A.Kavitha
|
Matara
|
3
|
Female
|
20/03/1985
|
C2
|
ST105
|
L.Lavanya
|
Galle
|
2
|
Female
|
22/04/1989
|
C2
|
ST106
|
G.Moorthy
|
Jaffna
|
2
|
Male
|
12/01/1986
|
C1
|
ST107
|
F.Nathan
|
Matara
|
2
|
Male
|
29/01/1990
|
C3
|
ST108
|
A.H.M.Akmal
|
Puttalam
|
1
|
Male
|
12/12/1990
|
C3
|
Now we want to select only the student living in the Address "Jaffna" from the table above.
We use the following SELECT statement:
SELECT*FROM student WHERE Address='Jaffna';
The result-set will look like this:
Student_No
|
Student_Name
|
Address
|
Year_Study
|
Sex
|
Date_of_birth
|
Course_No
|
ST101
|
N.Kumanan
|
Jaffna
|
2
|
Male
|
1989-12-15
|
C2
|
ST106
|
G.Moorthy
|
Jaffna
|
2
|
Male
|
1986-01-12
|
C1
|
Gold Casino: Play at the Best Online Casinos in the UK
ردحذفThe UK's 10bet leading online casino offers a betway varied range of games, from slots to live dealer table games. You can play from anywhere in the クイーンカジノ UK,
Merkur Gold Strike Safety Razor - FEBCASINO
ردحذفMerkur's Gold Strike https://febcasino.com/review/merit-casino/ Safety Razor, Merkur gri-go.com Platinum Edge sol.edu.kg Plated Finish, German, Gold-Plated, Satin Chrome worrione Finish. Merkur has a more หารายได้เสริม aggressive looking,
إرسال تعليق