1. Vytvorte tabuľky (včítane primárnych a cudzích kľúčov): MUZSTVO (id, meno, mesto), ZAPAS (id1, id2, goly1, goly2, body1, body2). create table soma_muzstvo ( id integer not null, meno varchar(20) not null, mesto varchar(20) not null, primary key (id) ) create table soma_zapas ( id1 integer not null, id2 integer not null, goly1 integer not null, goly2 integer not null, body1 integer , body2 integer , primary key (id1,id2) ) alter table soma_zapas add foreign key soma_id1 (id1) references soma_muzstvo alter table soma_zapas add foreign key soma_id2 (id2) references soma_muzstvo ---------------------------------------------------------------------------- 2. Naplňte tabuľky dátami zo zadania: 1. 2. 3. 4. 5. 1. Real Madrid x 1:0 4:2 3:5 1:1 2. United Manchester ... x 2:1 5:1 2:2 3. Bayern Mníchov ... ... x 2:2 1:0 4. Inter Miláno ... ... ... x 0:0 5. Juventus Turín ... ... ... ... x 3. Vyplňte body podľa gólov. insert into soma_muzstvo values (1,'Real_Madrid','Madrid'), (2,'United_Manchester','Manchester'), (3,'Bayern_Mnichov','Mnichov'), (4,'Inter_Milano','Milano'), (5,'Juventus_Turin','Turin') insert into soma_zapas values (1,2,1,0,3,0), (1,3,4,2,3,0), (1,4,3,5,0,3), (1,5,1,1,1,1), (2,3,2,1,3,0), (2,4,5,1,3,0), (2,5,2,2,1,1), (3,4,2,2,1,1), (3,5,1,0,3,0), (4,5,0,0,1,1) ---------------------------------------------------------------------------- 4. Vypíšte všetky zápasy, ktoré sa skončili remízou. [ napr. Real Madrid - Juventus Turín 1:1 ] select m1.meno||' - '||m2.meno, char(z.goly1)||':'||char(z.goly2) from soma_muzstvo m1, soma_muzstvo m2, soma_zapas z where z.goly1=z.goly2 and z.id1=m1.id and z.id2 = m2.id and z.id1