Created
August 30, 2020 12:20
-
-
Save twobiers/255aa6f35730acfff81731a0068e75ec to your computer and use it in GitHub Desktop.
SQL Oracle ORDBS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Typ für Maßeinheiten erstellen | |
CREATE OR REPLACE TYPE measurement_unit AS OBJECT ( | |
name VARCHAR2(45), | |
short VARCHAR2(5)) | |
NOT FINAL; | |
-- Subtyp für flüssige Maßeinheiten, Umrechnung in Liter | |
CREATE OR REPLACE TYPE fluid_measurement_unit UNDER measurement_unit( | |
conversion_factor_to_liter NUMBER(20,10) | |
) | |
FINAL; | |
-- Subtyp für feste Maßeinheiten, Umrechnung in Gramm | |
CREATE OR REPLACE TYPE solid_measurement_unit UNDER measurement_unit( | |
conversion_factor_to_grams NUMBER(20,10) | |
) | |
FINAL; | |
-- Tabelle für die Maßeinheiten erstellen. Zusätzlichen künstlichen Primärschlüssel für Fremdschlüsselzuweisung | |
CREATE TABLE measurement_units ( | |
id NUMBER(10) NOT NULL, | |
measurement_unit measurement_unit, | |
PRIMARY KEY (id)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment