more data generation

This commit is contained in:
Maciekxdabu 2022-12-07 12:14:11 +01:00
parent 64601215fc
commit 8f89a1c35a

View File

@ -1,12 +1,51 @@
--truncate table competition;--
truncate table stadium;--
truncate table competition;--
--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
select
level +(select max(id) from competition) as id,
DBMS_RANDOM.value(10,100) as prize,
level +(select nvl(max(id),0) from competition) as id,
DBMS_RANDOM.value(0,1000000) as prize,
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
--into competionTemp
from dual
connect by level <=10
--generate 10 records
--generate 10 records
;
inster into club
select
level +(select nvl(max(id),0) from competition) as id,
DBMS_RANDOM.value(0,1000000) as prize,
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
--into competionTemp
from dual
connect by level <=10
--generate 10 records
;
insert into stadium
select
level +(select nvl(max(id),0) from stadium) as id,
DBMS_RANDOM.value(0,40000) as capacity,
DBMS_RANDOM.value(1,5) as reputation,
dbms_random.string('A', 6) as location,
DBMS_RANDOM.value(1900,2100) as build_year,
DBMS_RANDOM.value(0,1000000) as value,
DBMS_RANDOM.value(0,200) as ticket_price,
level +(select nvl(max(id),0) from stadium) as club_id
from dual
connect by level <=10
--generate 10 records
;