Apache Cassandra Flashcards

1
Q

What year was Apache Cassandra originally released as open source?

a) 2005
b) 2008
c) 2010
d) 2012

A

b) 2008

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following companies is NOT mentioned as a large-scale user of Apache Cassandra?

a) Apple
b) Netflix
c) Amazon
d) Uber

A

c) Amazon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the default replication factor for a new database created in Astra DB?

a) 1
b) 2
c) 3
d) 4

A

c) 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of a keyspace in Apache Cassandra?

a) To define the data types for columns
b) To logically separate tables in a multi-user database cluster
c) To encrypt data at rest
d) To manage user permissions

A

b) To logically separate tables in a multi-user database cluster

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following is a valid data type in Cassandra for storing text?

a) VARCHAR
b) TEXT
c) STRING
d) Both a) and b)

A

d) Both a) and b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the primary key used for in Apache Cassandra?

a) To encrypt data
b) To determine on which database nodes the data should be stored
c) To define foreign key relationships
d) To create indexes for faster queries

A

b) To determine on which database nodes the data should be stored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the role of the clustering key in a Cassandra table?

a) To define the partition key
b) To determine the on-disk sort order within a partition
c) To encrypt data within a partition
d) To create secondary indexes

A

b) To determine the on-disk sort order within a partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the STATIC keyword indicate in a Cassandra table definition?

a) The column value will be the same for all rows in a partition
b) The column value will be unique for each row
c) The column will not be stored on disk
d) The column will be encrypted

A

a) The column value will be the same for all rows in a partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which of the following is a valid CQL command to switch to a specific keyspace?

a) USE keyspace_name;
b) SWITCH TO keyspace_name;
c) SELECT keyspace_name;
d) CONNECT keyspace_name;

A

a) USE keyspace_name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of the token() function in Cassandra?

a) To generate a unique identifier for a row
b) To hash the partition key into a token for node placement
c) To encrypt data in transit
d) To create a backup of the database

A

b) To hash the partition key into a token for node placement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following is a valid CQL command to insert data into a Cassandra table?

a) INSERT INTO table_name VALUES (value1, value2);
b) ADD TO table_name VALUES (value1, value2);
c) UPDATE table_name SET column1 = value1;
d) CREATE table_name VALUES (value1, value2);

A

a) INSERT INTO table_name VALUES (value1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the default sort order for a clustering key in Cassandra if not specified?

a) Ascending (ASC)
b) Descending (DESC)
c) Random
d) No default sort order

A

a) Ascending (ASC)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following is NOT a valid method in the Cassandra Java driver for building a CqlSession?

a) withCloudSecureConnectBundle()
b) withAuthCredentials()
c) withKeyspace()
d) withEncryptionKey()

A

d) withEncryptionKey()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the finalize() method in the CassandraConn class?

a) To initialize the database connection
b) To close the database connection when the object is garbage collected
c) To execute a query
d) To create a new keyspace

A

b) To close the database connection when the object is garbage collected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which environment variable is used to specify the secure connect bundle file location in Astra DB?

a) ASTRA_DB_BUNDLE
b) ASTRA_DB_KEYSPACE
c) ASTRA_DB_PASSWORD
d) ASTRA_DB_USER

A

a) ASTRA_DB_BUNDLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the correct value for the ASTRA_DB_USER environment variable when using Astra DB?

a) The username provided during registration
b) The email address used to create the account
c) The literal word ‘token’
d) The client ID from the token file

A

c) The literal word ‘token’

17
Q

Which of the following is a valid CQL command to query data from a Cassandra table?

a) SELECT * FROM table_name WHERE column1 = value1;
b) FETCH * FROM table_name WHERE column1 = value1;
c) READ * FROM table_name WHERE column1 = value1;
d) QUERY * FROM table_name WHERE column1 = value1;

A

a) SELECT * FROM table_name WHERE column1 = value1;

18
Q

What is the purpose of the LIMIT clause in a CQL query?

a) To restrict the number of rows returned by the query
b) To define the partition key
c) To sort the results in ascending order
d) To encrypt the query results

A

a) To restrict the number of rows returned by the query

19
Q

Which of the following is a valid CQL command to create a table in Cassandra?

a) CREATE TABLE table_name (column1 TEXT PRIMARY KEY, column2 INT);
b) ADD TABLE table_name (column1 TEXT PRIMARY KEY, column2 INT);
c) DEFINE TABLE table_name (column1 TEXT PRIMARY KEY, column2 INT);
d) BUILD TABLE table_name (column1 TEXT PRIMARY KEY, column2 INT);

A

a) CREATE TABLE table_name (column1 TEXT PRIMARY KEY

20
Q

What is the purpose of the PreparedStatement in the Cassandra Java driver?

a) To execute a query without parameters
b) To prepare a query with placeholders for repeated execution
c) To create a new table
d) To close the database connection

A

b) To prepare a query with placeholders for repeated execution