Skip to content

Instantly share code, notes, and snippets.

@glamp glamp/load_basketball.sql
Last active Dec 24, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.