Skip to content

Instantly share code, notes, and snippets.

@insidegui
Created July 7, 2014 14:09
Show Gist options
  • Save insidegui/7ed3bb342618ad5bebee to your computer and use it in GitHub Desktop.
Save insidegui/7ed3bb342618ad5bebee to your computer and use it in GitHub Desktop.
SQL para banco de dados da aula sobre PDO
-- Create syntax for TABLE 'lists'
CREATE TABLE `lists` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`color` varchar(7) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Create syntax for TABLE 'tasks'
CREATE TABLE `tasks` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`list_id` int(11) unsigned NOT NULL,
`title` varchar(255) DEFAULT NULL,
`done` tinyint(1) unsigned DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `lists` (`id`, `title`, `color`)
VALUES
(4, 'Lista teste', '#E3FFE1');
INSERT INTO `tasks` (`id`, `list_id`, `title`, `done`)
VALUES
(6, 4, 'Tarefa teste', 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment