Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Write a script that takes the following mysql data,
- -- and imports it into a normalized, indexed postgres database.
- CREATE TABLE `polls` (
- `user_name` text NOT NULL,
- `poll_question` text NOT NULL,
- `poll_option_1` text NOT NULL,
- `poll_option_2` text NOT NULL,
- `poll_option_3` text NOT NULL,
- `poll_option_1_votes` int(11) NOT NULL,
- `poll_option_2_votes` int(11) NOT NULL,
- `poll_option_3_votes` int(11) NOT NULL
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- INSERT INTO `polls` VALUES ('bob','How should we respond?','Peacefully','Cautiously','Nuke it from orbit. It\'s the only way to be sure',6,6,66),('bob','What color was it, anyway?','Blue.','Vermilion.','A Suffusion of Yellow.',1,0,42),('jim','Does it work?','Infrequently.','Most of the time.','60% of the time, it works every time.',4,17,6);
- CREATE TABLE `users` (
- `user_name` text NOT NULL,
- `user_email` text NOT NULL
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- INSERT INTO `users` VALUES ('bob','bob@mailinator.com'),('jim','jim@mailinator.com'),('joe','joe@mailinator.com'),('sam','sam@mailinator.com');
Add Comment
Please, Sign In to add comment