-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodecademy-SQL-challenge-RPA.sqlite
More file actions
55 lines (46 loc) · 1.39 KB
/
codecademy-SQL-challenge-RPA.sqlite
File metadata and controls
55 lines (46 loc) · 1.39 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
-- 1
-- What are the column names?
SELECT *
FROM transaction_data
LIMIT 10;
-- 2
-- Find the full_names and emails
-- of the transactions listing 20252 as the zip code.
SELECT full_name, email, zip
FROM transaction_data
WHERE zip = 20252;
-- 3
-- Use a query to find the names
-- and emails associated with these transactions.
SELECT full_name, email
FROM transaction_data
WHERE full_name = 'Art Vandelay'
OR full_name LIKE '% der %';
-- 4
-- Find the ip_addresses and emails listed with these transactions.
SELECT ip_address, email
FROM transaction_data
WHERE ip_address LIKE '10.%';
-- 5
-- Find the emails in transaction_data with
-- ‘temp_email.com’ as a domain.
SELECT email
FROM transaction_data
WHERE email LIKE '%temp_email.com';
-- 6
-- The finance department is looking for a specific transaction.
-- They know that the transaction occurred from an ip address starting
-- with ‘120.’ and their full name starts with ‘John’.
-- Can you find the transaction?
SELECT *
FROM transaction_data
WHERE ip_address LIKE '120.%'
AND full_name LIKE 'John%';
-- 7
-- Challenge
-- Return only those customers residing in GA. Use the list of ZIP CODE prefixes
-- (https://en.wikipedia.org/wiki/List_of_ZIP_Code_prefixes)
-- to determine the best query for zip codes belonging to Georgia(GA).
SELECT *
FROM transaction_data
WHERE zip LIKE '3%';