create database university;
use database university;
create table subjects
(id int primary key,
subject char(30) not null);
create table teachers
(id int primary key,
name char(30) not null,
subject_id int references subject(id));
create table students
(id int primary key,
login varchar(10) not null,
pass varchar(12) not null,
unique(login)
);
create table profile
(id int primary key,
name char(30) not null,
sex bit,
city char(30) not null,
student_id int references students(id));
create table schedule
(id int primary key,
subject_id int references subject(id),
student_id int references students(id),
teacher_id int references teachers(id));