STEP #1: CREATE TABLE

CREATE TABLE flight_delays (
  year INTEGER,
  month INTEGER,
  dayofmonth INTEGER,
  dayofweek INTEGER,
  deptime INTEGER,
  arrtime INTEGER,
  flightnum INTEGER,
  tailnum VARCHAR,
  airtime INTEGER,
  arrdelay INTEGER,
  depdelay INTEGER,
  origin VARCHAR,
  dest VARCHAR,
  distance INTEGER);

STEP #2: COPY THE DATA

COPY flight_delays
FROM PROGRAM 'wget -qO- https://sendatree.eu/sql_practicing.csv'
DELIMITER ',' CSV HEADER;

STEP #3: COMMIT

COMMIT;

STEP #4: ENJOY 🙂

SELECT * FROM flight_delays LIMIT 10;

FULL VIDEO

LINKS MENTIONED


Cheers,
Tomi Mester