CREATE TABLE author(
aname VARCHAR(50) PRIMARY KEY NOT NULL
);

CREATE TABLE author_confJour(
jname VARCHAR(50) NOT NULL PRIMARY KEY,
aname VARCHAR(50),
FOREIGN KEY (aname) REFERENCES author (aname)
);

CREATE TABLE confJour_year(
yr VARCHAR(50) NOT NULL PRIMARY KEY,
jname VARCHAR(50),
FOREIGN KEY (jname) REFERENCES author_confJour (jname)
);

CREATE TABLE author_year(
ayr VARCHAR(50) NOT NULL PRIMARY KEY,
aname VARCHAR(50),
FOREIGN KEY (aname) REFERENCES author (aname)
);

CREATE TABLE year_confJour(
yjname VARCHAR(50) NOT NULL PRIMARY KEY,
ayr VARCHAR(50),
FOREIGN KEY (ayr) REFERENCES author_year (ayr)
);

CREATE TABLE org(
orgname VARCHAR(50) NOT NULL,
jname VARCHAR(50) NOT NULL,
yr VARCHAR(50) NOT NULL,
PRIMARY KEY (orgname, jname, yr),
FOREIGN KEY (yr) REFRENCES confJour_year (yr),
FOREIGN KEY (jname) REFERENCES author_confJour (jname)
);

CREATE TABLE pub(
pub_id VARCHAR(50) NOT NULL PRIMARY KEY,
title VARCHAR(50) NOT NULL,
pages VARCHAR(50),
cdrom VARCHAR(50),
url VARCHAR (50),
yr VARCHAR(50),
yjname VARCHAR(50),
FOREIGN KEY (yr) REFRENCES confJour_year (yr),
FOREIGN KEY (yjname) REFERENCES year_confJour (yjname)
);

CREATE TABLE org_journal(
orgname VARCHAR(50) NOT NULL,
jname VARCHAR(50) NOT NULL,
PRIMARY KEY (orgname, jname),
FOREIGN KEY (jname) REFERENCES author_confJour (jname)
);

CREATE TABLE org(
orgname VARCHAR(50) NOT NULL,
yr VARCHAR(50) NOT NULL,
jname VARCHAR(50),
PRIMARY KEY (orgname, yr),
FOREIGN KEY (yr) REFRENCES confJour_year (yr)
);





