-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
executable file
·57 lines (52 loc) · 1.46 KB
/
schema.sql
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
DROP DATABASE IF EXISTS travel;
CREATE DATABASE travel;
USE travel;
-- Create syntax for TABLE 'airlines'
CREATE TABLE airlines (
iata_code CHAR(2) DEFAULT NULL,
airline VARCHAR(30) DEFAULT NULL
) engine=columnstore default character set=utf8;
-- Create syntax for TABLE 'airports'
CREATE TABLE airports (
iata_code CHAR(3) DEFAULT NULL,
airport VARCHAR(80) DEFAULT NULL,
city VARCHAR(30) DEFAULT NULL,
`state` CHAR(2) DEFAULT NULL,
country VARCHAR(30) DEFAULT NULL,
latitude FLOAT DEFAULT NULL,
longitude FLOAT DEFAULT NULL
) engine=columnstore default character set=utf8;
CREATE TABLE flights (
year smallint,
month tinyint,
day tinyint,
day_of_week tinyint,
fl_date date,
carrier char(2),
tail_num char(6),
fl_num smallint,
origin varchar(5),
dest varchar(5),
crs_dep_time char(4),
dep_time char(4),
dep_delay smallint,
taxi_out smallint,
wheels_off char(4),
wheels_on char(4),
taxi_in smallint,
crs_arr_time char(4),
arr_time char(4),
arr_delay smallint,
cancelled smallint,
cancellation_code smallint,
diverted smallint,
crs_elapsed_time smallint,
actual_elapsed_time smallint,
air_time smallint,
distance smallint,
carrier_delay smallint,
weather_delay smallint,
nas_delay smallint,
security_delay smallint,
late_aircraft_delay smallint
) engine=columnstore default character set=utf8;