small cleanup

- mostly deleted comments
This commit is contained in:
Maciekxdabu 2022-12-15 09:59:00 +01:00
parent 143f2ac566
commit fb828db14f
2 changed files with 1 additions and 49 deletions

View File

@ -9,19 +9,6 @@ alter table club
alter table takes_part_in
add id number;
where exists C
select * from takes_part_in
where club_id = match_id and club_id
alter table takes_part_in
drop column id
alter table manager alter table manager
ENABLE constraint manager_club_fk; ENABLE constraint manager_club_fk;

View File

@ -12,22 +12,12 @@ begin
declare many_to_many number := 15; declare many_to_many number := 15;
begin begin
--create table countryTable (Cname varchar(20))
--
--insert into table countryTable values('Poland')
--insert into table countryTable values('England')
--insert into table countryTable values('USA')
--insert into table countryTable values('Brazil')
--insert into table countryTable values('France')
insert into competition insert into competition
select select
level +(select nvl(max(id),0) from competition) as id, level +(select nvl(max(id),0) from competition) as id,
DBMS_RANDOM.value(0,1000000) as prize, DBMS_RANDOM.value(0,1000000) as prize,
dbms_random.string('A', 6) as country, dbms_random.string('A', 6) as country,
-- (select Cname from countryTable order by random() limit 1) as country,
DBMS_RANDOM.value(1,5) as reputation DBMS_RANDOM.value(1,5) as reputation
--into competionTemp
from dual from dual
connect by level <=loops connect by level <=loops
; ;
@ -45,7 +35,6 @@ connect by level <=loops
; ;
insert into club insert into club
--(id, budget, training_ground_quality, reputation, country_of_origin, competition_id, manager_id)
select select
level +(select nvl(max(id),0) from club) as id, level +(select nvl(max(id),0) from club) as id,
DBMS_RANDOM.value(0,1000000) as budget, DBMS_RANDOM.value(0,1000000) as budget,
@ -58,8 +47,6 @@ from dual
connect by level <=loops connect by level <=loops
; ;
-- attempt at getting random id from competition: (SELECT id FROM competition SAMPLE(1) WHERE rownum = 1)
insert into stadium insert into stadium
select select
level +(select nvl(max(id),0) from stadium) as id, level +(select nvl(max(id),0) from stadium) as id,
@ -106,9 +93,6 @@ insert into player
connect by level <=loops connect by level <=loops
; ;
--insert into takes_part_in
-- select club.id, match.id from club, match;--creates a table 1-1 everything into everything
insert into takes_part_in insert into takes_part_in
SELECT club_id, match_id SELECT club_id, match_id
FROM ( FROM (
@ -117,17 +101,6 @@ insert into takes_part_in
ORDER BY DBMS_RANDOM.RANDOM) ORDER BY DBMS_RANDOM.RANDOM)
WHERE rownum <= many_to_many; WHERE rownum <= many_to_many;
--insert into takes_part_in
-- select
-- dbms_random.value(1,loops) as club_id,
-- dbms_random.value(1,loops) as match_id
-- from dual
--connect by level <=loops
--;
--insert into takes_place_in
-- select stadium.id, competition.id from stadium, competition ORDER BY DBMS_RANDOM.RANDOM limit 10;
insert into takes_place_in insert into takes_place_in
SELECT stadium_id, competition_id SELECT stadium_id, competition_id
FROM ( FROM (
@ -136,13 +109,5 @@ insert into takes_place_in
ORDER BY DBMS_RANDOM.RANDOM) ORDER BY DBMS_RANDOM.RANDOM)
WHERE rownum <= many_to_many; WHERE rownum <= many_to_many;
--insert into takes_place_in
-- select
-- dbms_random.value(1,loops) as stadium_id,
-- dbms_random.value(1,loops) as competition_id
-- from dual
--connect by level <=loops
--;
end; end;
end; end;