Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
43c11214
Commit
43c11214
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: schema
parent
cec134a9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/sql_db/schema.sql
+33
-8
33 additions, 8 deletions
server/sql_db/schema.sql
with
33 additions
and
8 deletions
server/sql_db/schema.sql
+
33
−
8
View file @
43c11214
...
...
@@ -2,10 +2,6 @@ CREATE TABLE Measurement (
MeasurementID
INT
PRIMARY
KEY
,
SensorID
INT
,
TimeMeasured
DATETIME
,
Latitude
FLOAT
,
Longitude
FLOAT
,
MeasuredThickness
FLOAT
,
Accuracy
FLOAT
,
FOREIGN
KEY
(
SensorID
)
REFERENCES
Sensor
(
SensorID
)
);
...
...
@@ -15,12 +11,41 @@ CREATE TABLE Sensor (
Active
BOOLEAN
);
CREATE
TABLE
Data
(
MeasurementID
INT
,
Latitude
FLOAT
,
Longitude
FLOAT
,
IceTop
FLOAT
,
IceBottom
FLOAT
,
CalculatedThickness
FLOAT
,
Accuracy
FLOAT
,
PRIMARY
KEY
(
MeasurementID
,
Longitude
,
Latitude
),
FOREIGN
KEY
(
MeasurementID
)
REFERENCES
Measurement
(
MeasurementID
)
);
INSERT
INTO
Sensor
(
SensorID
,
SensorType
,
Active
)
VALUES
(
1
,
'LiDar'
,
1
),
(
2
,
'Magnetic'
,
1
),
(
3
,
'Other'
,
0
);
INSERT
INTO
Measurement
(
MeasurementID
,
SensorID
,
TimeMeasured
,
Latitude
,
Longitude
,
MeasuredThickness
,
Accuracy
)
VALUES
(
1
,
2
,
'2024-01-01 10:00:00'
,
60
.
7066
,
10
.
9771
,
10
.
0
,
1
.
0
),
(
2
,
2
,
'2024-02-04 11:00:00'
,
60
.
6366
,
10
.
8171
,
7
.
8
,
1
.
5
),
(
3
,
1
,
'2024-02-13 12:00:00'
,
60
.
7366
,
10
.
8471
,
7
.
2
,
2
.
5
);
INSERT
INTO
Measurement
(
MeasurementID
,
SensorID
,
TimeMeasured
)
VALUES
(
1
,
2
,
'2024-01-01 10:00:00'
),
(
2
,
2
,
'2024-02-04 11:00:00'
),
(
3
,
1
,
'2024-02-13 12:00:00'
);
-- Measurement 1
INSERT
INTO
Data
(
MeasurementID
,
Latitude
,
Longitude
,
IceTop
,
IceBottom
,
CalculatedThickness
,
Accuracy
)
VALUES
(
1
,
60
.
7066
,
10
.
9771
,
8
.
0
,
3
.
0
,
5
.
0
,
1
.
0
),
(
1
,
60
.
7066
,
10
.
9771
,
7
.
5
,
2
.
5
,
5
.
0
,
1
.
0
),
(
1
,
60
.
7066
,
10
.
9771
,
7
.
0
,
2
.
0
,
5
.
0
,
1
.
0
);
-- Measurement 2
INSERT
INTO
Data
(
MeasurementID
,
Latitude
,
Longitude
,
IceTop
,
IceBottom
,
CalculatedThickness
,
Accuracy
)
VALUES
(
2
,
60
.
6366
,
10
.
8171
,
7
.
2
,
2
.
2
,
5
.
0
,
1
.
5
),
(
2
,
60
.
6366
,
10
.
8171
,
7
.
0
,
2
.
0
,
5
.
0
,
1
.
5
);
-- Measurement 3
INSERT
INTO
Data
(
MeasurementID
,
Latitude
,
Longitude
,
IceTop
,
IceBottom
,
CalculatedThickness
,
Accuracy
)
VALUES
(
3
,
60
.
7366
,
10
.
8471
,
7
.
5
,
2
.
5
,
5
.
0
,
2
.
5
),
(
3
,
60
.
7366
,
10
.
8471
,
7
.
0
,
2
.
0
,
5
.
0
,
2
.
5
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment