Advertisement
caarlos_silva

Base de Dados - Apache Cassandra

Nov 20th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. create keyspace robson with replication = {
  2. ‘class’:’SimpleStrategy’,
  3. ‘replication_factor’: 2
  4. };
  5.  
  6. use robson;
  7.  
  8. create table Jorge(
  9. id uuid,
  10. nome varchar,
  11. data timestamp,
  12. preco double,
  13. ips list<inet>,
  14. primary key(id));
  15.  
  16. insert into jorge(id, nome, data, preco, ips) values (Now(), 'Irineu Silva','2012-12-12',234.56,['127.0.1.1','127.1.1.1']);
  17.  
  18. insert into jorge(id, nome, data, preco, ips) values (Now(), ‘Augustinho Carrara’,’2011-11-11’,8001.6987,[‘192.168.0.1’]);
  19.  
  20. insert into jorge (id) values (Now());
  21.  
  22. insert into jorge(id, nome, data) values (Now(), ‘Santana’,’2017-11-23 18:30:00’);
  23.  
  24. create table Jao(
  25. id int,
  26. nome varchar,
  27. vivo boolean,
  28. contatos map<varchar, bigint>,
  29. primary key(id));
  30.  
  31. insert into Jao (id, nome, vivo, contatos) values (1, ‘Clayton’,true,{‘Will’:33667070});
  32.  
  33. insert into Jao (id,nome,vivo) values(1,’Tristao’,false) IF NOT EXISTS;
  34.  
  35. --insert into Jao(id,nome) values (2,’VAI SUMIR ISSO DAQUI’) USING TTL 30;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement