Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE seriestitle (
  2.  
  3.     seriestitle     text        PRIMARY KEY
  4. );
  5.    
  6. CREATE TABLE storyline (
  7.  
  8.     storyline       text        PRIMARY KEY  
  9.     );
  10.    
  11. CREATE TABLE bookcover (
  12.  
  13.     bookcover       OID     PRIMARY KEY
  14.     );
  15.    
  16. CREATE TABLE style (
  17.  
  18.     style           text        PRIMARY KEY
  19.     );
  20.    
  21. CREATE TABLE isbn (
  22.  
  23.     isbn            text        PRIMARY KEY
  24.     );
  25.    
  26. CREATE TABLE characters (
  27.  
  28.     name            text        PRIMARY KEY
  29.     );
  30.    
  31. CREATE TABLE writer (
  32.  
  33.     writer          text        PRIMARY KEY
  34.     );
  35.    
  36. CREATE TABLE ink (
  37.  
  38.     ink         text        PRIMARY KEY
  39.     );
  40.    
  41. CREATE TABLE pencils (
  42.  
  43.     pencils         text        PRIMARY KEY
  44.     );
  45.    
  46. CREATE TABLE coverartist (
  47.  
  48.     coverartist     text        PRIMARY KEY
  49.     );
  50.    
  51. CREATE TABLE artist (
  52.  
  53.     artist          text        PRIMARY KEY
  54.     );
  55.    
  56. CREATE TABLE letters (
  57.  
  58.     letters         text        PRIMARY KEY
  59.     );
  60.    
  61. CREATE TABLE colors (
  62.  
  63.     colors          text        PRIMARY KEY
  64.     )
  65.  
  66. CREATE TABLE compilation (
  67.  
  68.     compilation text    PRIMARY KEY,
  69.     c_date      text    NOT NULL,
  70.     isbn        text    REFERENCES isbn NOT NULL,
  71.     style       text    REFERENCES style NOT NULL,
  72.     seriestitle text    REFERENCES seriestitle DEFAULT '_default_',
  73.     price       float   NOT NULL
  74.     );
  75.  
  76.  
  77. CREATE TABLE storytitle (
  78.     storytitle  text        PRIMARY KEY,
  79.     characters  text        REFERENCES characters (name) NOT NULL,
  80.     notes       text        DEFAULT '_default_',
  81.     writer      text        REFERENCES writer(writer) DEFAULT '_default_',
  82.     ink     text        REFERENCES ink(ink) DEFAULT '_default_',
  83.     pencils     text        REFERENCES pencils(pencils) DEFAULT '_default_',
  84.     coverartist text        REFERENCES coverartist(coverartist) DEFAULT '_default_',
  85.     artist      text        REFERENCES artist(artist) DEFAULT '_default_',
  86.     letters     text        REFERENCES letters(letters) DEFAULT '_default_',
  87.     colors      text        REFERENCES colors(colors) DEFAULT '_default_'
  88.     );
  89.    
  90. CREATE TABLE booktitle (
  91.     booktitle       text        NOT NULL,
  92.     storytitle      text        REFERENCES storytitle(storytitle) NOT NULL,
  93.     isbn            text        REFERENCES isbn (isbn) NOT NULL DEFAULT '_default_',
  94.     i_date          text        NOT NULL,
  95.     price           float       NOT NULL,
  96.     style           text        REFERENCES style (style) NOT NULL DEFAULT 'Single Issue',
  97.     seriestitle     text        REFERENCES seriestitle(seriestitle) DEFAULT '_default_',
  98.     storyline       text        REFERENCES storyline(storyline) DEFAULT '_default_',
  99.     bookcover       OID     REFERENCES bookcover(bookcover),
  100.     compilation     text        REFERENCES compilation(compilation) DEFAULT '_default_',
  101.     PRIMARY KEY (booktitle, storytitle)
  102.     );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement