Skip to content

Commit

Permalink
formated duration & actual_status CSV files along with their tables
Browse files Browse the repository at this point in the history
  • Loading branch information
vagman committed Jul 9, 2022
1 parent a5a38c9 commit 1e16294
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 265 deletions.
11 changes: 4 additions & 7 deletions airline_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ CREATE TABLE flight

CREATE TABLE actual_status
(
flight_id INT,
flight_status VARCHAR(9) NOT NULL,
actual_departure_time TIMESTAMPTZ,
actual_arrival_time TIMESTAMPTZ,
flight_status VARCHAR(9) NOT NULL,
flight_id INT,
--departure_date DATE, --einai to scheduled_departure_time opote kai na ginei Cancelled mia ptisi den mas peirazei. Emeis mesw tou departure_date KAI tou flight_id mporoyme na prosdiorisoume ta upoloipa

CHECK (flight_status IN ('Scheduled', 'OnTime', 'Delayed', 'Departed', 'Arrived', 'Cancelled')),
Expand All @@ -93,14 +93,11 @@ CREATE TABLE actual_status

CREATE TABLE duration
(
flight_id INT UNIQUE NOT NULL,
scheduled_departure_time TIMESTAMPTZ,
scheduled_arrival_time TIMESTAMPTZ,
scheduled_duration VARCHAR(20), --to vazw proswrina varchar giati mesa stis eggrafes exoume grapsei kai to 'hours' (px 12.4 hours)
scheduled_duration VARCHAR(20),

--το ειχαμε βαλει ως interval ομως απο τα δεδομενα του mockaroo δεν μπορουμε να κανουμε κατι. Ετσι εφτιαξα ολες τις ωρες και την διαφορα τους(scheduled_duration) χειροκινητα
--scheduled_duration INTERVAL, --NOT NULL GENERATED ALWAYS AS (scheduled_arrival_time - scheduled_departure_time) STORED,
flight_id INT UNIQUE NOT NULL,

CHECK (scheduled_arrival_time > scheduled_departure_time),

FOREIGN KEY (flight_id) REFERENCES flight(flight_id),
Expand Down
86 changes: 0 additions & 86 deletions data/(old) flight - dept_date with times.csv

This file was deleted.

172 changes: 86 additions & 86 deletions data/actual_status.csv
Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
actual_departure_time,actual_arrival_time,flight_status,flight_id
6/25/2022 6:50,6/25/2022 17:08,Delayed,2
6/17/2022 0:41,,Departed,4
6/29/2022 4:58,6/29/2022 12:33,OnTime,5
6/14/2022 8:06,6/15/2022 5:30,Arrived,6
6/8/2022 5:59,6/9/2022 0:23,Delayed,7
7/2/2022 12:55,7/3/2022 8:19,Scheduled,8
6/8/2022 6:52,6/8/2022 7:04,OnTime,9
6/20/2022 13:41,,Departed,10
,,Cancelled,11
7/6/2022 19:38,7/7/2022 11:44,Departed,12
6/22/2022 7:11,6/22/2022 23:17,OnTime,13
,,Cancelled,14
,,Cancelled,15
6/8/2022 3:39,6/8/2022 14:15,OnTime,16
6/20/2022 18:20,6/21/2022 7:56,Delayed,17
7/6/2022 19:31,7/7/2022 11:13,OnTime,18
6/10/2022 2:48,6/10/2022 10:12,OnTime,19
6/16/2022 4:13,6/17/2022 1:13,Arrived,20
6/12/2022 15:10,6/12/2022 23:40,Scheduled,21
6/8/2022 19:44,6/8/2022 23:44,Arrived,22
6/20/2022 6:49,,Departed,23
6/10/2022 21:50,,Departed,24
7/6/2022 21:13,,Departed,25
6/13/2022 12:33,6/13/2022 23:15,Arrived,26
6/8/2022 9:28,6/9/2022 3:10,Arrived,27
6/17/2022 9:59,,Departed,28
,,Cancelled,29
,,Cancelled,30
6/15/2022 9:08,6/16/2022 7:14,Delayed,32
6/27/2022 22:14,6/28/2022 18:56,Arrived,33
6/13/2022 4:00,,Departed,34
6/18/2022 15:07,,Departed,36
6/23/2022 3:57,6/23/2022 11:21,Arrived,37
7/4/2022 22:44,7/5/2022 11:38,Delayed,38
6/29/2022 9:40,6/29/2022 21:10,Arrived,39
6/11/2022 10:12,6/11/2022 20:24,Scheduled,40
,,Cancelled,41
,,Cancelled,42
6/25/2022 13:08,6/26/2022 8:56,OnTime,43
,,Cancelled,44
,,Cancelled,45
7/1/2022 0:00,7/1/2022 10:18,Arrived,46
6/17/2022 12:02,,Departed,47
,,Cancelled,48
6/26/2022 3:34,,Departed,49
,,Cancelled,50
6/17/2022 12:02,6/17/2022 18:26,OnTime,51
6/10/2022 12:23,6/10/2022 21:23,Arrived,52
6/25/2022 10:54,6/26/2022 4:18,Arrived,55
6/10/2022 12:28,6/11/2022 5:46,OnTime,56
6/24/2022 2:46,6/24/2022 14:58,Arrived,57
,,Cancelled,61
7/2/2022 7:16,7/2/2022 7:52,Delayed,64
7/1/2022 4:48,,Departed,65
6/25/2022 10:18,,Departed,66
6/15/2022 17:47,6/15/2022 22:23,Scheduled,67
6/25/2022 14:03,6/26/2022 6:57,OnTime,68
7/1/2022 4:37,,Departed,69
,,Cancelled,70
6/13/2022 17:52,6/14/2022 3:34,Delayed,71
6/20/2022 10:55,6/20/2022 11:19,Delayed,72
6/16/2022 7:42,6/16/2022 10:48,Arrived,73
6/20/2022 4:49,6/20/2022 6:01,Scheduled,74
7/1/2022 12:26,7/1/2022 21:26,Scheduled,75
6/18/2022 16:59,6/19/2022 14:23,OnTime,76
6/30/2022 9:46,6/30/2022 15:58,OnTime,77
6/20/2022 5:14,6/20/2022 13:44,Arrived,78
6/23/2022 9:35,6/24/2022 1:53,Arrived,79
6/8/2022 0:25,6/8/2022 4:25,OnTime,80
6/20/2022 9:27,,Departed,81
6/25/2022 23:49,6/26/2022 23:43,Arrived,82
,,Cancelled,83
6/16/2022 14:24,,Departed,84
6/15/2022 8:54,,Departed,85
6/28/2022 8:42,6/29/2022 5:24,Scheduled,86
6/12/2022 19:01,,Departed,88
7/3/2022 14:45,,Departed,90
6/14/2022 4:13,6/14/2022 5:13,OnTime,91
6/7/2022 17:38,,Departed,93
6/27/2022 22:45,6/28/2022 12:03,Scheduled,94
6/20/2022 4:15,6/20/2022 16:03,Scheduled,95
6/29/2022 13:34,6/30/2022 4:04,Scheduled,96
6/28/2022 0:00,6/28/2022 17:42,Scheduled,97
6/22/2022 18:15,6/22/2022 22:39,Arrived,98
7/6/2022 10:21,7/7/2022 9:57,OnTime,99
flight_id,flight_status,actual_departure_time,actual_arrival_time
2,Departed,2022-05-31 14:15:55,2021-10-10 23:23:15
4,Delayed,2022-02-28 20:39:59,2022-03-03 18:30:24
5,Cancelled,2022-02-28 19:13:16,2022-02-07 09:37:25
6,Cancelled,2021-09-17 08:14:14,2021-11-12 09:45:50
7,Cancelled,2022-02-21 23:57:27,2022-04-28 18:47:56
8,Scheduled,2022-06-25 22:07:55,2022-04-08 07:21:03
9,Departed,2022-05-19 00:08:31,2022-07-04 12:38:17
10,Scheduled,2021-09-17 04:57:08,2021-11-17 18:51:30
11,Departed,2022-04-03 13:56:38,
12,Arrived,2022-04-04 20:45:10,2022-06-23 05:59:40
13,Cancelled,2022-04-01 13:14:55,2022-06-23 21:42:22
14,Scheduled,2022-03-01 11:56:59,2022-05-22 19:26:35
15,Scheduled,2022-01-29 15:56:48,
16,OnTime,2022-05-24 15:49:18,2021-10-23 05:23:27
17,Arrived,2021-10-07 11:20:40,2021-09-17 02:50:14
18,Scheduled,2021-12-18 05:34:48,
19,Departed,2022-01-11 07:22:46,2021-11-06 11:24:03
20,Delayed,2022-05-14 20:11:24,2021-11-01 01:07:09
21,Departed,2021-07-17 16:34:23,2022-01-07 04:26:36
22,Arrived,,
23,Delayed,,2021-08-02 22:19:55
24,Scheduled,2022-05-04 19:38:27,2021-08-28 05:32:53
25,Arrived,2021-11-30 21:22:24,2021-12-24 12:57:22
26,Arrived,2021-07-14 16:31:54,2022-07-06 13:14:35
27,Departed,2022-01-31 00:49:42,2022-06-08 14:56:32
28,Cancelled,2022-01-14 02:08:03,2022-02-18 06:21:56
29,Departed,2021-12-19 08:33:09,2021-11-14 09:08:55
30,Scheduled,2021-10-03 04:22:14,2022-06-20 19:37:44
32,OnTime,2021-08-21 21:03:53,2021-09-06 13:29:47
33,Delayed,2021-08-01 03:26:37,2021-09-23 13:12:50
34,Arrived,2022-02-25 20:54:01,2022-04-26 16:01:44
36,Scheduled,2022-02-27 06:04:17,2022-05-28 12:00:41
37,Delayed,2021-11-10 09:35:45,
38,Delayed,2022-04-15 20:53:59,2022-03-08 00:10:30
39,Departed,2021-12-23 01:27:42,2022-03-23 02:06:30
40,Scheduled,2022-06-19 23:32:14,2021-11-24 07:25:37
41,Departed,2021-08-10 14:09:54,2022-06-12 16:28:58
42,OnTime,2022-04-02 10:34:02,
43,Scheduled,2021-12-10 21:13:42,2022-05-16 22:29:47
44,Scheduled,2022-06-11 21:45:04,2022-04-11 02:19:10
45,Cancelled,2021-09-10 02:17:07,
46,Arrived,2022-03-28 15:22:11,2021-08-16 02:41:15
47,Delayed,2022-05-30 13:10:52,
48,Scheduled,2021-12-22 12:48:52,2022-01-30 14:32:22
49,Arrived,2022-02-25 15:55:11,2022-04-11 21:29:15
50,OnTime,2021-10-17 16:13:26,
51,OnTime,2021-07-22 23:54:56,2022-01-27 06:34:54
52,Cancelled,2022-05-19 02:44:15,
55,Departed,2021-10-09 22:07:40,2021-12-16 07:51:06
56,OnTime,,
57,Scheduled,2021-09-27 00:42:11,
61,Departed,2021-11-02 15:14:11,2022-03-01 14:01:30
64,Arrived,2022-04-17 04:00:07,2021-10-21 21:33:03
65,Delayed,2022-03-21 00:06:28,2021-12-17 08:42:07
66,OnTime,2022-02-12 13:41:22,
67,Scheduled,,
68,Arrived,2021-12-09 03:00:33,2022-04-05 12:56:48
69,OnTime,2022-06-12 14:15:28,2022-05-08 03:26:12
70,Scheduled,2022-03-27 15:14:26,2022-01-15 23:55:48
71,Delayed,2022-03-19 05:05:40,
72,OnTime,2022-01-31 06:54:56,
73,OnTime,2021-09-27 01:56:59,2022-02-20 08:51:38
74,Delayed,2022-02-11 18:46:22,
75,Delayed,2021-12-15 12:27:39,
76,Departed,,2022-05-24 15:39:56
77,Cancelled,2022-03-03 08:02:40,2022-05-08 05:32:11
78,Arrived,2021-10-15 04:40:26,
79,Departed,2022-03-01 01:03:52,2021-11-05 17:28:04
80,Arrived,2021-07-19 08:15:26,2022-06-25 11:01:09
81,Cancelled,2021-10-30 03:06:01,2021-11-23 09:59:24
82,OnTime,2022-06-24 06:30:25,2021-09-05 23:22:57
83,OnTime,2022-01-03 01:05:36,2021-12-31 17:34:13
84,Scheduled,2021-08-07 23:19:20,2021-11-26 01:08:34
85,Departed,2021-10-16 17:10:54,2021-10-26 06:36:20
86,Departed,2021-10-21 07:14:37,
88,Arrived,2021-12-25 23:18:22,2021-10-23 15:35:26
90,OnTime,2021-08-03 08:56:15,2022-04-18 01:24:32
91,OnTime,2021-07-21 14:19:30,
93,Delayed,2022-04-24 03:14:11,2022-02-10 08:59:51
94,Cancelled,2021-08-23 14:52:45,2022-03-28 14:27:01
95,Departed,2021-09-27 19:10:26,
96,Delayed,2022-01-05 05:55:38,2022-02-25 12:16:16
97,Departed,2021-09-19 23:51:37,2021-11-26 20:16:47
98,OnTime,2022-04-19 04:36:27,
99,Scheduled,2021-10-27 10:23:27,
Loading

0 comments on commit 1e16294

Please sign in to comment.