-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQL10Test.sql
More file actions
62 lines (48 loc) · 1.21 KB
/
SQL10Test.sql
File metadata and controls
62 lines (48 loc) · 1.21 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
--Jose Guadarrama
--12/2/2014
--1
Create View Guadarrama.MdClients As
Select * From Guadarrama.Clients
Where State = 'MD';
--2
Select * From Guadarrama.MdClients;
--3
Create View Guadarrama.VaClients As
Select * From Guadarrama.Clients
Where State = 'VA';
--4
Select * From Guadarrama.VaClients;
--5
Create View Guadarrama.DeClients As
Select * From Guadarrama.Clients
Where State = 'DE';
--6
Select * From Guadarrama.DeClients;
--7
Create View Guadarrama.DoverClients As
Select ClientNo, Name, Address, City, State, ZipCode
From Guadarrama.Clients
Where City = 'Dover';
--8
Select * From Guadarrama.DoverClients;
--9
Create View Guadarrama.LargeBalClients As
Select ClientNo, Name, BalDue
From Guadarrama.Clients
Where BalDue > 1500;
--10
Select * From Guadarrama.LargeBalClients;
--11
Create View Guadarrama.AvgInvoiceAmt As
Select ClientNo, Avg(InvoiceAmt) As "AvgInvAmt"
From Guadarrama.Orders
Group By ClientNo;
--12
Select * From Guadarrama.AvgInvoiceAmt;
--13
Create View Guadarrama.NumOfShipments As
Select ShipDate, Count(ShipDate) As "NumShip"
From Guadarrama.Orders
Group By ShipDate;
--14
Select * From Guadarrama.NumOfShipments;