text: DROP DATABASE IF EXISTS `places`;
  
  CREATE DATABASE `places`;
  
  USE `places`;
  
  CREATE TABLE `locations` (
    `id` INT unsigned NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(100) NOT NULL,
    `description` VARCHAR(250),
    `type` char(1) NOT NULL DEFAULT '',
    `latitude` DECIMAL(9,6) NOT NULL,
    `longitude` DECIMAL(9,6) NOT NULL,
    `attr` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attr`)),
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  /* Load data */
  
  /* Locations */
  INSERT INTO `locations` (`name`, `description`, `type`, `latitude`, `longitude`, `attr`)
  VALUES
  	('The Scout', 'A sports bar in South Loop', 'R', 41.865624, -87.625283, X'7B2264657461696C73223A207B22666F6F6454797065223A20224D65786963616E222C20226D656E75223A2022687474703A2F2F74686573636F75746368696361676F2E636F6D227D2C20226661766F7269746573223A205B7B226465736372697074696F6E223A202257726170222C20227072696365223A202224392E3939227D5D7D'),
  	('Chicago Cut Steakhouse', 'A steakhoue in River North', 'R', 41.887884, -87.633075, X'7B2264657461696C73223A207B2022666F6F6454797065223A22537465616B686F757365222C20226D656E75223A22687474703A2F2F74686573636F75746368696361676F2E636F6D227D2C20226661766F7269746573223A205B5D7D'),
  	('The Art Institute of Chicago', 'Renowned art museum holding nearly 300,000 works from all over the world, spanning many centuries.', 'A', 41.879585, -87.623713, X'7B2263617465676F7279223A20224D757365756D222C20226C617374566973697444617465223A202231312F352F32303139227D'),
  	('United Center', 'NBA stadium - home of the Bulls and Blackhawks', 'S', 41.880691, -87.674176, X'7B2264657461696C73223A207B22796561724F70656E6564223A20313939342C20226361706163697479223A2032333530307D2C20226576656E7473223A205B7B2264617465223A202231302F31382F32303139222C20226465736372697074696F6E223A202242756C6C732076732043656C74696373227D2C207B2264617465223A202231302F32312F32303139222C20226465736372697074696F6E223A202242756C6C73207673204C616B657273227D2C207B2264617465223A202231312F352F32303139222C20226465736372697074696F6E223A202242756C6C73207673204275636B73227D2C207B2264617465223A202231312F352F32303139222C20226465736372697074696F6E223A2022426C61636B6861776B7320767320426C756573227D5D7D'),
  	('Guaranteed Rate Field', 'MLB stadium - home of the White Sox', 'S', 41.829902, -87.633752, X'7B2264657461696C73223A207B22796561724F70656E6564223A20313939312C20226361706163697479223A2034303631357D2C20226576656E7473223A205B7B2264617465223A2022352F312F32303230222C20226465736372697074696F6E223A20225768697465736F7820767320526F79616C73227D5D7D'),
  	('Willis Tower', NULL, 'A', 41.878876, -87.635915, X'7B2263617465676F7279223A20224C616E646D61726B222C20226C617374566973697444617465223A202231312F31312F32303139227D'),
  	('Soldier Field', 'NFL stadium - home of the Bears', 'S', 41.862313, -87.616688, X'7B2264657461696C73223A207B2022796561724F70656E6564223A20313932322C20226361706163697479223A2036313530307D2C20226576656E7473223A205B7B2264617465223A202231302F32302F32303139222C20226465736372697074696F6E223A20224265617273207673205361696E7473227D2C207B2264617465223A202231302F32372F32303139222C20226465736372697074696F6E223A20224265617273207673204368617267657273227D5D7D'),
  	('Cloud Gate', NULL, 'A', 41.882661, -87.623304, X'7B2263617465676F7279223A20224C616E646D61726B222C20226C617374566973697444617465223A202231312F352F32303139227D'),
  	('Navy Pier', 'An outdoor shopping center', 'A', 41.891863, -87.605094, X'7B2263617465676F7279223A202253686F7070696E672043656E746572222C20226C617374566973697444617465223A202231312F382F32303139227D'),
  	('The Publican', NULL, 'R', 41.886629, -87.648851, X'7B2264657461696C73223A207B22666F6F6454797065223A2022416D65726963616E222C20226D656E75223A2022687474703A2F2F7777772E7468657075626C6963616E72657374617572616E742E636F6D2F227D2C20226661766F7269746573223A205B7B226465736372697074696F6E223A2022427572676572222C20227072696365223A20222431322E3939227D2C207B226465736372697074696F6E223A202257696E6773222C20227072696365223A202224392E3939227D2C207B226465736372697074696F6E223A202253616C6164222C20227072696365223A202224382E3939227D2C207B226465736372697074696F6E223A202257726170222C20227072696365223A20222431342E3939227D2C207B226465736372697074696F6E223A2022537465616B222C20227072696365223A20222432392E3030227D5D7D'),
  	('Sunda', 'An Asian restaurant in River North', 'R', 41.890952, -87.631743, X'7B2264657461696C73223A207B22666F6F6454797065223A2022417369616E222C20226D656E75223A2022687474703A2F2F73756E64616E6577617369616E2E636F6D227D2C20226661766F7269746573223A205B5D7D'),
  	('Chicago French Market', NULL, 'A', 41.884137, -87.640973, X'7B2263617465676F7279223A202253686F7070696E67222C20226C617374566973697444617465223A202231302F33312F32303139227D'),
  	('The Chicago Theatre', NULL, 'A', 41.885264, -87.627647, X'7B2263617465676F7279223A202254686561746572222C20226C617374566973697444617465223A202231312F342F32303139227D'),
  	('Giordanos', NULL, 'R', 41.876388, -87.647639, X'7B2264657461696C73223A207B22666F6F6454797065223A202250697A7A61222C20226D656E75223A2022687474703A2F2F7777772E67696F7264616E6F732E636F6D2F6D656E75227D2C20226661766F7269746573223A205B7B226465736372697074696F6E223A20224368696361676F20436C6173736963222C20227072696365223A20222432342E3939227D2C207B226465736372697074696F6E223A202253616C6164222C20227072696365223A202224392E3939227D5D7D');
  