-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWildcards
41 lines (33 loc) · 907 Bytes
/
Wildcards
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
35
36
37
38
39
40
41
#WHERE statment
# =, <>, <, >, And, Or, Like, Null, Not Null, In, */
SELECT *
FROM Alex_the_analyst.EmployeeDemographics
WHERE FirstName = 'Scott'
# Not equal function is <>
SELECT *
FROM EmployeeDemographics
WHERE FirstName <> 'Scott'
# > & < function
SELECT *
FROM EmployeeDemographics
WHERE Age >= 30
# AND function
SELECT *
FROM EmployeeDemographics
WHERE Age >= 30 AND Gender = 'Male'
# OR function
SELECT *
FROM EmployeeDemographics
WHERE Age >= 30 OR Gender = 'Female'
#Wildcards in Sql
# Like function. Searching for specified patterns in a column. The percentage sign represents zero, one or multiple characters
SELECT *
FROM EmployeeDemographics
WHERE LastName LIKE 'M%A%'
SELECT *
FROM EmployeeDemographics
WHERE LastName LIKE '%M%'
#IN function is like equal statement but for multiple equal statements
SELECT *
FROM EmployeeDemographics
WHERE FirstName IN ('Tyson', 'Anthony', 'Jim')