-
Notifications
You must be signed in to change notification settings - Fork 11
/
Chinook example queries.txt
61 lines (56 loc) · 1.09 KB
/
Chinook example queries.txt
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
select
al.*,
ar.*,
t.*,
mt.*,
g.*
from
Album al
inner join Artist ar
on (al.ArtistId = ar.ArtistId)
inner join Track t
on (t.AlbumId = al.AlbumId)
inner join MediaType mt
on (mt.MediaTypeId = t.MediaTypeId)
inner join Genre g
on (g.GenreId = t.GenreId)
select
*
from
Customer c
select
*
from
Employee e
select
*
from
PlayList pl
inner join PlayListTrack plt
on (plt.PlayListId = pl.PlayListId)
inner join Track t
on (t.TrackId = plt.TrackId)
inner join Album al
on (al.AlbumId = t.AlbumId)
inner join MediaType mt
on (mt.MediaTypeId = t.MediaTypeId)
inner join Genre g
on (g.GenreId = t.GenreId)
select
*
from
InvoiceLine il
inner join Invoice i
on (i.InvoiceId = il.InvoiceId)
inner join Customer c
on (c.CustomerId = i.CustomerId)
inner join Employee e
on (e.EmployeeId = c.SupportRepId)
inner join Track t
on (il.TrackId = t.TrackId)
inner join Album al
on (al.AlbumId = t.AlbumId)
inner join MediaType mt
on (mt.MediaTypeId = t.MediaTypeId)
inner join Genre g
on (g.GenreId = t.GenreId)