SHARE
TWEET

Untitled

a guest Nov 22nd, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create database bdAgenciaCarro;
  2.  
  3. use bdAgenciaCarro;
  4.  
  5. create table tbContato(
  6.      idContato int primary key auto_increment
  7.     ,nomeContato varchar(40)
  8.     ,emailContato varchar(60)
  9.     ,assuntoContato varchar (120)
  10.     ,msgContato varchar(40)
  11. );
  12.  
  13. insert into tbContato values(null,'João','joao@gmail.com','Tit mensagem','tx mensagem');
  14.  
  15. create table tbMarca(
  16.     idMarca int primary key auto_increment
  17.     ,marca varchar(60)
  18. );
  19.  
  20. insert into tbMarca values(null,'Hyundai');
  21. insert into tbMarca values(null,'Honda');
  22. insert into tbMarca values(null,'Volkswagen');
  23. insert into tbMarca values(null,'Fiat');
  24.  
  25. select * from tbContato;
  26.  
  27.     create table tbVeiculo(
  28.         idVeiculo int primary key auto_increment
  29.         ,modelo varchar(40)
  30.         ,idMarca int
  31.         ,valor float
  32.         ,foreign key (idMarca) references tbMarca(idMarca)
  33.     );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top