Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 May NoSQL: Cassandra Important CQL shell commands

NoSQL: Cassandra Important CQL shell commands

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

In this post, I am sharing a list of important CQL shell commands of the Cassandra.

Get the help of all commands:

1
cassandra@cqlsh:dbrnd> help

Check the host and version:

1
2
3
4
cassandra@cqlsh:dbrnd> show host
Connected to Test Cluster at 127.0.0.1:9042.
cassandra@cqlsh:dbrnd> show version
[cqlsh 5.0.1 | Cassandra 3.5 | CQL spec 3.4.0 | Native protocol v4]

Check the cluster information:

1
2
3
4
5
6
7
8
9
cassandra@cqlsh:dbrnd> describe cluster;
 
Cluster: Test Cluster
Partitioner: Murmur3Partitioner
 
Range ownership:
7198801157164107876 [127.0.0.1]
-6388269565477727734 [127.0.0.1]
-13424558412243369 [127.0.0.1]

Check the keyspaces:

1
2
3
4
cassandra@cqlsh:dbrnd> describe keyspaces;
 
tutorialspoint system_auth dbrnd test
system_schema system system_distributed system_traces

Check the user defined tables:

1
2
3
cassandra@cqlsh:dbrnd> describe tables;
 
tbl_employee tbl_department users

Check the user defined types:

1
2
3
cassandra@cqlsh:dbrnd> describe types
 
sports_details sport

Check the consistency level:

1
2
cassandra@cqlsh:dbrnd> consistency
Current consistency level is ONE.

Make your table output expanded:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
cassandra@cqlsh:dbrnd> expand on
Now Expanded output is enabled
cassandra@cqlsh:dbrnd> select *from tbl_employee;
 
@ Row 1
--------------+--------
empid | 1
empfirstname | Anvesh
emplastname | Patel
empsalary | 50000
 
@ Row 2
--------------+--------
empid | 2
empfirstname | Neevan
emplastname | Patel
empsalary | 150000
 
(2 rows)

May 10, 2016Anvesh Patel
NoSQL: Cassandra default list of port usageSQL Server: Important System Tables for Backup and Restore
Anvesh Patel
Anvesh Patel

Database Engineer

May 10, 2016 Cassandra, NoSQLAnvesh Patel, Cassandra, Column Store, database, database research and development, dbrnd, Document Store, Graph Store, Key Value Store, NoSQL, Not Only SQL, Unstrucutred
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....