

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



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

Primary Key

                                                           [primary key]
  ID                                ascending                   

Foreign Keys

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



AUTHORSLIST                                                       [view]
------------------------------------------------------------------------



BOOKAUTHORS                                                      [table]
------------------------------------------------------------------------
Relationship between books and their authors, 
along with the latest updated information
  BOOKID                            INTEGER NOT NULL            
  AUTHORID                          INTEGER NOT NULL            

Foreign Keys

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

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



BOOKS                                                            [table]
------------------------------------------------------------------------
Details for published books
  ID                                INTEGER NOT NULL            
                                    Unique (internal) id for book
  PREVIOUSEDITIONID                 INTEGER                     

Primary Key

                                                           [primary key]
  ID                                ascending                   

Foreign Keys

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

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



COUPONS                                                          [table]
------------------------------------------------------------------------
  ID                                INTEGER NOT NULL            

Primary Key

                                                           [primary key]
  ID                                ascending                   



CUSTOMERDATA                                                     [table]
------------------------------------------------------------------------
  ID                                INTEGER NOT NULL            

Primary Key

                                                           [primary key]
  ID                                ascending                   



CUSTOMERS                                                        [table]
------------------------------------------------------------------------
  ID                                INTEGER NOT NULL            

Primary Key

                                                           [primary key]
  ID                                ascending                   



"Global Counts"                                                  [table]
------------------------------------------------------------------------



PUBLISHERS                                                       [table]
------------------------------------------------------------------------
List of book publishers
  ID                                INTEGER NOT NULL            
                                    auto-incremented            
                                    Unique (internal) id for book publisher

Primary Key

                                                           [primary key]
  ID                                ascending                   

Foreign Keys

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



ΒΙΒΛΊΑ                                                           [table]
------------------------------------------------------------------------
  ΜΟΝΑΔΙΚΌΣ                         SMALLINT NOT NULL           
  ΕΚΔΌΤΗΣ                           SMALLINT NOT NULL           

Primary Key

                                                           [primary key]
  ΜΟΝΑΔΙΚΌΣ                         ascending                   

Foreign Keys

                                           [foreign key, with no action]
  ΕΚΔΌΤΗΣ (0..many)--> PUBLISHERS.ID                              



REGIONS                                                          [table]
------------------------------------------------------------------------
  POSTALCODE                        VARCHAR(10) NOT NULL        
  COUNTRY                           VARCHAR(50) NOT NULL        

Primary Key

                                                           [primary key]
  POSTALCODE                        ascending                   
  COUNTRY                           ascending                   

Foreign Keys

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



SALES                                                            [table]
------------------------------------------------------------------------
  POSTALCODE                        VARCHAR(10) NOT NULL        
  COUNTRY                           VARCHAR(50) NOT NULL        
  SALESDATAID                       INTEGER                     

Foreign Keys

                                           [foreign key, with no action]
  SALESDATAID (0..many)--> SALESDATA.SALESDATAID                              

                                           [foreign key, with no action]
  POSTALCODE (0..many)--> REGIONS.POSTALCODE                              
  COUNTRY (0..many)--> REGIONS.COUNTRY                              



SALESDATA                                                        [table]
------------------------------------------------------------------------
  SALESDATAID                       INTEGER                     

Foreign Keys

                                           [foreign key, with no action]
  SALESDATAID <--(0..many) SALES.SALESDATAID                              

