Skip to content

Instantly share code, notes, and snippets.

@stormpython
Created June 5, 2014 08:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save stormpython/6ea444f2c65ff1a4ed76 to your computer and use it in GitHub Desktop.
Save stormpython/6ea444f2c65ff1a4ed76 to your computer and use it in GitHub Desktop.
Example MySQL schema
-- Example table schema
-- To import your schemas into your database, run:
-- `mysql -u username -p database < schema.sql`
-- where username is your MySQL username
-- Load data into table
-- LOAD DATA LOCAL INFILE 'country.csv' INTO TABLE world_index
-- FIELDS TERMINATED BY ','
-- ENCLOSED BY ''
-- LINES TERMINATED BY '\n'
-- IGNORE 1 LINES
-- (country, median_age, gdp, edu_index);
CREATE TABLE IF NOT EXISTS world_index (
id INT NOT NULL AUTO_INCREMENT,
country CHAR(50) NULL,
median_age DECIMAL(3, 1) NULL,
gdp INT NULL,
edu_index DECIMAL(4, 3) NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment