use moma;

load data local infile 'Artworks.csv'
into table artworks
character set 'utf8'
FIELDS TERMINATED BY ',' optionally ENCLOSED BY '"'
  escaped by ''
  LINES TERMINATED BY '\n'
  IGNORE 1 LINES
  (title,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,
  workdate,medium,dimensions,creditline,accessionnumber,
  classification,department,dateacquired,cataloged,objectid,
  url,thumbnailurl,@circumference,@depth,@diameter,@height,@length,
  @weight,@width,@seatheight,@duration)
  set
  circumference = nullif(@circumference,''),
  depth = nullif(@depth,''),
  diameter = nullif(@diameter,''),
  height = nullif(@height,''),
  length = nullif(@length,''),
  weight = nullif(@weight,''),
  width = nullif(@width,''),
  seatheight = nullif(@seatheight,''),
  duration = nullif(@duration,'')
  ;
  
