Categories: Technologies

CQL, the Cassandra Query Language


CREATE COLUMNFAMILY users (
...     key varchar PRIMARY KEY,
...     full_name varchar,
...     birth_date int,
...     state varchar ... );

CREATE INDEX ON users (birth_date);
CREATE INDEX ON users (state);

INSERT INTO users (key, full_name, birth_date, state) VALUES ('bsanderson', 'Brandon Sanderson', 1975, 'UT');
INSERT INTO users (key, full_name, birth_date, state) VALUES ('prothfuss', 'Patrick Rothfuss', 1973, 'WI');
INSERT INTO users (key, full_name, birth_date, state) VALUES ('htayler', 'Howard Tayler', 1968, 'UT');

SELECT key, state FROM users;
key        | state |
bsanderson |    UT |
prothfuss  |    WI |
htayler    |    UT |

SELECT * FROM users WHERE state='UT' AND birth_date > 1970;
KEY        | birth_date |         full_name | state |
bsanderson |       1975 | Brandon Sanderson |    UT |

HBase has PigLatin, now Cassandra has CQL. It’s a natural evolve step for distributed databases that depend of Map-Reduce to query and processing data.

vinova

Recent Posts

Top 8 Government Grants in Singapore for Startups in 2024

Starting a new business can be a daunting task, especially when it comes to securing…

16 hours ago

TOP 30+ Web Development Terms Beginners Need to Know

Understanding the language of web development is important for anyone working in the tech field.…

2 days ago

Top 7 Rapid Mobile App Development Tools and Platforms

The mobile app market is exploding, with an estimated 128 billion downloads in 2020 alone.…

3 days ago

Top 15 Mobile Application Development Mistakes to Avoid in 2024

A shocking statistic: Over 25% of downloaded apps are used only once before being deleted,…

4 days ago

Top 10 Most Popular Cross-Platform App Frameworks in 2024

Mobile apps have become an essential component of business success. However, developing native apps for…

4 days ago

TOP 5 Must-Try Free Meditation Apps in 2024

The meditation app market is booming, with the best free meditation apps having a projected…

6 days ago