Created
August 11, 2012 15:52
-
-
Save gabrielslau/3325363 to your computer and use it in GitHub Desktop.
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 TABLE users ( | |
| id INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
| group_id INT UNSIGNED NOT NULL, | |
| name VARCHAR(200) NOT NULL, | |
| username VARCHAR(20) NOT NULL, | |
| estado VARCHAR(40) NOT NULL, | |
| active TINYINT(1) NOT NULL DEFAULT 1, | |
| PRIMARY KEY(id), | |
| FOREIGN KEY(group_id) REFERENCES groups(id), | |
| UNIQUE(username) | |
| ) ENGINE=INNODB; | |
| INSERT INTO users(group_id, name, username, estado) VALUES(1, 'Pedro Elsner', 'pelsner', 'São Paulo'); | |
| INSERT INTO users(group_id, name, username, estado) VALUES(1, 'Petter Morato', 'pmorato', 'Rio de Janeiro'); | |
| INSERT INTO users(group_id, name, username, estado, active) VALUES(2, 'Lucas Pedro Mariano Elsner', 'lpmelsner', 'São Paulo', 0); | |
| INSERT INTO users(group_id, name, username, estado, active) VALUES(2, 'Rebeca Moraes Silva', 'rebeca_moraes', 'Rio Grande do Norte', 0); | |
| INSERT INTO users(group_id, name, username, estado, active) VALUES(2, 'Silvia Morato Moraes', 'silvia22', 'Rio Grande do Sul', 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment