-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkshop_2.sql
More file actions
58 lines (43 loc) · 836 Bytes
/
workshop_2.sql
File metadata and controls
58 lines (43 loc) · 836 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
49
50
51
52
53
54
SELECT name,TrackId
FROM tracks
WHERE Composer = 'Jorge Ben';
SELECT *
FROM invoices
WHERE total > 25;
SELECT *
FROM invoices
WHERE total<15
LIMIT 5;
SELECT *
FROM invoices
WHERE total>10
ORDER BY total DESC
LIMIT 2;
SELECT *
FROM invoices
WHERE NOT BillingCountry = 'Canada'
ORDER BY total ASC
LIMIT 10;
SELECT InvoiceId,CustomerId,total
FROM invoices
ORDER BY CustomerId ASC, total DESC;
SELECT *
FROM tracks
WHERE name LIKE 'B%S';
SELECT InvoiceDate
FROM invoices
WHERE InvoiceDate BETWEEN '2008-01-01' AND '2011-12-31'
ORDER BY InvoiceDate DESC
LIMIT 1;
SELECT FirstName,LastName, country
FROM customers
WHERE country IN ('Norway','Belgium');
SELECT *
FROM tracks
WHERE Composer LIKE '%Zappa%';
SELECT COUNT (TrackId)
FROM tracks;
SELECT COUNT (InvoiceId)
FROM invoices;
SELECT COUNT(DISTINCT composer)
FROM tracks;