-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect1.sql
More file actions
88 lines (66 loc) · 1.17 KB
/
select1.sql
File metadata and controls
88 lines (66 loc) · 1.17 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
SELECT
last_name, first_name, points, (points + 10 )* 100 AS 'discount factor'
FROM
customers;
SELECT DISTINCT state
FROM customers;
SELECT
name, unit_price, (unit_price * 1.1) AS 'new_price'
FROM
products;
SELECT *
FROM customers
WHERE points > 3000;
SELECT *
FROM customers
WHERE state = 'VA';
SELECT *
FROM customers
WHERE state <> 'VA';
SELECT *
FROM customers
WHERE state != 'VA';
SELECT *
FROM customers
WHERE birth_date > '1990-01-01';
SELECT
*
FROM
sql_store.orders
WHERE
order_date >= '2019-01-01';
SELECT
*
FROM
sql_store.customers
WHERE
birth_date > '1990-01-01' AND points > 1000;
SELECT
*
FROM
sql_store.customers
WHERE
birth_date > '1990-01-01' OR (points > 1000 AND state='VA');
SELECT
*
FROM
sql_store.customers
WHERE
NOT (birth_date > '1990-01-01'
OR points > 1000);
SELECT
*
FROM
sql_store.order_items
WHERE
order_id = 6
AND quantity * unit_price > 30;
SELECT *
FROM customers
WHERE state = 'VA' OR state='GA' OR state = 'FL';
SELECT *
FROM customers
WHERE state IN ('VA','GA','FL');
SELECT *
FROM customers
WHERE state NOT IN ('VA','GA','FL');