-
Notifications
You must be signed in to change notification settings - Fork 1
/
Poistolauseet.sql
42 lines (27 loc) · 1020 Bytes
/
Poistolauseet.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
--########################################## Triggerin ja näkymien poisto
DROP TRIGGER keskuspaivitys ON d3.teoskappale;
DROP FUNCTION keskuspaivitys;
DROP VIEW hinnatLuokittain;
DROP VIEW ostotVuodessa;
-- Vaihtoehtoiset poistolauseet, jos yllä olevat eivät jostain syystä toimikkaan
-- DROP FUNCTION keskus.keskuspaivitys;
-- DROP VIEW keskus.hinnatLuokittain;
-- DROP VIEW keskus.ostotVuodessa;
--########################################## Taulujen poisto
DROP TABLE keskus.toimitus;
DROP TABLE keskus.postikulut;
DROP TABLE keskus.sijainti;
DROP TABLE keskus.tilaus;
DROP TABLE keskus.asiakas;
DROP TABLE keskus.yllapitaja;
DROP TABLE keskus.kayttaja;
DROP TABLE keskus.divari;
DROP TABLE keskus.teoskappale;
DROP TABLE keskus.teos;
DROP TABLE D1.teoskappale;
DROP TABLE D1.teos;
DROP TABLE D3.teoskappale;
DROP TABLE D3.teos;
--########################################## Tietokannan ja käyttäjän poisto (suoritettava yksi kerrallaan)
--DROP DATABASE Kirjakauppa;
--DROP USER harjoituskayttaja;