|
1 | | -update Customer set Region='British Isles' where Country='UK'; |
2 | | -update Customer set Region='British Isles' where Country='Ireland'; |
3 | | -update Customer set Region='North America' where Country='USA'; |
4 | | -update Customer set Region='North America' where Country='Canada'; |
5 | | -update Customer set Region='Central America' where Country='Mexico'; |
6 | | -update Customer set Region='South America' where Country='Argentina'; |
7 | | -update Customer set Region='South America' where Country='Brazil'; |
8 | | -update Customer set Region='South America' where Country='Venezuela'; |
9 | | -update Customer set Region='Eastern Europe' where Country='Poland'; |
10 | | -update Customer set Region='Northern Europe' where Country='Sweden'; |
11 | | -update Customer set Region='Northern Europe' where Country='Denmark'; |
12 | | -update Customer set Region='Southern Europe' where Country='Spain'; |
13 | | -update Customer set Region='Southern Europe' where Country='Italy'; |
14 | | -update Customer set Region='Southern Europe' where Country='Portugal'; |
15 | | -update Customer set Region='Western Europe' where Country='Germany'; |
16 | | -update Customer set Region='Western Europe' where Country='France'; |
17 | | -update Customer set Region='Western Europe' where Country='Belgium'; |
18 | | -update Customer set Region='Western Europe' where Country='Switzerland'; |
19 | | -update Customer set Region='Western Europe' where Country='Austria'; |
20 | | -update Customer set Region='Scandinavia' where Country='Norway'; |
21 | | -update Customer set Region='Scandinavia' where Country='Finland'; |
| 1 | +update [Customers] set Region='British Isles' where Country='UK'; |
| 2 | +update [Customers] set Region='British Isles' where Country='Ireland'; |
| 3 | +update [Customers] set Region='North America' where Country='USA'; |
| 4 | +update [Customers] set Region='North America' where Country='Canada'; |
| 5 | +update [Customers] set Region='Central America' where Country='Mexico'; |
| 6 | +update [Customers] set Region='South America' where Country='Argentina'; |
| 7 | +update [Customers] set Region='South America' where Country='Brazil'; |
| 8 | +update [Customers] set Region='South America' where Country='Venezuela'; |
| 9 | +update [Customers] set Region='Eastern Europe' where Country='Poland'; |
| 10 | +update [Customers] set Region='Northern Europe' where Country='Sweden'; |
| 11 | +update [Customers] set Region='Northern Europe' where Country='Denmark'; |
| 12 | +update [Customers] set Region='Southern Europe' where Country='Spain'; |
| 13 | +update [Customers] set Region='Southern Europe' where Country='Italy'; |
| 14 | +update [Customers] set Region='Southern Europe' where Country='Portugal'; |
| 15 | +update [Customers] set Region='Western Europe' where Country='Germany'; |
| 16 | +update [Customers] set Region='Western Europe' where Country='France'; |
| 17 | +update [Customers] set Region='Western Europe' where Country='Belgium'; |
| 18 | +update [Customers] set Region='Western Europe' where Country='Switzerland'; |
| 19 | +update [Customers] set Region='Western Europe' where Country='Austria'; |
| 20 | +update [Customers] set Region='Scandinavia' where Country='Norway'; |
| 21 | +update [Customers] set Region='Scandinavia' where Country='Finland'; |
22 | 22 |
|
23 | | -update Employee set Region='British Isles' where Country='UK'; |
24 | | -update Employee set Region='North America' where Country='USA'; |
25 | | -update [Employee] set BirthDate = date(BirthDate,'+16 year'); |
26 | | -update [Employee] set HireDate = date(HireDate,'+16 year'); |
| 23 | +update [Employees] set Region='British Isles' where Country='UK'; |
| 24 | +update [Employees] set Region='North America' where Country='USA'; |
| 25 | +update [Employees] set BirthDate = date(BirthDate,'+16 year'); |
| 26 | +update [Employees] set HireDate = date(HireDate,'+16 year'); |
27 | 27 |
|
28 | | -update [Order] set ShipRegion='British Isles' where ShipCountry='UK'; |
29 | | -update [Order] set ShipRegion='British Isles' where ShipCountry='Ireland'; |
30 | | -update [Order] set ShipRegion='North America' where ShipCountry='USA'; |
31 | | -update [Order] set ShipRegion='North America' where ShipCountry='Canada'; |
32 | | -update [Order] set ShipRegion='Central America' where ShipCountry='Mexico'; |
33 | | -update [Order] set ShipRegion='South America' where ShipCountry='Argentina'; |
34 | | -update [Order] set ShipRegion='South America' where ShipCountry='Brazil'; |
35 | | -update [Order] set ShipRegion='South America' where ShipCountry='Venezuela'; |
36 | | -update [Order] set ShipRegion='Eastern Europe' where ShipCountry='Poland'; |
37 | | -update [Order] set ShipRegion='Northern Europe' where ShipCountry='Sweden'; |
38 | | -update [Order] set ShipRegion='Northern Europe' where ShipCountry='Denmark'; |
39 | | -update [Order] set ShipRegion='Southern Europe' where ShipCountry='Spain'; |
40 | | -update [Order] set ShipRegion='Southern Europe' where ShipCountry='Italy'; |
41 | | -update [Order] set ShipRegion='Southern Europe' where ShipCountry='Portugal'; |
42 | | -update [Order] set ShipRegion='Western Europe' where ShipCountry='Germany'; |
43 | | -update [Order] set ShipRegion='Western Europe' where ShipCountry='France'; |
44 | | -update [Order] set ShipRegion='Western Europe' where ShipCountry='Belgium'; |
45 | | -update [Order] set ShipRegion='Western Europe' where ShipCountry='Switzerland'; |
46 | | -update [Order] set ShipRegion='Western Europe' where ShipCountry='Austria'; |
47 | | -update [Order] set ShipRegion='Scandinavia' where ShipCountry='Norway'; |
48 | | -update [Order] set ShipRegion='Scandinavia' where ShipCountry='Finland'; |
| 28 | +update [Orders] set ShipRegion='British Isles' where ShipCountry='UK'; |
| 29 | +update [Orders] set ShipRegion='British Isles' where ShipCountry='Ireland'; |
| 30 | +update [Orders] set ShipRegion='North America' where ShipCountry='USA'; |
| 31 | +update [Orders] set ShipRegion='North America' where ShipCountry='Canada'; |
| 32 | +update [Orders] set ShipRegion='Central America' where ShipCountry='Mexico'; |
| 33 | +update [Orders] set ShipRegion='South America' where ShipCountry='Argentina'; |
| 34 | +update [Orders] set ShipRegion='South America' where ShipCountry='Brazil'; |
| 35 | +update [Orders] set ShipRegion='South America' where ShipCountry='Venezuela'; |
| 36 | +update [Orders] set ShipRegion='Eastern Europe' where ShipCountry='Poland'; |
| 37 | +update [Orders] set ShipRegion='Northern Europe' where ShipCountry='Sweden'; |
| 38 | +update [Orders] set ShipRegion='Northern Europe' where ShipCountry='Denmark'; |
| 39 | +update [Orders] set ShipRegion='Southern Europe' where ShipCountry='Spain'; |
| 40 | +update [Orders] set ShipRegion='Southern Europe' where ShipCountry='Italy'; |
| 41 | +update [Orders] set ShipRegion='Southern Europe' where ShipCountry='Portugal'; |
| 42 | +update [Orders] set ShipRegion='Western Europe' where ShipCountry='Germany'; |
| 43 | +update [Orders] set ShipRegion='Western Europe' where ShipCountry='France'; |
| 44 | +update [Orders] set ShipRegion='Western Europe' where ShipCountry='Belgium'; |
| 45 | +update [Orders] set ShipRegion='Western Europe' where ShipCountry='Switzerland'; |
| 46 | +update [Orders] set ShipRegion='Western Europe' where ShipCountry='Austria'; |
| 47 | +update [Orders] set ShipRegion='Scandinavia' where ShipCountry='Norway'; |
| 48 | +update [Orders] set ShipRegion='Scandinavia' where ShipCountry='Finland'; |
49 | 49 |
|
50 | | -update [Order] set OrderDate = date(OrderDate,'+16 year'); |
51 | | -update [Order] set RequiredDate = date(RequiredDate,'+16 year'); |
52 | | -update [Order] set ShippedDate = date(ShippedDate,'+16 year'); |
| 50 | +update [Orders] set OrderDate = date(OrderDate,'+16 year'); |
| 51 | +update [Orders] set RequiredDate = date(RequiredDate,'+16 year'); |
| 52 | +update [Orders] set ShippedDate = date(ShippedDate,'+16 year'); |
53 | 53 |
|
54 | | -update [Supplier] set Region='British Isles' where Country='UK'; |
55 | | -update [Supplier] set Region='British Isles' where Country='Ireland'; |
56 | | -update [Supplier] set Region='North America' where Country='USA'; |
57 | | -update [Supplier] set Region='North America' where Country='Canada'; |
58 | | -update [Supplier] set Region='Central America' where Country='Mexico'; |
59 | | -update [Supplier] set Region='South America' where Country='Argentina'; |
60 | | -update [Supplier] set Region='South America' where Country='Brazil'; |
61 | | -update [Supplier] set Region='South America' where Country='Venezuela'; |
62 | | -update [Supplier] set Region='Eastern Europe' where Country='Poland'; |
63 | | -update [Supplier] set Region='Northern Europe' where Country='Sweden'; |
64 | | -update [Supplier] set Region='Northern Europe' where Country='Denmark'; |
65 | | -update [Supplier] set Region='Southern Europe' where Country='Spain'; |
66 | | -update [Supplier] set Region='Southern Europe' where Country='Italy'; |
67 | | -update [Supplier] set Region='Southern Europe' where Country='Portugal'; |
68 | | -update [Supplier] set Region='Western Europe' where Country='Germany'; |
69 | | -update [Supplier] set Region='Western Europe' where Country='France'; |
70 | | -update [Supplier] set Region='Western Europe' where Country='Belgium'; |
71 | | -update [Supplier] set Region='Western Europe' where Country='Switzerland'; |
72 | | -update [Supplier] set Region='Western Europe' where Country='Austria'; |
73 | | -update [Supplier] set Region='Scandinavia' where Country='Norway'; |
74 | | -update [Supplier] set Region='Scandinavia' where Country='Finland'; |
75 | | -update [Supplier] set Region='Eastern Asia' where Country='Japan'; |
76 | | -update [Supplier] set Region='South-East Asia' where Country='Singapore'; |
77 | | -update [Supplier] set Region='Northern Europe' where Country='Netherlands'; |
| 54 | +update [Suppliers] set Region='British Isles' where Country='UK'; |
| 55 | +update [Suppliers] set Region='British Isles' where Country='Ireland'; |
| 56 | +update [Suppliers] set Region='North America' where Country='USA'; |
| 57 | +update [Suppliers] set Region='North America' where Country='Canada'; |
| 58 | +update [Suppliers] set Region='Central America' where Country='Mexico'; |
| 59 | +update [Suppliers] set Region='South America' where Country='Argentina'; |
| 60 | +update [Suppliers] set Region='South America' where Country='Brazil'; |
| 61 | +update [Suppliers] set Region='South America' where Country='Venezuela'; |
| 62 | +update [Suppliers] set Region='Eastern Europe' where Country='Poland'; |
| 63 | +update [Suppliers] set Region='Northern Europe' where Country='Sweden'; |
| 64 | +update [Suppliers] set Region='Northern Europe' where Country='Denmark'; |
| 65 | +update [Suppliers] set Region='Southern Europe' where Country='Spain'; |
| 66 | +update [Suppliers] set Region='Southern Europe' where Country='Italy'; |
| 67 | +update [Suppliers] set Region='Southern Europe' where Country='Portugal'; |
| 68 | +update [Suppliers] set Region='Western Europe' where Country='Germany'; |
| 69 | +update [Suppliers] set Region='Western Europe' where Country='France'; |
| 70 | +update [Suppliers] set Region='Western Europe' where Country='Belgium'; |
| 71 | +update [Suppliers] set Region='Western Europe' where Country='Switzerland'; |
| 72 | +update [Suppliers] set Region='Western Europe' where Country='Austria'; |
| 73 | +update [Suppliers] set Region='Scandinavia' where Country='Norway'; |
| 74 | +update [Suppliers] set Region='Scandinavia' where Country='Finland'; |
| 75 | +update [Suppliers] set Region='Eastern Asia' where Country='Japan'; |
| 76 | +update [Suppliers] set Region='South-East Asia' where Country='Singapore'; |
| 77 | +update [Suppliers] set Region='Northern Europe' where Country='Netherlands'; |
78 | 78 |
|
79 | 79 |
|
80 | 80 | create view [ProductDetails_V] as |
81 | 81 | select |
82 | 82 | p.*, |
83 | 83 | c.CategoryName, c.Description as [CategoryDescription], |
84 | 84 | s.CompanyName as [SupplierName], s.Region as [SupplierRegion] |
85 | | -from [Product] p |
86 | | -join [Category] c on p.CategoryId = c.id |
87 | | -join [Supplier] s on s.id = p.SupplierId; |
| 85 | +from [Products] p |
| 86 | +join [Categories] c on p.CategoryId = c.id |
| 87 | +join [Suppliers] s on s.id = p.SupplierId; |
88 | 88 |
|
0 commit comments