-
Notifications
You must be signed in to change notification settings - Fork 45
/
schema.sql
90 lines (90 loc) · 1.82 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
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
CREATE TABLE crime_scene_reports (
id INTEGER,
year INTEGER,
month INTEGER,
day INTEGER,
street TEXT,
description TEXT,
PRIMARY KEY(id)
);
CREATE TABLE interviews (
id INTEGER,
name TEXT,
year INTEGER,
month INTEGER,
day INTEGER,
transcript TEXT,
PRIMARY KEY(id)
);
CREATE TABLE courthouse_security_logs (
id INTEGER,
year INTEGER,
month INTEGER,
day INTEGER,
hour INTEGER,
minute INTEGER,
activity TEXT,
license_plate TEXT,
PRIMARY KEY(id)
);
CREATE TABLE atm_transactions (
id INTEGER,
account_number INTEGER,
year INTEGER,
month INTEGER,
day INTEGER,
atm_location TEXT,
transaction_type TEXT,
amount INTEGER,
PRIMARY KEY(id)
);
CREATE TABLE bank_accounts (
account_number INTEGER,
person_id INTEGER,
creation_year INTEGER,
FOREIGN KEY(person_id) REFERENCES people(id)
);
CREATE TABLE airports (
id INTEGER,
abbreviation TEXT,
full_name TEXT,
city TEXT,
PRIMARY KEY(id)
);
CREATE TABLE flights (
id INTEGER,
origin_airport_id INTEGER,
destination_airport_id INTEGER,
year INTEGER,
month INTEGER,
day INTEGER,
hour INTEGER,
minute INTEGER,
PRIMARY KEY(id),
FOREIGN KEY(origin_airport_id) REFERENCES airports(id),
FOREIGN KEY(destination_airport_id) REFERENCES airports(id)
);
CREATE TABLE passengers (
flight_id INTEGER,
passport_number INTEGER,
seat TEXT,
FOREIGN KEY(flight_id) REFERENCES flights(id)
);
CREATE TABLE phone_calls (
id INTEGER,
caller TEXT,
receiver TEXT,
year INTEGER,
month INTEGER,
day INTEGER,
duration INTEGER,
PRIMARY KEY(id)
);
CREATE TABLE people (
id INTEGER,
name TEXT,
phone_number TEXT,
passport_number INTEGER,
license_plate TEXT,
PRIMARY KEY(id)
);