

Tables
========================================================================



PUBLIC.BOOKS.AUTHORS                                             [table]
------------------------------------------------------------------------
Contact details for book authors
  ID                                INTEGER NOT NULL            
  FIRSTNAME                         VARCHAR(20) NOT NULL        
  LASTNAME                          VARCHAR(20) NOT NULL        
  ADDRESS1                          VARCHAR(255)                
  ADDRESS2                          VARCHAR(255)                
  CITY                              VARCHAR(50)                 
  STATE                             VARCHAR(2)                  
  POSTALCODE                        VARCHAR(10)                 
  COUNTRY                           VARCHAR(50)                 

Primary Key

PK_AUTHORS                                                 [primary key]
  ID                                ascending                   

Foreign Keys

Z_FK_AUTHOR                                [foreign key, with no action]
  ID <--(0..many) PUBLIC.BOOKS.BOOKAUTHORS.AUTHORID                              

Indexes

SYS_IDX_PK_AUTHORS_10111                                  [unique index]
  ID                                ascending                   

IDX_B_AUTHORS                                         [non-unique index]
  LASTNAME                          ascending                   
  FIRSTNAME                         ascending                   

IDX_A_AUTHORS                                         [non-unique index]
  CITY                              ascending                   
  STATE                             ascending                   
  POSTALCODE                        ascending                   
  COUNTRY                           ascending                   



PUBLIC.BOOKS.AUTHORSLIST                                          [view]
------------------------------------------------------------------------
  ID                                INTEGER                     
  FIRSTNAME                         VARCHAR(20)                 
  LASTNAME                          VARCHAR(20)                 



PUBLIC.BOOKS.BOOKAUTHORS                                         [table]
------------------------------------------------------------------------
Relationship between books and their authors, 
along with the latest updated information
  BOOKID                            INTEGER NOT NULL            
  AUTHORID                          INTEGER NOT NULL            
  SOMEDATA                          VARCHAR(30)                 

Foreign Keys

Z_FK_AUTHOR                                [foreign key, with no action]
  AUTHORID (0..many)--> PUBLIC.BOOKS.AUTHORS.ID                              

SYS_FK_10128                               [foreign key, with no action]
  BOOKID (0..many)--> PUBLIC.BOOKS.BOOKS.ID                              

Indexes

SYS_IDX_Z_FK_AUTHOR_10134                             [non-unique index]
  AUTHORID                          ascending                   

SYS_IDX_SYS_FK_10128_10132                            [non-unique index]
  BOOKID                            ascending                   

UIDX_BOOKAUTHORS                                          [unique index]
  BOOKID                            ascending                   
  AUTHORID                          ascending                   



PUBLIC.BOOKS.BOOKS                                               [table]
------------------------------------------------------------------------
Details for published books
  ID                                INTEGER NOT NULL            
                                    Unique (internal) id for book
  TITLE                             VARCHAR(255) NOT NULL       
                                    Book title                  
  DESCRIPTION                       VARCHAR(255)                
                                    Book description
(Usually the blurb from the book jacket or promotional materials)
  PUBLISHERID                       INTEGER NOT NULL            
                                    Foreign key to the book publisher
  PUBLICATIONDATE                   DATE                        
                                    Book publication date       
  PRICE                             DOUBLE(64, 0)               
                                    Current price for the book  
  PREVIOUSEDITIONID                 INTEGER                     

Primary Key

PK_BOOKS                                                   [primary key]
  ID                                ascending                   

Foreign Keys

SYS_FK_10128                               [foreign key, with no action]
  ID <--(0..many) PUBLIC.BOOKS.BOOKAUTHORS.BOOKID                              

FK_PREVIOUSEDITION                         [foreign key, with no action]
  ID <--(0..1) PREVIOUSEDITIONID                                

Indexes

SYS_IDX_PK_BOOKS_10119                                    [unique index]
  ID                                ascending                   

SYS_IDX_U_PREVIOUSEDITION_10125                           [unique index]
  PREVIOUSEDITIONID                 ascending                   

SYS_IDX_FK_PREVIOUSEDITION_10123                      [non-unique index]
  PREVIOUSEDITIONID                 ascending                   



PUBLIC.BOOKS.COUPONS                                             [table]
------------------------------------------------------------------------
  ID                                INTEGER NOT NULL            
  DATA                              CLOB                        
  COUPONS                           INTEGER ARRAY               
  BOOKS                             VARCHAR(20) ARRAY[10]       

Primary Key

PK_COUPONS                                                 [primary key]
  ID                                ascending                   

Indexes

SYS_IDX_PK_COUPONS_10093                                  [unique index]
  ID                                ascending                   



PUBLIC.BOOKS."Global Counts"                                     [table]
------------------------------------------------------------------------
  "Global Count"                    INTEGER                     
  "UPDATE"                          VARCHAR(20)                 



PUBLIC.BOOKS.PUBLISHERS                                          [table]
------------------------------------------------------------------------
List of book publishers
  ID                                INTEGER NOT NULL            
                                    auto-incremented            
                                    Unique (internal) id for book publisher
  PUBLISHER                         VARCHAR(255)                
                                    Name of book publisher      

Primary Key

SYS_PK_10106                                               [primary key]
  ID                                ascending                   

Foreign Keys

FK_ΒΙΒΛΊΑ_PUBLISHERS                       [foreign key, with no action]
  ID <--(0..many) PUBLIC.BOOKS.ΒΙΒΛΊΑ.ΕΚΔΌΤΗΣ                              

Indexes

SYS_IDX_SYS_PK_10106_10107                                [unique index]
  ID                                ascending                   



PUBLIC."PUBLISHER SALES".REGIONS                                 [table]
------------------------------------------------------------------------
  CITY                              VARCHAR(50) NOT NULL        
  STATE                             VARCHAR(2) NOT NULL         
  POSTALCODE                        VARCHAR(10) NOT NULL        
  COUNTRY                           VARCHAR(50) NOT NULL        

Primary Key

PK_CUSTOMERS                                               [primary key]
  POSTALCODE                        ascending                   
  COUNTRY                           ascending                   

Foreign Keys

FK_SALES_REGIONS                           [foreign key, with no action]
  POSTALCODE <--(0..many) PUBLIC."PUBLISHER SALES".SALES.POSTALCODE                              
  COUNTRY <--(0..many) PUBLIC."PUBLISHER SALES".SALES.COUNTRY                              

Indexes

SYS_IDX_PK_CUSTOMERS_10227                                [unique index]
  POSTALCODE                        ascending                   
  COUNTRY                           ascending                   



PUBLIC."PUBLISHER SALES".SALES                                   [table]
------------------------------------------------------------------------
  POSTALCODE                        VARCHAR(10) NOT NULL        
  COUNTRY                           VARCHAR(50) NOT NULL        
  BOOKID                            INTEGER                     
  PERIODENDDATE                     DATE                        
  TOTALAMOUNT                       DOUBLE(64, 0)               
  SALESDATAID                       INTEGER                     

Foreign Keys

FK_SALES_SALESDATA                         [foreign key, with no action]
  SALESDATAID (0..many)--> PUBLIC."PUBLISHER SALES".SALESDATA.SALESDATAID                              

FK_SALES_REGIONS                           [foreign key, with no action]
  POSTALCODE (0..many)--> PUBLIC."PUBLISHER SALES".REGIONS.POSTALCODE                              
  COUNTRY (0..many)--> PUBLIC."PUBLISHER SALES".REGIONS.COUNTRY                              

Indexes

SYS_IDX_FK_SALES_SALESDATA_10241                      [non-unique index]
  SALESDATAID                       ascending                   

SYS_IDX_FK_SALES_REGIONS_10239                        [non-unique index]
  POSTALCODE                        ascending                   
  COUNTRY                           ascending                   

