-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQL06Test.sql
More file actions
77 lines (61 loc) · 1.42 KB
/
SQL06Test.sql
File metadata and controls
77 lines (61 loc) · 1.42 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
--Jose Guadarrama
--10.16.2014
--1
Select * From Guadarrama.Clients;
--2
Select * From Guadarrama.Clients
Where State In ('DE');
--3
Select * From Guadarrama.Clients
Where BalDue > 0;
--4
Select * From Guadarrama.Clients
Where BalDue <= 100;
--5
Select City
As "Client Cities"
From Guadarrama.Clients
Order By "Client Cities";
--6
Select Count (ClientNo)
ConCat' data rows in the Clients table.'
As "Number of Clients"
From Guadarrama.Clients;
--7
Select Sum(BalDue)
ConCat' is the sum of the Balance Due column in the Clients table.'
As "Sum of Balance Due"
From Guadarrama.Clients;
--8
Select Avg(BalDue)
ConCat' is the average of the Balance Due column in the Clients table.'
As "Average of Balance Due"
From Guadarrama.Clients;
--9
Select ClientNo, Name, City
From Guadarrama.Clients
Where City In ('Salisbury');
--10
Select Name, City, State, BalDue
From Guadarrama.Clients
Where State In ('DE') And
BalDue = 0;
--11
Select * From Guadarrama.Orders;
--12
Select * From Guadarrama.Orders
Where SaleDate <= '2014-08-10';
--13
Select * From Guadarrama.Orders
Where ClientNo In (10001, 10007, 10015);
--14
Select * From Guadarrama.Orders
Where SaleDate + 2 Days = ShipDate;
--15
Select OrderNo, ClientNo, InvoiceAmt,
Case
When InvoiceAmt < 250 Then 'Small'
When InvoiceAmt < 1000 Then 'Medium'
Else 'Large'
End As "Order Class"
From Guadarrama.Orders;