From 7d9d56113995fedf727471948bd6eeef00e6a61e Mon Sep 17 00:00:00 2001 From: Sebastian Lenzlinger <74497638+sebaschi@users.noreply.github.com> Date: Sat, 6 Jan 2024 16:39:58 +0100 Subject: [PATCH] Add accident_copy.sql --- analysis/database/accident_copy.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 analysis/database/accident_copy.sql diff --git a/analysis/database/accident_copy.sql b/analysis/database/accident_copy.sql new file mode 100644 index 0000000..2e23c7b --- /dev/null +++ b/analysis/database/accident_copy.sql @@ -0,0 +1,16 @@ +drop table if exists accident_copy; + +create table accident_copy as + select * from accidents; +alter table accident_copy add severity varchar; +update accident_copy set severity = 'Accident with property damage' +where accidentseveritycategory='as4'; + +update accident_copy set severity = 'Accident with light injuries' +where accidentseveritycategory='as3'; + +update accident_copy set severity = 'Accident with severe injuries' +where accidentseveritycategory='as2'; + +update accident_copy set severity = 'Accidents with fatalities' +where accidentseveritycategory='as1'; \ No newline at end of file