CREATE DATABASE stocks;

\c stocks;

CREATE TABLE stocks (
  DATE_STOCK varchar(8), 
  YEAR integer,
  MONTH integer,
  OPEN double precision,
  HIGH double precision,
  LOW  double precision,
  CLOSE  double precision,
  VOLUME integer,
  id integer PRIMARY KEY
);

\COPY stocks FROM 'C:\Users\jpn.INFORMATICA\Downloads\stocks.csv' DELIMITER ',' CSV HEADER;