Skip to content

Latest commit

 

History

History
58 lines (49 loc) · 1.88 KB

step4-cassandra.md

File metadata and controls

58 lines (49 loc) · 1.88 KB
Queries in Apache Cassandra® ℹ️ For technical support, please contact us via email or LinkedIn.
⬅️ Back Step 4 of 11 Next ➡️
Querying table "users"

Table users stores information about users who are uniquely identified by their email addresses. This table has single-row partitions and the primary key defined as PRIMARY KEY ((email)). Let's first retrieve all rows from the table to learn how the data looks like and then focus on predicates that the primary key can support.

✅ Q1. Retrieve all rows:

SELECT * FROM users;

✅ Q2. Retrieve one row/partition:

SELECT * FROM users
WHERE email = 'joe@datastax.com';

✅ Q3. Retrieve two rows/partitions:

SELECT * FROM users
WHERE email IN ('joe@datastax.com',
                'jen@datastax.com');
⬅️ Back Next ➡️