-
Notifications
You must be signed in to change notification settings - Fork 34
/
senate.table.sql
39 lines (38 loc) · 1.96 KB
/
senate.table.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
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `senate`;
CREATE TABLE `senate` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`state` varchar(2) COLLATE utf8_unicode_ci NOT NULL,
`bioguide` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`thomas` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`govtrack` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`opensecrets` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`votesmart` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`party` enum('democrat','republican','independent') COLLATE utf8_unicode_ci NOT NULL,
`status` enum('active','inactive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
`majority_leader` tinyint(1) NOT NULL DEFAULT '0',
`majority_whip` tinyint(1) NOT NULL DEFAULT '0',
`minority_leader` tinyint(1) NOT NULL DEFAULT '0',
`minority_whip` tinyint(1) NOT NULL DEFAULT '0',
`class` enum('I','II','III') COLLATE utf8_unicode_ci NOT NULL,
`gender` enum('female','male') COLLATE utf8_unicode_ci NOT NULL,
`ethnicity` enum('african-american','asian-american','hispanic-american','white') COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`date_of_birth` datetime NOT NULL,
`entered_office` datetime NOT NULL,
`term_end` datetime NOT NULL,
`latitude` float NOT NULL,
`longitude` float NOT NULL,
`address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
`twitter_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`facebook_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`photo_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`biography` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `senate_congress_id` (`bioguide`),
KEY `senate_state` (`state`),
KEY `senate_class` (`class`),
KEY `senate_party` (`party`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;