Už jste skoro tam, musíte definovat PRIMARY a FOREIGN klíče pro atributy v tabulkách, příklad s tabulkou Students, Course a Course_Br_Students je:
CREATE TABLE Students(
PRIMARY KEY Student_ID SERIAL INTEGER,
Username VARCHAR(255),
First_name VARCHAR(255),
Email VARCHAR(255),
Phone number INTEGER,
Beginning_Date TIME,
Ending_Date TIME,
Max_hours INTEGER,
)
CREATE TABLE Student_Br_Course(
FOREIGN KEY Student_ID REFERENCES Students(Student_ID),
FOREIGN KEY Course_ID REFERENCES Courses(Course_ID),
Role VARCHAR(255),
Status BOOLEAN,
)
CREATE TABLE Courses(
PRIMARY KEY Course_ID INTEGER,
Course_Abbreviation VARCHAR(255),
Course_Number INTEGER,
Section_number INTEGER,
Professor_ID INTEGER,
)
Zde je odkaz pro pochopení toho, jak vytvářet tabulky s PRIMARY a FOREIGN klíči:
http://www.w3schools.com/sql/sql_foreignkey.asp