CREATE TABLE allBibs( 
citKey VARCHAR(20) NOT NULL, 
PRIMARY KEY (citKey) 
);

CREATE TABLE citForm( 
citKey VARCHAR(20) NOT NULL, 
form  VARCHAR(20), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)  
);

 

CREATE TABLE authors( 
citKey VARCHAR(20) NOT NULL, 
autNm VARCHAR(100) NOT NULL, 
PRIMARY KEY  (citKey, autNm), 
FOREIGN KEY  (citKey) REFERENCES allBibs (citKey)  
);

 

CREATE TABLE editors( 
citKey VARCHAR(20) NOT NULL, 
edNm  VARCHAR(100) NOT NULL, 
PRIMARY KEY (citKey, edNm),
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

 

CREATE TABLE titles( 
citKey VARCHAR(20) NOT NULL, 
title  VARCHAR(200), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)      
);
 

CREATE TABLE schools( 
citKey VARCHAR(20) NOT NULL, 
schoolNm  VARCHAR(100),
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)      
);

CREATE TABLE institutions( 
citKey VARCHAR(20) NOT NULL, 
institNm  VARCHAR(100), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)      
);

CREATE TABLE addresses(
citKey VARCHAR(20) NOT NULL, 
address  VARCHAR(100), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE types(
citKey VARCHAR(20) NOT NULL, 
type  VARCHAR(100), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE ISBN(
citKey VARCHAR(20) NOT NULL, 
isbnNum  VARCHAR(20), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE notes(
citKey VARCHAR(20) NOT NULL, 
note  VARCHAR(200) NOT NULL, 
PRIMARY KEY (citKey, note), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE volumes(
citKey VARCHAR(20) NOT NULL, 
volNum  VARCHAR(50), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE numbers(
citKey VARCHAR(20) NOT NULL, 
num  VARCHAR(50), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE months(
citKey VARCHAR(20) NOT NULL, 
mon  VARCHAR(20), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE years(
citKey VARCHAR(20) NOT NULL, 
yr  VARCHAR(20), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE pages(
citKey VARCHAR(20) NOT NULL, 
pgRange  VARCHAR(50), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE abstracts(
citKey VARCHAR(20) NOT NULL, 
txt  VARCHAR(3500), 
PRIMARY KEY (citKey), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey)
);

CREATE TABLE publisher(
pubNm  VARCHAR(100), 
pubID  INTEGER NOT NULL, 
PRIMARY KEY (pubID) 
);

CREATE TABLE citPublisher(
citKey VARCHAR(20) NOT NULL, 
pubID  INTEGER NOT NULL, 
PRIMARY KEY (citKey, pubID), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey), 
FOREIGN KEY (pubID) REFERENCES publisher (pubID)
);

CREATE TABLE journal(
jrnlNm VARCHAR(200), 
jrnlID INTEGER NOT NULL, 
PRIMARY KEY (jrnlID) 
);

CREATE TABLE citJournal(
citKey VARCHAR(20) NOT NULL, 
jrnlID    INTEGER NOT NULL, 
PRIMARY KEY (citKey, jrnlID), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey), 
FOREIGN KEY (jrnlID) REFERENCES journal (jrnlID) 
);

CREATE TABLE series(
seriesNm  VARCHAR(50), 
seriesID  INTEGER NOT NULL, 
PRIMARY KEY (seriesID) 
);

CREATE TABLE citSeries(
citKey VARCHAR(20) NOT NULL, 
seriesID  INTEGER NOT NULL, 
PRIMARY KEY (citKey, seriesID), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey), 
FOREIGN KEY (seriesID) REFERENCES series (seriesID)
);

CREATE TABLE booktitle(
bkTitleNm  VARCHAR(100),
bktitleID  INTEGER NOT NULL, 
PRIMARY KEY (bktitleID) 
);

CREATE TABLE citBkTitle(
citKey VARCHAR(20) NOT NULL, 
bktitleID  INTEGER NOT NULL, 
PRIMARY KEY (citKey, bktitleID), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey), 
FOREIGN KEY (bktitleID) REFERENCES booktitle (bktitleID)
);

CREATE TABLE keyWord(
word   VARCHAR(50), 
keyWdID  INTEGER NOT NULL, 
PRIMARY KEY (keyWdID) 
);

CREATE TABLE citKeyWd(
citKey VARCHAR(20) NOT NULL, 
keyWdID  INTEGER NOT NULL, 
PRIMARY KEY (citKey, keyWdID), 
FOREIGN KEY (citKey) REFERENCES allBibs (citKey), 
FOREIGN KEY (keyWdID) REFERENCES keyWord (keyWdID)
);

 