Ahmad Farid
Ahmad Farid

Reputation: 14764

How to view all tables in CQL and CQLSH?

I'm trying to explore the database and want to see all tables that exist there. What's the command that's equivalent to SHOW TABLES; in SQL?

Upvotes: 13

Views: 18802

Answers (3)

adinas
adinas

Reputation: 4550

Depending on the version of Cassandra, the following may work for you

SELECT * FROM system_schema.tables

Check out the other tables in the system_schema keyspace to see what other info you can get

Upvotes: 3

Laxmikant
Laxmikant

Reputation: 1611

to get all table names : DESC tables;

to get detailed view of a table : DESC table <table_name>;

to get detailed view of all tables in a keyspace : DESC keyspace <keyspace_name>;

Upvotes: 18

NiVeR
NiVeR

Reputation: 9786

Yes, you can use the DESCRIBE command:

DESCRIBE tables;

Upvotes: 9

Related Questions