Trab setores
1)
create table AUTOR
AUTORcódigo integer(10) not null,
AUTORnome char(30) ,
AUTORdata-nasc. date, primary key (AUTORcódigo)
);
create table AUTORIA
(AUTORcódigo integer(10) not null,
ARTIGOcódigo integer(10) not null , foreign key (AUTORcódigo), foreign key(ARTIGOcódigo),
);
create table ARTIGO
(ARTIGOcódigo integer(10) not null, titulo char(50), texto char (80),
REVISTAnumero integer(10), primary key(ARTIGOnúmero) foreign key (REVISTAnúmero),
);
create table REVISTA
(número integer(5) not null, mes char (9), primary key(REVISTAnúmero),
);
2)
insert into AUTOR (AUTORcódigo,AUTORnome,AUTORdata-nasc.) values (00001,'Bram Stocker',12/10/1957); insert into AUTOR (AUTORcódigo,AUTORnome,AUTORdata-nasc.) values (00002,'George Lewis',19/8/1935); insert into AUTOR (AUTORcódigo,AUTORnome,AUTORdata-nasc.) values (00003,'Kariba John',5/2/1913); insert into AUTOR (AUTORcódigo,AUTORnome,AUTORdata-nasc.) values (00004,'Lilli Polli',25/06/1986); insert into AUTOR (AUTORcódigo,AUTORnome,AUTORdata-nasc.) values (00005,'Mary Shelley',12/10/1837);
insert into AUTORIA (AUTORcódigo,ARTIGOcódigo) values (00001,00006); insert into AUTORIA (AUTORcódigo,ARTIGOcódigo) values (00002,00007); insert into AUTORIA (AUTORcódigo,ARTIGOcódigo) values (00003,00008); insert into AUTORIA (AUTORcódigo,ARTIGOcódigo) values (00004,00009); insert into AUTORIA (AUTORcódigo,ARTIGOcódigo) values (00005,00010);
insert into ARTIGO (ARTIGOcódigo,titulo,texto,REVISTAnúmero) values (00006,'Drácula ,'Ano de 1462. Constantinopla havia sido tomada.',12345); insert into ARTIGO (ARTIGOcódigo,titulo,texto,REVISTAnúmero) values (00007,'Constituicao','Segundo este documento todo cidadao americano é considerado uma pessoa',23456); insert into ARTIGO (ARTIGOcódigo,titulo,texto,REVISTAnúmero) values (00008,'Sunshine Reggae','This morning one more time i see the green flavour',34567); insert into ARTIGO (ARTIGOcódigo,titulo,texto,REVISTAnúmero) values