Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.39 KB | None | 0 0
  1. create table casa(
  2.     id int auto_increment primary key,
  3.     cep varchar(30) not null,
  4.     hidrometro varchar(30) not null,
  5.     matCopel varchar(30) not null
  6. );
  7.  
  8. create table morador(
  9.     cpf int not null,
  10.     nome varchar(50) not null,
  11.     rg varchar(20) not null,
  12.     nCasa int not null,
  13.     primary key(cpf),
  14.     foreign key(nCasa) references casa(id)
  15. );
  16.  
  17. select * from casa inner join morador on id = nCasa;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement