Premium

DataStax Cassandra Developer Certification Certification Questions and Answer (Dumps and Practice Questions)



Question : Which of the following command will help you to run a cql file storing all cql commands?
 : Which of the following command will help you to run a cql file storing all cql commands?
1. SOURCE filename.cql

2. EXECUTE filename.cql

3. Access Mostly Uused Products by 50000+ Subscribers

4. FIRE filename.cql

5. COMMIT filename.cql



Correct Answer : Get Lastest Questions and Answer :
Explanation:




Question : . Which of the following is correct statement with regards to Counter?

A. A counter column value is a 64-bit signed integer.
B. You cannot set the value of a counter, which supports two operations: increment and decrement.
C. To generate sequential numbers for surrogate keys, use the counter type.
D. You can create an index on a counter column

 : . Which of the following is correct statement with regards to Counter?
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,D
5. B,D

Correct Answer : Get Lastest Questions and Answer :
Explanation: A counter column value is a 64-bit signed integer. You cannot set the value of a counter, which
supports two operations: increment and decrement.

Use counter types as described in the "Using a counter" section. Do not assign this type to a column that serves as the
primary key or partition key. Also, do not use the counter type in a table that contains anything other than counter types and
the primary key. To generate sequential numbers for surrogate keys, use the timeuuid type instead of the counter type. You
cannot create an index on a counter column or set data in a counter column to expire using the Time-To-Live (TTL) property.





Question : You have been given below table definition

CREATE TABLE reviews (
review_id text,
downcount int,
upcount int,
creation_date timestamp,
PRIMARY KEY (review_id)
)

Now you want to update the upcount value by 1, hence you run the following query

update reviews set upcount = upcount +1 where review_id='123456';

What do you expect, out of this ?
 : You have been given below table definition
1. It will successfully increment upcount by 1 for review_id='123456'

2. Update will be successful, but upcount will not be incremented by 1.

3. Access Mostly Uused Products by 50000+ Subscribers

4. Creation of table statement will fail.


Correct Answer : Get Lastest Questions and Answer :
Explanation: : You can use Cassandra's counter columns data type. Keep in mind you cannot mix counter columns with
non-counter columns in the same column family if the non-counter columns are not part of the composite PRIMARY KEY. So you
have to separate the counters into another column family, say reviews_counts.

CREATE TABLE reviews (
review_id text,
creation_date timestamp,
PRIMARY KEY (review_id)
)

CREATE TABLE reviews_counts (
review_id text,
downcount counter,
upcount counter,
PRIMARY KEY (review_id)
)
Now the increment statement should work.

UPDATE keyspace.reviews_counts
SET upcount = upcount + 1
WHERE review_id=123456



Related Questions


Question : Which of the following are advantages of Cassandra Database?

A. Its not a Single Point of failure DB
B. It can be scaled linearly
C. Its a reliable DB
D. Data can be stored close to client

 : Which of the following are advantages of Cassandra Database?
1. A,B,C
2. B,C,D
3. A,C,D
4. A,B,C,D


Question : Primary purpose of Cassandra keyspace, is to define replication factor?


 : Primary purpose of Cassandra keyspace, is to define replication factor?
1. True
2. False


Question : Cassandra uses sequence to generate unique id number across all the nodes in cluster
 : Cassandra uses sequence to generate unique id number across all the nodes in cluster
1. True
2. False


Question : Last column in a primary key represent partition key
 : Last column in a primary key represent partition key
1. True
2. False


Question : Which of the following is true, with regards to Cassandra clustering columns
 : Which of the following is true, with regards to Cassandra clustering columns
1. Itas not mandatory to define

2. It helps to define sort order on a particular column

3. You can change ordering either ascending or descending using WITH CLUSTERING ORDER BY while creating table

4. 1 and 3

5. 2 and 3



Question : You are doing development using Python programming language, now you need to execute some select query on the
data stored in Cassandra, hence you will be using driver for that. Which of the following are correct statement with regards
to driver?



 : You are doing development using Python programming language, now you need to execute some select query on the
1. Cassandra does not support driver for Python, you must have to use Java for this.

2. Cassandra requires new driver class instance for each Cassandra select query

3. Cassandra requires new Cluster class instance for each Cassandra select query

4. You will typically have one instance of Cluster for each Cassandra cluster you want to interact with