Salut!
je reformule ma question:
dans une relation 1-N entre 2 tables (table1 et tableN), j'ai placé la clé etrangere dans la table1 et on m'a dis que c'etait faux.... Comment proceder?
Ex:
Une collection a plusieurs etiquetages:
create table collection
(
id SMALLINT ,
integrite INTEGER ,
taxon TEXT ,
etatconservation TEXT ,
ref_etiquetage SMALLINT ,
PRIMARY KEY id ,
CONSTRAINT integrite NOT NULL,
CONSTRAINT taxon NOT NULL,
FOREIGN KEY ref_etiquetage REFERENCES etiquetage
);
-- ============================================================
-- Table : etiquetage
-- ============================================================
create table etiquetage
(
id SMALLINT ,
papier TEXT ,
coloration TEXT ,
forme TEXT ,
photo TEXT ,
PRIMARY KEY id
);
Partager