-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_db.sql
82 lines (73 loc) · 1.67 KB
/
create_db.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
Use ostracods_data;
CREATE TABLE slide_id_hub
(
slide_id CHAR(15) NOT NULL,
core VARCHAR(31),
sub_core VARCHAR(31),
magnification integer,
CONSTRAINT slide_pk primary key (slide_id)
);
CREATE TABLE slide_data
(
slide_id CHAR(15) NOT NULL,
width integer,
height integer,
slide_path VARCHAR(255),
CONSTRAINT slide_data_pk primary key (slide_id)
);
CREATE TABLE grid_data
(
grid_id CHAR(15) NOT NULL,
slide_id CHAR(15),
grid_no integer,
width integer,
height integer,
status_code integer,
grid_path VARCHAR(255),
CONSTRAINT grid_pk primary key (grid_id)
);
CREATE TABLE grid_annotations
(
annotation_id CHAR(15) NOT NULL,
grid_id CHAR(15) NOT NULL,
annotation_type VARCHAR(15) NOT NULL,
annotation_path VARCHAR(255),
CONSTRAINT anno_pk primary key (annotation_id)
);
CREATE TABLE annotation_data
(
annotation_id CHAR(15) NOT NULL,
ostracod_count integer,
CONSTRAINT ad_pk primary key (annotation_id)
);
CREATE TABLE specimen_data
(
specimen_id CHAR(15) NOT NULL,
grid_id CHAR(15),
slide_id CHAR(15),
genus_id CHAR(15),
species_id CHAR(15),
width integer,
height integer,
status_code integer,
specimen_path VARCHAR(255),
CONSTRAINT specimen_pk primary key (specimen_id)
);
CREATE TABLE genus
(
genus_id CHAR(15),
genus VARCHAR(31),
CONSTRAINT genus_pk primary key (genus_id)
);
CREATE TABLE species
(
species_id CHAR(15),
species VARCHAR(63),
CONSTRAINT species_pk primary key (species_id)
);
CREATE TABLE status_record
(
status_code integer,
status_description VARCHAR(63),
CONSTRAINT status_pk primary key (status_code)
);