Wikipedia:Persondata/table.sql

From Wikipedia, the free encyclopedia

--
-- Table structure for table `pub_pd_en`
--

DROP TABLE IF EXISTS `pub_pd_en`;
CREATE TABLE `pub_pd_en` (
 -- internal page id
 `pd_id` int(8) NOT NULL default '0',
 -- original data of persondata template
 `pd_article` varchar(255) NOT NULL default ,
 `pd_name` varchar(255) NOT NULL default ,
 `pd_alternative` varchar(255) NOT NULL default ,
 `pd_description` varchar(255) NOT NULL default ,
 `pd_born` varchar(255) NOT NULL default ,
 `pd_born_in` varchar(255) NOT NULL default ,
 `pd_died` varchar(255) NOT NULL default ,
 `pd_died_in` varchar(255) NOT NULL default ,
 -- original data of pnd template (first 9 characters)
 `pd_pnd` varchar(9) NOT NULL default ,
 -- checked pnd number 
 `pnd_nr` varchar(9) NOT NULL default ,
 `pnd_date` date default NULL,
 -- disambiguation of given and surname 
 `n_given` varchar(255) NOT NULL default ,
 `n_surname` varchar(255) NOT NULL default ,
 `n_suffix` varchar(255) NOT NULL default ,
 -- place of birth wikipedia article if specified
 `b_place` varchar(255) NOT NULL default ,
 -- place of death wikipedia article if specified
 `d_place` varchar(255) NOT NULL default ,
 -- day, month, year, decade, century of birth if known
 `b_day` tinyint(4) default NULL,
 `b_month` tinyint(4) default NULL,
 `b_year` smallint(6) default NULL,
 `b_decade` smallint(6) NOT NULL default '0',
 `b_century` tinyint(4) default NULL,
 -- two years if date of birth is known to be in a time span
 `b_year1` smallint(6) default NULL,
 `b_year2` smallint(6) default NULL,
 -- note (indication of uncertainty etc.)
 `b_note` varchar(255) NOT NULL default ,
 -- day, month, year, decade, century of dead if known
 `d_day` tinyint(4) default NULL,
 `d_month` tinyint(4) default NULL,
 `d_year` smallint(6) default NULL,
 `d_decade` smallint(6) NOT NULL default '0',
 `d_century` tinyint(4) default NULL,
 -- two years if date of dead is known to be in a time span
 `d_year1` smallint(6) default NULL,
 `d_year2` smallint(6) default NULL,
 -- note (indication of uncertainty etc.)
 `d_note` varchar(255) NOT NULL default ,
 PRIMARY KEY  (`pd_id`)
);

-- Bulk insert like this:
LOAD DATA LOCAL INFILE '20070908-full.tab' INTO TABLE pub_pd_en;