Skip to content

Instantly share code, notes, and snippets.

@glamp
Last active December 24, 2015 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glamp/6714955 to your computer and use it in GitHub Desktop.
Save glamp/6714955 to your computer and use it in GitHub Desktop.
create database basketball;
create table basketball.boxscore(
id int,
id2 int,
date varchar(15),
game_id float,
team_home_abbr varchar(15),
team varchar(15),
player varchar(15),
player_id int,
minutes float,
fgm float,
fga float,
3pm float,
3pa float,
ftm float,
fta float,
offreb float,
defreb float,
totreb float,
assists float,
steals float,
blocks float,
turnovers float,
fouls float,
points float,
plusminus float
);
load data local infile 'boxscore.csv' into table basketball.boxscore fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 lines
(id, id2, date, game_id, team_home_abbr, team, player, player_id, minutes, fgm, fga, 3pm, 3pa,
ftm, fta, offreb, defreb, totreb, assists, steals, blocks, turnovers, fouls, points, plusminus);
create table basketball.team_game_count(
id int,
season varchar(30),
date varchar(15),
team varchar(50),
game_num int
);
load data local infile 'team_game_count.csv' into table basketball.team_game_count fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 lines
(id,season,date,team,game_num);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment