Обозначение | Свойство |
---|---|
«M» | Обязательная |
«O» | Не обязательная |
«PK» | Основной ключ |
«Kn» | Дополнительный ключ n |
phone { code: int; number: int; }
Обозначение | Свойство |
---|---|
«M» | Обязательная |
«O» | Не обязательная |
«PK» | Основной ключ |
«Kn» | Дополнительный ключ n |
class Student { int Id; string FirstName, LastName; Group group inverse Group::students; } class Group { int Id; Set<Student> students inverse Student::group; }
create table Persons ( id int, name varchar(50) );
primary key (id)
primary key (PassportSeries, PassportNo)
constraint person_pk primary key (id)
unique key (id)
unique primary key (passport_series, passport_no)
constraint person_pk unique key (id)
constraint student_group_fk foreign key (groupId) references groups(id)
foreign key (passport_series, passport_no) references passports(passport_series, passport_no)
drop table persons;
drop table students, groups;
alter table person add column birtday date;
alter table person change birtday timestamp not null;
alter table student drop constraint student_group_fk