1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
create table sections(
nosection int identity(1,1) constraint pk_sections primary key,
position int not null,
nbmax int not null
);
create table livre(
nolivre int identity(1,1) constraint pk_questions primary key,
nosection int not null,
position int not null,
commentaire nvarchar(255) not null,
image nvarchar(255)
);
create table suivis(
nosuivi int identity(1,1) constraint pk_suivis primary key,
nolivre int not null,
marque bit not null
);
-----clés étrangères------
alter table livres
add constraint fk_questions_section foreign key(nosection) references sections(nosection);
alter table suivis
add constraint fk_suivis_questions foreign key(nolivre) references questions(nolivre); |
Partager