This repository has been archived on 2025-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
group-1-db23/analysis/database/accident_copy.sql
Sebastian Lenzlinger f9f8323cfd SYNC COMMIT.
2024-01-08 15:30:17 +01:00

17 lines
644 B
SQL

drop table if exists accident_copy;
create table accident_copy as
select * from accidents;
alter table accident_copy add severity varchar;
alter table accident_copy add foreign key (accidentuid) references accidents;
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';