Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==============================================================*/
- /* DBMS name: PostgreSQL 9.x */
- /* Created on: 19.10.2018 09:47:58 */
- /*==============================================================*/
- drop index VERLEGT_FK;
- drop index BUCH_PK;
- drop table BUCH;
- drop index VERLAG_PK;
- drop table VERLAG;
- /*==============================================================*/
- /* Table: BUCH */
- /*==============================================================*/
- create table BUCH (
- ISBN VARCHAR(15) not null,
- NAME VARCHAR(50) not null,
- TITEL VARCHAR(50) null,
- AUFLAGE INT4 null,
- EHRSCHEINUNGSJAHR DATE null,
- SPRACHE VARCHAR(3) null,
- constraint PK_BUCH primary key (ISBN)
- );
- /*==============================================================*/
- /* Index: BUCH_PK */
- /*==============================================================*/
- create unique index BUCH_PK on BUCH (
- ISBN
- );
- /*==============================================================*/
- /* Index: VERLEGT_FK */
- /*==============================================================*/
- create index VERLEGT_FK on BUCH (
- NAME
- );
- /*==============================================================*/
- /* Table: VERLAG */
- /*==============================================================*/
- create table VERLAG (
- NAME VARCHAR(50) not null,
- ADRESSE VARCHAR(50) null,
- constraint PK_VERLAG primary key (NAME)
- );
- /*==============================================================*/
- /* Index: VERLAG_PK */
- /*==============================================================*/
- create unique index VERLAG_PK on VERLAG (
- NAME
- );
- alter table BUCH
- add constraint FK_BUCH_VERLEGT_VERLAG foreign key (NAME)
- references VERLAG (NAME)
- on delete restrict on update restrict;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement