-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataBase Creation.sql
More file actions
244 lines (236 loc) · 9.26 KB
/
DataBase Creation.sql
File metadata and controls
244 lines (236 loc) · 9.26 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
-- Create Orders Table
CREATE TABLE Orders (
OrderID INT PRIMARY KEY,
CustomerID INT,
OrderDate DATE,
ShippingMethod VARCHAR(50),
Status VARCHAR(50)
);
-- Insert Data into Orders Table
INSERT INTO Orders (OrderID, CustomerID, OrderDate, ShippingMethod, Status) VALUES
(1, 101, '2025-01-01', 'Standard', 'Delivered'),
(2, 102, '2025-01-02', 'Expedited', 'Delivered'),
(3, 103, '2025-01-03', 'Same-day', 'Processing'),
(4, 104, '2025-01-04', 'Expedited', 'Shipped'),
(5, 105, '2025-01-05', 'Standard', 'Cancelled'),
(6, 106, '2025-01-06', 'Same-day', 'Delivered'),
(7, 107, '2025-01-07', 'Expedited', 'Delivered'),
(8, 108, '2025-01-08', 'Standard', 'Delivered'),
(9, 109, '2025-01-09', 'Same-day', 'Processing'),
(10, 110, '2025-01-10', 'Standard', 'Shipped'),
(11, 111, '2025-01-11', 'Expedited', 'Delivered'),
(12, 112, '2025-01-12', 'Same-day', 'Processing'),
(13, 113, '2025-01-13', 'Standard', 'Delivered'),
(14, 114, '2025-01-14', 'Expedited', 'Cancelled'),
(15, 115, '2025-01-15', 'Same-day', 'Shipped'),
(16, 116, '2025-01-16', 'Standard', 'Delivered'),
(17, 117, '2025-01-17', 'Expedited', 'Delivered'),
(18, 118, '2025-01-18', 'Same-day', 'Shipped'),
(19, 119, '2025-01-19', 'Standard', 'Processing'),
(20, 120, '2025-01-20', 'Expedited', 'Cancelled'),
(21, 121, '2025-01-21', 'Standard', 'Delivered'),
(22, 122, '2025-01-22', 'Same-day', 'Shipped'),
(23, 123, '2025-01-23', 'Expedited', 'Processing'),
(24, 124, '2025-01-24', 'Standard', 'Delivered'),
(25, 125, '2025-01-25', 'Expedited', 'Delivered'),
(26, 126, '2025-01-26', 'Same-day', 'Delivered'),
(27, 127, '2025-01-27', 'Standard', 'Shipped'),
(28, 128, '2025-01-28', 'Expedited', 'Cancelled'),
(29, 129, '2025-01-29', 'Same-day', 'Processing'),
(30, 130, '2025-01-30', 'Standard', 'Delivered'),
(31, 131, '2025-01-31', 'Expedited', 'Shipped'),
(32, 132, '2025-02-01', 'Same-day', 'Delivered'),
(33, 133, '2025-02-02', 'Standard', 'Processing'),
(34, 134, '2025-02-03', 'Expedited', 'Delivered'),
(35, 135, '2025-02-04', 'Same-day', 'Cancelled'),
(36, 136, '2025-02-05', 'Standard', 'Delivered'),
(37, 137, '2025-02-06', 'Expedited', 'Shipped'),
(38, 138, '2025-02-07', 'Same-day', 'Delivered'),
(39, 139, '2025-02-08', 'Standard', 'Processing'),
(40, 140, '2025-02-09', 'Expedited', 'Cancelled'),
(41, 141, '2025-02-10', 'Same-day', 'Delivered'),
(42, 142, '2025-02-11', 'Standard', 'Shipped'),
(43, 143, '2025-02-12', 'Expedited', 'Processing'),
(44, 144, '2025-02-13', 'Same-day', 'Delivered'),
(45, 145, '2025-02-14', 'Standard', 'Delivered'),
(46, 146, '2025-02-15', 'Expedited', 'Shipped'),
(47, 147, '2025-02-16', 'Same-day', 'Processing'),
(48, 148, '2025-02-17', 'Standard', 'Delivered'),
(49, 149, '2025-02-18', 'Expedited', 'Delivered'),
(50, 150, '2025-02-19', 'Same-day', 'Cancelled');
-- Create Transportation Table
CREATE TABLE Transportation (
OrderID INT PRIMARY KEY,
CarrierID INT,
ShippingCost DECIMAL(10, 2),
DeliveryDate DATE
);
-- Insert Data into Transportation Table
INSERT INTO Transportation (OrderID, CarrierID, ShippingCost, DeliveryDate) VALUES
(1, 201, 10.5, '2025-01-05'),
(2, 202, 20.0, '2025-01-03'),
(3, 203, 15.0, NULL),
(4, 204, 12.0, '2025-01-08'),
(5, 205, 18.0, '2025-01-10'),
(6, 206, 14.5, '2025-01-07'),
(7, 207, 25.0, '2025-01-09'),
(8, 208, 9.0, '2025-01-12'),
(9, 209, 19.5, '2025-01-11'),
(10, 210, 8.0, '2025-01-15'),
(11, 211, 17.0, '2025-01-06'),
(12, 212, 22.5, '2025-01-14'),
(13, 213, 10.0, NULL),
(14, 214, 13.0, '2025-01-16'),
(15, 215, 21.5, '2025-01-17'),
(16, 216, 15.0, '2025-01-18'),
(17, 217, 9.5, '2025-01-19'),
(18, 218, 18.5, '2025-01-20'),
(19, 219, 11.0, '2025-01-21'),
(20, 220, 16.0, '2025-01-22'),
(21, 221, 19.0, '2025-01-23'),
(22, 222, 12.5, '2025-01-24'),
(23, 223, 14.0, '2025-01-25'),
(24, 224, 20.5, NULL),
(25, 225, 8.5, '2025-01-26'),
(26, 226, 22.0, '2025-01-27'),
(27, 227, 13.5, '2025-01-28'),
(28, 228, 17.5, '2025-01-29'),
(29, 229, 9.0, '2025-01-30'),
(30, 230, 11.5, '2025-01-31'),
(31, 231, 18.0, '2025-02-01'),
(32, 232, 16.5, '2025-02-02'),
(33, 233, 10.5, '2025-02-03'),
(34, 234, 12.0, '2025-02-04'),
(35, 235, 21.0, '2025-02-05'),
(36, 236, 14.5, '2025-02-06'),
(37, 237, 19.5, NULL),
(38, 238, 8.0, '2025-02-07'),
(39, 239, 22.5, '2025-02-08'),
(40, 240, 15.5, '2025-02-09'),
(41, 241, 13.0, '2025-02-10'),
(42, 242, 17.0, '2025-02-11'),
(43, 243, 11.0, '2025-02-12'),
(44, 244, 12.5, '2025-02-13'),
(45, 245, 20.0, '2025-02-14'),
(46, 246, 15.0, '2025-02-15'),
(47, 247, 10.0, '2025-02-16'),
(48, 248, 21.5, '2025-02-17'),
(49, 249, 19.0, '2025-02-18'),
(50, 250, 14.0, '2025-02-19');
-- Create Carriers Table
CREATE TABLE Carriers (
CarrierID INT PRIMARY KEY,
CarrierName VARCHAR(50),
Region VARCHAR(50)
);
-- Insert Data into Carriers Table
INSERT INTO Carriers (CarrierID, CarrierName, Region) VALUES
(201, 'FastTrack', 'North-East'),
(202, 'QuickShip', 'North-West'),
(203, 'PrimeExpress', 'South'),
(204, 'ExpressShip', 'Central'),
(205, 'SafeWay', 'North-East'),
(206, 'RapidLogistics', 'South'),
(207, 'SuperCarrier', 'North-West'),
(208, 'ReliableShip', 'Central'),
(209, 'QuickGo', 'North-East'),
(210, 'BestCarrier', 'North-West'),
(211, 'SpeedyExpress', 'South'),
(212, 'EconomyShip', 'North-East'),
(213, 'TurboTransport', 'North-West'),
(214, 'NextDayCargo', 'Central'),
(215, 'GlobalCourier', 'South'),
(216, 'EliteLogistics', 'North-East'),
(217, 'FastWay', 'North-West'),
(218, 'SecureTransit', 'Central'),
(219, 'PrimeDelivery', 'South'),
(220, 'ReliableCargo', 'North-East'),
(221, 'CargoLink', 'North-West'),
(222, 'SwiftCarrier', 'South'),
(223, 'TrackFast', 'Central'),
(224, 'AirTransit', 'North-East'),
(225, 'GroundLink', 'North-West'),
(226, 'FleetExpress', 'South'),
(227, 'LogiSecure', 'Central'),
(228, 'ZipCarrier', 'North-East'),
(229, 'ShipFast', 'North-West'),
(230, 'FastCargo', 'South'),
(231, 'PriorityLink', 'Central'),
(232, 'RoadRunner', 'North-East'),
(233, 'CargoPlus', 'North-West'),
(234, 'PaceLogistics', 'South'),
(235, 'OnTimeCarrier', 'Central'),
(236, 'SwiftLink', 'North-East'),
(237, 'ReliableExpress', 'North-West'),
(238, 'QuickTransit', 'South'),
(239, 'SecureShip', 'Central'),
(240, 'EliteCarrier', 'North-East'),
(241, 'QuickTrack', 'North-West'),
(242, 'AirLink', 'South'),
(243, 'FastTransit', 'Central'),
(244, 'TurboLink', 'North-East'),
(245, 'GlobalCarrier', 'North-West'),
(246, 'DirectTransit', 'South'),
(247, 'ReliableWay', 'Central'),
(248, 'SpeedCargo', 'North-East'),
(249, 'NextLevelLogistics', 'North-West'),
(250, 'EfficientExpress', 'South');
-- Create Customers Table
CREATE TABLE Customers (
CustomerID INT PRIMARY KEY,
Name VARCHAR(50),
Address VARCHAR(100),
Region VARCHAR(50)
);
-- Insert Data into Customers Table
INSERT INTO Customers (CustomerID, Name, Address, Region) VALUES
(101, 'John Doe', '123 Elm St, NY', 'North-East'),
(102, 'Jane Smith', '456 Oak St, CA', 'North-West'),
(103, 'Alex Johnson', '789 Pine St, TX', 'South'),
(104, 'Maria Gonzalez', '321 Maple St, WA', 'North-East'),
(105, 'Chen Wei', '987 Cedar St, NY', 'North-West'),
(106, 'Ahmed Ali', '654 Birch St, FL', 'South'),
(107, 'Emily Davis', '369 Willow St, IL', 'Central'),
(108, 'James Brown', '741 Spruce St, GA', 'South'),
(109, 'Oliver Wilson', '852 Ash St, MO', 'North-East'),
(110, 'Sophia Martinez', '963 Fir St, NJ', 'Central'),
(111, 'Liam Smith', '123 Pine St, TX', 'South'),
(112, 'Emma Thompson', '456 Maple St, WA', 'North-East'),
(113, 'Noah White', '789 Birch St, FL', 'North-West'),
(114, 'Isabella Taylor', '321 Oak St, CA', 'North-West'),
(115, 'Mason Harris', '963 Cedar St, NY', 'Central'),
(116, 'Ava Anderson', '741 Elm St, GA', 'South'),
(117, 'Lucas Scott', '654 Spruce St, IL', 'North-East'),
(118, 'Mia Wright', '852 Willow St, MO', 'Central'),
(119, 'Ethan Martinez', '369 Ash St, GA', 'South'),
(120, 'Charlotte Lewis', '963 Fir St, NJ', 'North-East'),
(121, 'Logan Carter', '123 Pine St, TX', 'South'),
(122, 'Amelia Hill', '852 Maple St, WA', 'North-West'),
(123, 'Elijah Adams', '654 Birch St, FL', 'South'),
(124, 'Harper Bell', '963 Oak St, CA', 'Central'),
(125, 'Benjamin Garcia', '123 Cedar St, NY', 'North-East'),
(126, 'Evelyn Green', '456 Spruce St, IL', 'South'),
(127, 'Jack Baker', '369 Elm St, GA', 'Central'),
(128, 'Abigail Perez', '741 Willow St, MO', 'North-West'),
(129, 'Henry Rivera', '963 Fir St, NJ', 'North-East'),
(130, 'Sophia Cooper', '852 Pine St, TX', 'South'),
(131, 'Samuel Howard', '654 Maple St, WA', 'North-West'),
(132, 'Emily Ward', '369 Birch St, FL', 'South'),
(133, 'Ella Kelly', '963 Oak St, CA', 'Central'),
(134, 'Daniel Walker', '852 Cedar St, NY', 'North-East'),
(135, 'Oliver Gray', '456 Elm St, GA', 'North-West'),
(136, 'Avery Young', '741 Spruce St, IL', 'South'),
(137, 'Nathan Hall', '321 Willow St, MO', 'Central'),
(138, 'Lily Lopez', '963 Ash St, NJ', 'North-East'),
(139, 'Sebastian King', '654 Fir St, TX', 'South'),
(140, 'Grace Turner', '852 Maple St, WA', 'North-West'),
(141, 'Jackson Morgan', '963 Cedar St, NY', 'South'),
(142, 'Victoria Morris', '321 Elm St, GA', 'Central'),
(143, 'Aria Sanchez', '456 Willow St, MO', 'North-West'),
(144, 'Matthew Hughes', '963 Ash St, NJ', 'North-East'),
(145, 'Scarlett Lee', '852 Fir St, TX', 'South'),
(146, 'Levi Bennett', '654 Maple St, WA', 'Central'),
(147, 'Zoey Phillips', '741 Birch St, FL', 'South'),
(148, 'William Reed', '369 Oak St, CA', 'North-East'),
(149, 'Ella Cook', '123 Cedar St, NY', 'North-West'),
(150, 'Alexander Murphy', '456 Elm St, GA', 'Central');