Advertisement
Guest User

Untitled

a guest
Feb 6th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 2.67 KB | None | 0 0
  1. CREATE DATABASE CadastroVisita;
  2.  
  3. USE CadastroVisita;
  4.  
  5. CREATE TABLE fossil (
  6. nome VARCHAR (30),
  7. telefone INT,
  8. email varcharacter (30),
  9. curso VARCHAR (30),
  10. PRIMARY KEY (nome)
  11. );
  12.  
  13. CREATE TABLE alunos (
  14. nome VARCHAR (30),
  15. matricula varcharacter (30),
  16. idade INT,
  17. codinstrumentro VARCHAR (40),
  18. telefone DOUBLE,
  19. PRIMARY  KEY (nome)
  20. );
  21.  
  22. CREATE TABLE instrumentos (
  23. codinstrumento INT,
  24. nomeinstrumento VARCHAR (40),
  25. quantidadeinstrumento INT
  26. );
  27. SELECT * FROM  alunos;
  28. SELECT telefone FROM fossil;
  29. SELECT * FROM fossil ORDER BY nome ASC;
  30.  
  31.  
  32. SELECT * FROM  instrumentos;
  33.  
  34. UPDATE instrumentos SET nomeinstrumento='cigarra eletrica' WHERE codinstrumento= '1';
  35.  
  36. DELETE FROM instrumentos WHERE codinstrumento=3;
  37.  
  38. INSERT INTO instrumentos (codinstrumento,nomeinstrumento, quantidadeinstrumento) VALUES (6,'moto', 9) ;
  39.  
  40.  
  41.  
  42. INSERT INTO fossil (nome,telefone, email, curso) VALUES ('Ricardo','869529356', 'ricoarrigoni@gmail.com', 'gestão ambiental') ;
  43. INSERT INTO fossil (nome,telefone, email, curso) VALUES ('karol','869529356', 'kerol@gmail.com', 'gestão ambiental') ;
  44. INSERT INTO fossil (nome,telefone, email, curso) VALUES ('Veronia','86982356', 'veroas@gmail.com', 'gestão ambiental') ;
  45. INSERT INTO fossil (nome,telefone, email, curso) VALUES ('Gildet','86956542', 'gildet@gmail.com', 'gestão ambiental') ;
  46. INSERT INTO fossil (nome,telefone, email, curso) VALUES ('Bruno','86935378', 'rlo@gmail.com', 'gestão ambiental') ;
  47.  
  48. INSERT INTO alunos (nome,matricula,idade,codinstrumentro,telefone) VALUES ('Ricardo','201gavb001','24', '01','869529356') ;
  49. INSERT INTO alunos (nome,matricula,idade,codinstrumentro,telefone) VALUES ('karol','201gavb002','34', '05','869529356') ;
  50. INSERT INTO alunos (nome,matricula,idade,codinstrumentro,telefone) VALUES ('Veronica','201gavb023','26', '01','86982356') ;
  51. INSERT INTO alunos (nome,matricula,idade,codinstrumentro,telefone) VALUES ('Gildet','201gavb015','27', '04','86956542') ;
  52. INSERT INTO alunos (nome,matricula,idade,codinstrumentro,telefone) VALUES ('Bruno','201gavb013','21', '03','86935378') ;
  53. INSERT INTO alunos (nome,matricula,idade,codinstrumentro,telefone) VALUES ('Tiririca','201gab025','18','05','8694829419');
  54.  
  55. INSERT INTO instrumentos (codinstrumento,nomeinstrumento,quantidadeinstrumento) VALUES (01,'rede',05);
  56. INSERT INTO instrumentos (codinstrumento,nomeinstrumento,quantidadeinstrumento) VALUES (02,'tesoura',02);
  57. INSERT INTO instrumentos (codinstrumento,nomeinstrumento,quantidadeinstrumento) VALUES (03,'gancho',01);
  58. INSERT INTO instrumentos (codinstrumento,nomeinstrumento,quantidadeinstrumento) VALUES (04,'ciscador',02);
  59. INSERT INTO instrumentos (codinstrumento,nomeinstrumento,quantidadeinstrumento) VALUES (05,'balde',02);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement