Changes

Jump to: navigation, search

Cassandra -NoSQL database

923 bytes added, 13:49, 30 September 2018
no edit summary
=Lekérdezések=
https://www.datastax.com/2012/01/getting-started-with-cassandra
 
 
Adatbázis létrehozása:
cqlsh> create keyspace adam with replication = {'class':'SimpleStrategy','replication_factor':1};
 
 
Tábla létrehozása:
cqlsh> use adam;
cqlsh:adam> create table emp (empid int primary key, emp_first varchar, emp_last varchar, emp_dept varchar);
 
 
Adat beszúrása:
cqlsh:adam> insert into emp (empid, emp_first, emp_last, emp_dept) values (1,'fred','smith','eng');
 
 
 
Lekérdezés index-ra:
<pre>
cqlsh:adam> SELECT * FROM adam.emp;
empid | emp_dept | emp_first | emp_last
-------+----------+-----------+----------
1 | eng | fred | smith
2 | eng | fred | smith
</pre>
https://www.datastax.com/2012/01/getting-started-with-cassandra
Lekérdezés filterrel:
<pre>
cqlsh:adam> SELECT * FROM adam.emp WHERE emp_last = 'smith' ALLOW FILTERING;
empid | emp_dept | emp_first | emp_last
-------+----------+-----------+----------
1 | eng | fred | smith
2 | eng | fred | smith
</pre>
=Adatbázis GUI=

Navigation menu