-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
97 lines (76 loc) · 2.02 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
91
92
93
94
95
96
97
create table pets (
id INT NOT NULL UNIQUE,
name CHAR NOT NULL,
species CHAR NOT NULL,
breed CHAR NOT NULL,
age CHAR NOT NULL,
size CHAR NOT NULL,
temperament CHAR NOT NULL,
gender CHAR NOT NULL,
goodWith CHAR,
shelter CHAR NOT NULL,
bio CHAR
);
create table accounts(
username CHAR NOT NULL UNIQUE,
password CHAR NOT NULL,
accountType CHAR NOT NULL
);
create table owner(
username CHAR NOT NULL UNIQUE,
name CHAR NOT NULL UNIQUE,
phoneNumber BIGINT NOT NULL,
emailAddress CHAR NOT NULL,
ownerAddress CHAR NOT NULL,
zip INT NOT NULL
);
create table adopter(
username CHAR NOT NULL UNIQUE,
firstName CHAR NOT NULL,
lastName CHAR NOT NULL,
emailAddress CHAR NOT NULL,
zip INT NOT NULL
);
create table preferences(
adopterUsername CHAR NOT NULL,
attribute CHAR NOT NULL,
attributeType CHAR NOT NULL
);
create table savedPets(
username CHAR NOT NULL,
petID INT NOT NULL
);
create table media(
petID INT NOT NULL,
filename CHAR NOT NULL,
mediaType CHAR NOT NULL
);
create table species (
speciesType CHAR NOT NULL
);
create table breed (
breedType CHAR NOT NULL,
speciesType CHAR NOT NULL
);
create table temperament (
temperamentType CHAR NOT NULL
);
create table goodWith (
goodWithType CHAR NOT NULL
);
create table shelter (
shelterType CHAR NOT NULL
);
.separator ","
.mode csv
.import "csvs/pets.csv" pets
.import "csvs/species.csv" species
.import "csvs/media.csv" media
.import "csvs/breed.csv" breed
.import "csvs/temperament.csv" temperament
.import "csvs/good_with.csv" goodWith
.import "csvs/shelter.csv" shelter
.import "csvs/accounts.csv" accounts
.import "csvs/adopters.csv" adopter
.import "csvs/preferences.csv" preferences
.import "csvs/owner.csv" owner