-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjoinPractice.sql
More file actions
48 lines (42 loc) · 906 Bytes
/
joinPractice.sql
File metadata and controls
48 lines (42 loc) · 906 Bytes
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
/*practice select/equijoin statements*/
/*select number 1*/
SELECT
public.film.title,
public.customer.first_name,
public.customer.last_name
FROM
public.film,
public.inventory,
public.rental,
public.customer
WHERE
public.film.film_id = public.inventory.film_id
AND public.inventory.inventory_id = public.rental.inventory_id
AND public.rental.customer_id = public.customer.customer_id
AND (
public.film.title = 'Caddyshack Jedi'
OR public.film.title = 'Born Spinal'
)
/*select number 2*/
SELECT
customer.first_name,
customer.last_name
FROM
city,
customer,
address
WHERE
customer.address_id = address.address_id
AND address.city_id = city.city_id
AND city = 'Vancouver'
/*select number 3*/
SELECT
customer.first_name,
customer.last_name,
payment.amount
FROM
payment,
customer
WHERE
customer.customer_id = payment.customer_id
AND amount > 10.00