Created
July 7, 2014 14:09
-
-
Save insidegui/7ed3bb342618ad5bebee to your computer and use it in GitHub Desktop.
SQL para banco de dados da aula sobre PDO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 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