CREATE TABLE InProceedings(
inprocID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
bktitle VARCHAR(250), 
year INT, 
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150), 
class VARCHAR(150), 
note VARCHAR(254), 
annote varVARCHAR(2800), 
PRIMARY KEY(inprocID)
);

CREATE TABLE Article(
articleID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
journal VARCHAR(150), 
year INT,
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150),
class VARCHAR(150), 
note VARCHAR(254), 
annote VARCHAR(2800),
PRIMARY KEY(articleID)
);

CREATE TABLE TechReport(
techID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
inst VARCHAR(200), 
year INT,
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150), 
class VARCHAR(150), 
note VARCHAR(254), 
annote VARCHAR(2800),
PRIMARY KEY(techID)
);

CREATE TABLE Book(
bookID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
publisher VARCHAR(200), 
year INT, 
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150),
class VARCHAR(150), 
note VARCHAR(254), 
annote VARCHAR(2800), 
PRIMARY KEY(bookID)
);

CREATE TABLE InCollection(
collID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
bktitle VARCHAR(250), 
year INT,
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150), 
class VARCHAR(150), 
note VARCHAR(254), 
annote VARCHAR(2800), 
PRIMARY KEY(collID)
);

CREATE TABLE Misc(
miscID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
howpub VARCHAR(200), 
confloc VARCHAR(100),  
year INT, 
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150), 
class VARCHAR(150), 
note VARCHAR(254), 
annote VARCHAR(2800), 
PRIMARY KEY(miscID)
);

CREATE TABLE Manual(
manID VARCHAR(35) NOT NULL, 
title VARCHAR(254), 
org VARCHAR(200), 
year INT, 
month VARCHAR(8), 
pages VARCHAR(12), 
vol INT, 
num INT, 
loc VARCHAR(150),
class VARCHAR(150), 
note VARCHAR(254), 
annote VARCHAR(2800), 
PRIMARY KEY(manID)
);

CREATE TABLE Author(
AuthID INT NOT NULL, 
name VARCHAR(80) NOT NULL,
PRIMARY KEY (AuthID)
);

CREATE TABLE InprocPublished(
inprocID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL, 
PRIMARY KEY(inprocID, AuthID), 
FOREIGN KEY (inprocID) REFERENCES InProceedings (inprocID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);

CREATE TABLE ArticlePublished(
articleID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL,
PRIMARY KEY(articleID, AuthID), 
FOREIGN KEY (articleID) REFERENCES Article (articleID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);

CREATE TABLE TechPublished(
techID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL, 
PRIMARY KEY(techID, AuthID), 
FOREIGN KEY (techID) REFERENCES TechReport (techID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);

CREATE TABLE BookPublished(
bookID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL, 
PRIMARY KEY(bookID, AuthID), 
FOREIGN KEY (bookID) REFERENCES Book (bookID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);

CREATE TABLE InCollPublished(
collID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL,
PRIMARY KEY(collID, AuthID), 
FOREIGN KEY (collID) REFERENCES InCollection (collID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);

CREATE TABLE MiscPublished(
miscID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL,
PRIMARY KEY(miscID, AuthID),
FOREIGN KEY (miscID) REFERENCES Misc (miscID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);

CREATE TABLE ManualPublished(
manID VARCHAR(35) NOT NULL, 
AuthID INT NOT NULL, 
PRIMARY KEY (manID, AuthID), 
FOREIGN KEY (manID) REFERENCES Manual (manID), 
FOREIGN KEY (AuthID) REFERENCES Author (AuthID) 
);
