-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreatingTable_LoadingData.sql
53 lines (50 loc) · 1.64 KB
/
CreatingTable_LoadingData.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SET GLOBAL local_infile=1;
show global variables like 'local_infile';
Show Databases;
#------------------------------------------
USE steamgamedata;
SHOW TABLES;
CREATE TABLE `steamgamedata`.`steam_data` (
`GameID` INT NOT NULL,
`Title` VARCHAR(255) NOT NULL,
`OriginalPrice` INT NOT NULL,
`DiscountedPrice` INT NOT NULL,
`ReleaseDate` TEXT(45) NULL,
`RecentReviewsSummary` TEXT(45) NULL,
`AllReviewsSummary` TEXT(45) NULL,
`Developer` TEXT(255) NULL,
`Publisher` TEXT(255) NULL,
`ReviewPercent` INT NULL,
`Reviews` INT NULL,
`OS` VARCHAR(255) NULL,
`Processor` VARCHAR(255) NULL,
`Memory` VARCHAR(45) NULL,
`Graphics` VARCHAR(255) NULL,
`DirectX` VARCHAR(45) NULL,
`Storage` VARCHAR(45) NULL,
`InLanguages` INT NULL,
`Shooter` TEXT(45) NOT NULL,
`Action` TEXT(45) NOT NULL,
`Adventure` TEXT(45) NOT NULL,
`Simulation` TEXT(45) NOT NULL,
`Racing` TEXT(45) NOT NULL,
`Strategy` TEXT(45) NOT NULL,
`RPG` TEXT(45) NOT NULL,
`BattleRoyale` TEXT(45) NOT NULL,
`MOBA` TEXT(45) NOT NULL,
`Horror` TEXT(45) NOT NULL,
PRIMARY KEY (`GameID`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci
COMMENT = 'Information of Steam games and Game data';
ALTER TABLE `steamgamedata`.`steam_data`
CHANGE COLUMN `ReviewPercent` `ReviewPercent` VARCHAR(255) NULL DEFAULT NULL ,
CHANGE COLUMN `Reviews` `Reviews` VARCHAR(255) NULL DEFAULT NULL,
CHANGE COLUMN `ReleaseDate` `ReleaseDate` VARCHAR(255) NULL DEFAULT NULL ;
LOAD DATA LOCAL INFILE 'D:/Professional Data Analytics Cert-GOOGLE/EDA/Steam_Data/SteamData.csv'
INTO TABLE steam_data
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 1 ROWS;