 	update_date TIMESTAMP,
 	content TEXT,
 	workload REAL,
-	PRIMARY KEY (writer, id),
-	FOREIGN KEY (writer) REFERENCES client
-		ON DELETE CASCADE
-	FOREIGN KEY (course_prof_id, course_id) REFERENCES course_permit_instruct);
-
-CREATE TABLE professor(
-	uni VARCHAR(10),
-	e_mail TEXT,
-	PRIMARY KEY (uni) );
+	PRIMARY KEY (writer, id, course_prof, course_id),
+	FOREIGN KEY (writer) REFERENCES client ON DELETE CASCADE,
+	FOREIGN KEY (course_prof, course_id) REFERENCES course_instruct);
 
 -- Relations
-CREATE TABLE responsible_for(
+CREATE TABLE permit_course (
+	course_prof VARCHAR(10) NOT NULL,
+	course_id VARCHAR(15) NOT NULL,
+	prof_uni VARCHAR(10) NOT NULL,
+	UNIQUE (course_prof, course_id),
+	PRIMARY KEY (course_prof, course_id, prof_uni),
+	FOREIGN KEY (course_prof, course_id) REFERENCES course_instruct,
+	FOREIGN KEY (prof_uni) REFERENCES professor);
+
+CREATE TABLE delete_doc (
+	doc_contributer VARCHAR(10) NOT NULL,
+	doc_id INTEGER NOT NULL,
+	prof_uni VARCHAR(10) NOT NULL,
+	UNIQUE (doc_contributer, doc_id),
+	PRIMARY KEY (doc_contributer, doc_id, prof_uni),
+	FOREIGN KEY (doc_contributer, doc_id) REFERENCES document_upload,
+	FOREIGN KEY (prof_uni) REFERENCES professor);
+
+CREATE TABLE cover_course(
 	course_prof_id VARCHAR(10) NOT NULL,
 	course_id VARCHAR(15) NOT NULL,
 	course_inspector_uni VARCHAR(10) NOT NULL,
 	PRIMARY KEY (course_prof_id, course_id, course_inspector_uni),
-	FOREIGN KEY (course_prof_id, course_id) REFERENCES course_permit_instruct,
+	FOREIGN KEY (course_prof_id, course_id) REFERENCES course_instruct,
 	FOREIGN KEY (course_inspector_uni) REFERENCES inspector);
 
 CREATE TABLE inspect_doc(
-	inspector_uni VARCHAR(10),
+	inspector_uni VARCHAR(10) NOT NULL,
 	doc_contributer VARCHAR(10) NOT NULL,
 	doc_id INTEGER NOT NULL,
 	PRIMARY KEY (inspector_uni, doc_contributer, doc_id),

    PRIMARY KEY (uni) );

CREATE TABLE inspector (
	uni VARCHAR(10),
	countdown INTEGER,
	max_course_number INTEGER,
	PRIMARY KEY (uni),
	FOREIGN KEY (uni) REFERENCES cu_er );

CREATE TABLE client (
	uni VARCHAR(10),
	max_download_rate INTEGER,
	max_upload_rate INTEGER,
	PRIMARY KEY (uni),
	FOREIGN KEY (uni) REFERENCES cu_er );

CREATE TABLE course_permit_instruct (
	professor_id VARCHAR(10),
	id VARCHAR(15),
	star REAL,
	doc_permission BOOLEAN,
	workload REAL,

	create_date TIMESTAMP,
	publish_date TIMESTAMP,
	raw_file TEXT,
	PRIMARY KEY (contributer, id, course_prof, course_id),
	FOREIGN KEY (contributer) REFERENCES client ON DELETE CASCADE,
	FOREIGN KEY (course_prof, course_id) REFERENCES course_instruct);

CREATE TABLE review_write (
	-- Foreigns
	writer VARCHAR(10) NOT NULL,
	course_prof VARCHAR(10) NOT NULL,
	course_id VARCHAR(15) NOT NULL,
	-- Locals
	id INTEGER NOT NULL,
	inspectors TEXT[],
	votes INTEGER,
	create_date TIMESTAMP,
