ALTER SESSION SET NLS_DATE_FORMAT = 'dd-mm-yyyy';
CREATE TABLE CENTRO_UPS(
	ID INTEGER NOT NULL,
	TIPO VARCHAR(50),
	DIRECCION VARCHAR(50) NOT NULL,
	CONSTRAINT PK_ID PRIMARY KEY(ID)
);

CREATE SEQUENCE SEQUENCE_ID
	START WITH 1
	INCREMENT BY 1;


CREATE TABLE ARTICULOS(
	NRO_ARTICULOS INTEGER NOT NULL,
	ID_CENTRO INTEGER,
	PESO FLOAT NOT NULL, 
	DIMENSION VARCHAR(10) NOT NULL,
	IMPORTE INTEGER NOT NULL,
	FECHA_FINAL DATE NOT NULL,
	DESTINO VARCHAR(50) NOT NULL, 
	CONSTRAINT PK_NRO_ARTICULOS PRIMARY KEY(NRO_ARTICULOS),
	CONSTRAINT FK_ID_CENTRO FOREIGN KEY(ID_CENTRO) REFERENCES CENTRO_UPS(ID)
);

CREATE SEQUENCE SEQUENCE_NRO_ARTICULOS
	START WITH 1
	INCREMENT BY 1;

CREATE TABLE TRANSPORTE(
	N_EVENTO INTEGER NOT NULL,
	TIPO VARCHAR(20) NOT NULL,
	RUTA VARCHAR(30) NOT NULL,
	DIRECCION VARCHAR(30) NOT NULL,
	CONSTRAINT PK_N_EVENTO PRIMARY KEY(N_EVENTO)	
);
CREATE SEQUENCE SEQUENCE_N_EVENTO
	START WITH 1
	INCREMENT BY 1;

INSERT INTO CENTRO_UPS(ID,TIPO,DIRECCION)
VALUES(SEQUENCE_ID.NEXVAL,"CENTRO DE EMBALAJE","MARIANO ROQUE ALONSO");

INSERT INTO ARTICULOS(NRO_ARTICULOS,PESO,DIMENSION,IMPORTE,FECHA_FINAL,DESTINO)
VALUES(SEQUENCE_NRO_ARTICULOS.NEXVAL,8.3,"10X10CM",50000,'19/10/2021');

INSERT INTO ARTICULOS(NRO_ARTICULOS,PESO,DIMENSION,IMPORTE,FECHA_FINAL,DESTINO)
VALUES(SEQUENCE_NRO_ARTICULOS.NEXVAL,7.4,"5X10CM",80000,'28/10/2021');

INSERT INTO TRANSPORTE(N_EVENTO,TIPO,RUTA,DIRECCION)
VALUES(SEQUENCE_N_EVENTO.NEXVAL,"AUTOMOVIL","TRANSCHACO","MARIANO ROQUE ALONSO");