Tuesday 22 May 2012

create country table

CREATE TABLE  `eventlog`.`SceneVisitByCountry` (
  `SceneVisitByCountryID` int(10) NOT NULL,
  `Date` datetime NOT NULL,
  `CountryID` int(3) DEFAULT NULL,
  `Hour` int(2) NOT NULL,
  `SceneID` int(4) NOT NULL,
  `TotalMemberVisits` int(11) NOT NULL,
  `SubscribedMemberVisits` int(10) NOT NULL,
  `RegisteredMemberVisits` int(10) NOT NULL,
  `TotalTimeSpent` bigint(10) NOT NULL,
  `CreateDate` datetime NOT NULL,
  `ProductGroupID` int(1) DEFAULT NULL
) ENGINE=BRIGHTHOUSE DEFAULT CHARSET=latin1;


load data infile 'D:/InfobrightCSV/SVBC.csv' into table SceneVisitByCountry
fields terminated by '|' enclosed by '`'
lines terminated by '\r\n'
(SceneVisitByCountryID,Date,CountryID,hour,SceneID,TotalMemberVisits,SubscribedMemberVisits,RegisteredMemberVisits,TotalTimeSpent,CreateDate,ProductGroupID);


load data infile 'D:/test/scenelist.csv' into table eventlog.ka_scene
fields terminated by '|' enclosed by "'"
lines terminated by '\r\n'
(SceneID,SceneNAme);

DROP TABLE IF EXISTS `eventlog`.`ka_scene1`;
CREATE TABLE  `eventlog`.`ka_scene1` (
  `SceneID` int(11) NOT NULL,
  `SceneNAme` varchar(150) COLLATE latin1_bin NOT NULL
) ENGINE=BRIGHTHOUSE DEFAULT CHARSET=latin1 COLLATE=latin1_bin;

DROP TABLE IF EXISTS `eventlog`.`KA_Scene`;
CREATE TABLE  `eventlog`.`KA_Scene` (
  `SceneID` int(11) NOT NULL,
  `SceneNAme` varchar(150) COLLATE latin1_bin NOT NULL
) ENGINE=BRIGHTHOUSE DEFAULT CHARSET=latin1 COLLATE=latin1_bin;


load data infile 'D:/eventlog/scenelist.csv' into table ka_scene
fields terminated by '|' enclosed by '`'
lines terminated by '\r\n'
(SceneID,SceneNAme);

CREATE TABLE  `eventlog`.`scenevisitbyage` (

  `Date` datetime NOT NULL,
  `Hour` int(2) NOT NULL,
  `SceneID` int(4) NOT NULL,
  `SubscribedMemberVisits` int(10) NOT NULL,
  `RegisteredMemberVisits` int(10) NOT NULL,
  `CreateDate` datetime NOT NULL,
  `SceneVisitByAgeID` int(10) NOT NULL,
  `Age` int(3) DEFAULT NULL,
  `Gender` varchar(50) DEFAULT NULL,
  `TotalMemberVisits` int(11) NOT NULL,
  `TotalTimeSpent` bigint(10) NOT NULL,
  `ProductGroupID` int(1) DEFAULT NULL
) ENGINE=BRIGHTHOUSE DEFAULT CHARSET=latin1;

load data infile 'D:/infobrightcsv/SVBA.csv' into table scenevisitbyage
fields terminated by '|' enclosed by '`'
lines terminated by '\r\n'
(Date,Hour,SceneID,SubscribedMemberVisits,RegisteredMemberVisits,CreateDate,SceneVisitByAgeID,Age,Gender,TotalMemberVisits,TotalTimeSpent,ProductGroupID);

No comments:

Post a Comment