Created
December 13, 2014 18:18
-
-
Save samuelsonbrito/3de4e61d633cb3bcf79a to your computer and use it in GitHub Desktop.
Criando tabelas no MySQL
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 departamentos ( | |
codigo int not null primary key auto_increment, | |
nome varchar (50)); | |
create table funcionarios ( | |
codigo int not null primary key auto_increment, | |
primeiroNome varchar (50) not null, | |
segundoNome varchar (50), | |
ultimoNome varchar (50) not null, | |
dataNascimento date, | |
cpf varchar (14), | |
rg varchar (8), | |
endereco varchar (100), | |
cep varchar (9), | |
cidade varchar (30), | |
fone varchar (13), | |
funcao varchar (20), | |
salario decimal (10,2), | |
codigoDepartamento int not null, | |
foreign key(codigoDepartamento)references departamentos(codigo)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment