-- Author: Luigi Grimaudo
-- Date: 13/02/2013

-- Data warehouse
set escape on;

drop role seasideDW_role;
create role seasideDW_role;
 
grant create session,connect,create table to seasideDW_role;

drop user seasideDW cascade;

create user seasideDW identified by "password" default tablespace pentaho_tablespace quota unlimited on pentaho_tablespace temporary tablespace temp quota 5M on system;

grant seasideDW_role to seasideDW;
grant create table to seasideDW; 
grant create procedure, create trigger, create sequence, create any table to seasideDW;

conn seasideDW/password@xe

-- Create tables
CREATE TABLE Province
(
 COD_P INT NOT NULL,
 Province VARCHAR2(25) NOT NULL,
 Region  VARCHAR2(25) NOT NULL,
 PRIMARY KEY(COD_P)
);

-- Insert before trigger definition to avoid id overwriting with sequence values
INSERT INTO Province (COD_P, Province, Region) VALUES (11,'Torino','Piemonte');

-- Create auto_increment for COP_P
-- DROP SEQUENCE COD_P_seq;
CREATE SEQUENCE COD_P_seq; 

CREATE OR REPLACE TRIGGER Province_tr
BEFORE INSERT ON Province
FOR EACH ROW

BEGIN
  IF :new.COD_P IS NULL THEN
    SELECT COD_P_seq.NEXTVAL
    INTO   :new.COD_P
    FROM   dual;
  END IF;
END;
/
-- End

CREATE TABLE TimeDim
(
 COD_T INT NOT NULL,
 Month INT NOT NULL,
 Quarter INT NOT NULL,
 FourMonth_Period INT NOT NULL,
 Year INT NOT NULL,
 PRIMARY KEY(COD_T)
);

INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (273,6,2,2,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (274,1,1,1,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (275,5,2,2,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (276,10,4,3,2005);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (277,2,1,1,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (278,4,2,1,2006);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (279,3,1,1,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (280,12,4,3,2005);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (281,9,3,3,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (282,8,3,2,2006);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (283,3,1,1,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (284,9,3,3,2006);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (285,10,4,3,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (286,5,2,2,2006);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (287,1,1,1,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (288,12,4,3,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (289,2,1,1,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (290,7,3,2,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (291,12,4,3,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (292,8,3,2,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (293,7,3,2,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (294,4,2,1,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (295,3,1,1,2006);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (296,6,2,2,2005);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (297,10,4,3,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (298,4,2,1,2003);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (299,9,3,3,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (300,1,1,1,2005);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (301,2,1,1,2005);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (302,3,1,1,2005);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (303,6,2,2,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (304,5,2,2,2004);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (305,7,3,2,2006);
INSERT INTO Timedim (COD_T, Month, Quarter, FourMonth_Period, Year) VALUES (306,8,3,2,2003);

-- DROP SEQUENCE COD_T_seq;
CREATE SEQUENCE COD_T_seq; 

CREATE OR REPLACE TRIGGER TimeDim_tr
BEFORE INSERT ON TimeDim
FOR EACH ROW

BEGIN
  IF :new.COD_T IS NULL THEN
    SELECT COD_T_seq.NEXTVAL
    INTO   :new.COD_T
    FROM   dual;
  END IF;
END;
/

CREATE TABLE CategoryDim
(
 COD_C INT NOT NULL,
 Category VARCHAR2(25) NOT NULL,
 PRIMARY KEY(COD_C)
);

INSERT INTO categorydim (COD_C, Category) VALUES (45,'Beach Umbrella');
INSERT INTO categorydim (COD_C, Category) VALUES (46,'Byke');
INSERT INTO categorydim (COD_C, Category) VALUES (47,'Motorbyke');
INSERT INTO categorydim (COD_C, Category) VALUES (48,'Sunbed');

-- DROP SEQUENCE COD_C_seq;
CREATE SEQUENCE COD_C_seq; 

CREATE OR REPLACE TRIGGER CategoryDim_tr
BEFORE INSERT ON CategoryDim
FOR EACH ROW

BEGIN
  IF :new.COD_C IS NULL THEN
    SELECT COD_C_seq.NEXTVAL
    INTO   :new.COD_C
    FROM   dual;
  END IF;
END;
/

CREATE TABLE Rental
(
 COD_T INT NOT NULL,
 COD_C INT NOT NULL,
 COD_P INT NOT NULL,
 NetIncome FLOAT NOT NULL,
 NumberOfRentedItems INT NOT NULL,
 PRIMARY KEY(COD_T, COD_C, COD_P),
 CONSTRAINT fk_cod_t
	FOREIGN KEY(COD_T) REFERENCES TimeDim(COD_T),
CONSTRAINT fk_cod_c
	FOREIGN KEY(COD_C) REFERENCES CategoryDim(COD_C),
CONSTRAINT fk_cod_p
	FOREIGN KEY(COD_P) REFERENCES Province(COD_P)
);

INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (273,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (273,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (273,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (273,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (274,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (274,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (274,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (274,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (275,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (275,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (275,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (275,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (276,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (276,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (276,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (276,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (277,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (277,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (277,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (277,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (278,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (278,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (278,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (278,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (279,45,11,131600,4480);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (279,46,11,74200,2240);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (279,47,11,17080,560);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (279,48,11,118720,3920);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (280,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (280,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (280,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (280,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (281,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (281,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (281,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (281,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (282,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (282,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (282,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (282,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (283,45,11,131600,4480);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (283,46,11,74200,2240);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (283,47,11,17080,560);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (283,48,11,118720,3920);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (284,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (284,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (284,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (284,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (285,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (285,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (285,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (285,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (286,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (286,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (286,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (286,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (287,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (287,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (287,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (287,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (288,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (288,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (288,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (288,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (289,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (289,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (289,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (289,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (290,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (290,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (290,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (290,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (291,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (291,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (291,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (291,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (292,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (292,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (292,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (292,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (293,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (293,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (293,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (293,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (294,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (294,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (294,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (294,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (295,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (295,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (295,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (295,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (296,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (296,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (296,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (296,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (297,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (297,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (297,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (297,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (298,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (298,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (298,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (298,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (299,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (299,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (299,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (299,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (300,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (300,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (300,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (300,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (301,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (301,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (301,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (301,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (302,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (302,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (302,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (302,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (303,45,11,70500,2400);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (303,46,11,39750,1200);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (303,47,11,9150,300);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (303,48,11,63600,2100);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (304,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (304,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (304,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (304,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (305,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (305,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (305,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (305,48,11,80560,2660);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (306,45,11,89300,3040);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (306,46,11,50350,1520);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (306,47,11,11590,380);
INSERT INTO rental (COD_T, COD_C, COD_P, NetIncome, NumberOfRentedItems) VALUES (306,48,11,80560,2660);

commit;
