professorscontains data about professors
subjectscontains data about subjects
examscontains data about exams
teachcontains the relations between the professors and their subjects
CREATE TABLE professors ( Id int(11) DEFAULT '0' NOT NULL auto_increment, Surname varchar(24) NOT NULL, Name varchar(24) NOT NULL, Email varchar(48) DEFAULT 'Not avaliable', Cod_course varchar(16) DEFAULT 'Not avaliable', Consulting_hour varchar(128) DEFAULT 'Not avaliable', Consulting_place varchar(128) DEFAULT 'Not avaliable', PRIMARY KEY (Id) );
Idis the field for associating an unique identifier with each professor and is the key of the table. The other fields,
Cod_courseassumes unique values identifying the subjects. Finally,
Consulting_placespecify the receiving time and the place for receiving.
CREATE TABLE subjects ( Subject varchar(96) NOT NULL, Cod_Subject varchar(24) NOT NULL, Cod_number varchar(12) NOT NULL, PRIMARY KEY (Cod_subject ) );
Cod_subjectis the field containing the unique name adopted by the University for the subject and is the key of the table.
Cod_numberis a numeric field containing a number grouping different courses on the same subject.
CREATE TABLE exams ( Cod_Subject varchar(24) NOT NULL, Id int(11) NOT NULL, Date date DEFAULT '0000-00-00', Time time DEFAULT '00:00:00', Room varchar(64), Test varchar(16) DEFAULT 'Oral' );
Cod_subjectagain contains the unique name adopted by the University for the subject,
Idis the unique identifier for the professors,
Room, record the date, the time and the place where exams will take place;
Testis for the type of the exam (written, oral, or anything else).
CREATE TABLE teach ( Cod_Subject varchar(16) NOT NULL, Id int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (Id, Cod_subject ) );
teachthe two fields form the key and are necessary to know who is teaching what.