Premium

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



Question : . If you have data duplicated across the various tables in Cassandra. Consistency is the Cassandra's
responsibility. So you update the record in one table, it will be propagated across all the tables in same Keyspace to
maintain the consistency?
 : . If you have data duplicated across the various tables in Cassandra. Consistency is the Cassandra's
1. True
2. False

Correct Answer : Get Lastest Questions and Answer :
Explanation: You need to explicitly update all the copies of data to maintain the consistency across all the
duplicated data.




Question : Which of the following will help in maintaining the consistency in Cassandra nodes
 : Which of the following will help in maintaining the consistency in Cassandra nodes
1. stored procedures

2. transactions

3. Access Mostly Uused Products by 50000+ Subscribers

4. logged batch


Correct Answer : Get Lastest Questions and Answer :
Explanation: Combines multiple DML statements to achieve atomicity and isolation when targeting a single partition
or only atomicity when targeting multiple partitions. A batch applies all DMLs within a single partition before the data is
available, ensuring atomicity and isolation. For multiple partition batches, logging can ensure that all DMLs are applied
before data is available (isolation), while atomicity is achieved per partition.




Question : . Which of the following is correct with regards to batch in Cassandra?
 : . Which of the following is correct with regards to batch in Cassandra?
1. Batches are written to a log on a coordinator node.

2. Replicas will take over if the coordinator node fails mid-batch.

3. Access Mostly Uused Products by 50000+ Subscribers

4. 1 and 3

5. 1,2,3


Correct Answer : Get Lastest Questions and Answer :
Explanation: BATCH

Combines multiple DML statements to achieve atomicity and isolation when targeting a single partition or only atomicity when
targeting multiple partitions. A batch applies all DMLs within a single partition before the data is available, ensuring
atomicity and isolation. For multiple partition batches, logging can ensure that all DMLs are applied before data is available
(isolation), while atomicity is achieved per partition.

A well-constructed batch targeting a single partition can reduce client-server traffic and more efficiently update a table
with a single row mutation. A batch can also target multiple partitions, when atomicity and isolation is required.
Multi-partition batches may decrease throughput and increase latency. Only use a multi-partition batch when there is no other
viable option

If multiple partitions are involved, batches are logged by default. Running a batch with logging enabled ensures that either
all or none of the batch operations will succeed, ensuring atomicity. Cassandra first writes the serialized batch to the batch
log system table that consumes the serialized batch as blob data. After Cassandra has successfully written and persisted (or
hinted) the rows in the batch, it removes the batch log data. There is a performance penalty associated with the batch log, as
it is written to two other nodes. Thresholds for warning about or failure due to batch size can be set.

If you do not want to incur a penalty for logging, run the batch operation without using the batch log table by using the
UNLOGGED keyword. Unlogged batching will issue a warning if too many operations or too many partitions are involved. Single
partition batch operations are unlogged by default, and are the only unlogged batch operations recommended.

Although a logged batch enforces atomicity (that is, it guarantees if all DML statements in the batch succeed or none do),
Cassandra does no other transactional enforcement at the batch level. For example, there is no batch isolation unless the
batch operation is writing to a single partition. In multiple partition batch operations, clients are able to read the first
updated rows from the batch, while other rows are still being updated on the server. In single partition batch operations,
clients cannot read a partial update from any row until the batch is completed.



Related Questions


Question : You have defined a table as below

CREATE TABLE TRINING_COURSE (
id uuid,
course_sequence int,
course_id uuid,
title text,
category text,
trainer text,
PRIMARY KEY (id, course_sequence ) );

ALTER TABLE TRINING_COURSE ADD LOCATION map;

Which of the following is correct CQL to add new location for a training_course ?
 : You have defined a table as below
1. INSERT INTO TRINING_COURSE (id, course_sequence, LOCATION)
VALUES (62c36092-82a1-3a00-93d1-46196ee77204, 4,
{ '2017-9-22 09:00' : 'MUMBAI',
'2017-10-1 09:00' : 'CHENNAI'});


2. UPDATE TRINING_COURSE SET LOCATION = LOCATION + {'2017-9-22 09:00' : 'MUMBAI'}
WHERE id = 62c36092-82a1-3a00-93d1-46196ee77204 AND course_sequence = 4;


3. Access Mostly Uused Products by 50000+ Subscribers
WHERE id = 62c36092-82a1-3a00-93d1-46196ee77204 AND course_sequence = 4;


4. UPDATE TRINING_COURSE ADD {LOCATION + {'2017-9-22 09:00' : 'MUMBAI'}}
WHERE id = 62c36092-82a1-3a00-93d1-46196ee77204 AND course_sequence = 4;



Question : You have following table definition

CREATE TABLE TRINING_COURSE (
id uuid,
course_sequence int,
course_id uuid,
title text,
category text,
trainer text,
PRIMARY KEY (id, course_sequence ) );

ALTER TABLE TRINING_COURSE ADD LOCATION map;
ALTER TABLE TRINING_COURSE ADD emails set;

Which of the following will be a correct syntax ?
 : You have following table definition
1. CREATE INDEX EMAIL_INDEX ON TRINING_COURSE (emails);

2. CREATE INDEX ON TRINING_COURSE (emails);

3. Access Mostly Uused Products by 50000+ Subscribers

4. 1 and 2

5. 1,2 and 3



Question : You have following table definition

CREATE TABLE TRINING_COURSE (
id uuid,
course_sequence int,
course_id uuid,
title text,
category text,
trainer text,
PRIMARY KEY (id, course_sequence ) );

ALTER TABLE TRINING_COURSE ADD LOCATION map;
ALTER TABLE TRINING_COURSE ADD emails set;

And you also apply the following CQL

CREATE INDEX ON TRINING_COURSE (LOCATION);

Which of the following statement is correct with regards to above query ?
 : You have following table definition
1. It will create an index on LOCATION maps values part

2. It will create an index on LOCATION maps Keys part

3. Access Mostly Uused Products by 50000+ Subscribers

4. This command will fail



Question : You have following table definition

CREATE TABLE TRINING_COURSE (
id uuid,
course_sequence int,
course_id uuid,
title text,
category text,
trainer text,
PRIMARY KEY (id, course_sequence ) );

ALTER TABLE TRINING_COURSE ADD LOCATION map;
ALTER TABLE TRINING_COURSE ADD emails set;

And you also apply the following CQL

CREATE INDEX MYINDEXVALUE ON TRINING_COURSE (LOCATION);
CREATE INDEX MYINDEXKEY ON TRINING_COURSE (KEYS(LOCATION));

Which statement is correct ?
 : You have following table definition
1. There will be two indexes created one on Location keys and other on Location values

2. There will be only one index created on Location keys and other will be auto dropped on Location values

3. Access Mostly Uused Products by 50000+ Subscribers

4. When you try to create index on Location keys, it will give error.



Question : You have following table definition

CREATE TABLE TRINING_COURSE (
id uuid,
course_sequence int,
course_id uuid,
title text,
category text,
trainer text,
PRIMARY KEY (id, course_sequence ) );

ALTER TABLE TRINING_COURSE ADD emails set;

Now, you need to select all rows having email id as 'admin@hadoopexam.com' , which of the following are correct syntax ?
 : You have following table definition
1. SELECT * FROM TRINING_COURSE WHERE emails CONTAINS 'admin@hadoopexam.com' ;

2. SELECT * FROM TRINING_COURSE WHERE emails HAVING 'admin@hadoopexam.com' ;

3. Access Mostly Uused Products by 50000+ Subscribers

4. SELECT * FROM TRINING_COURSE WHERE emails IN ('admin@hadoopexam.com' );



Question : You have following table definition

CREATE TABLE TRINING_COURSE (
id uuid,
course_sequence int,
course_id uuid,
title text,
category text,
trainer text,
PRIMARY KEY (id, course_sequence ) );

CREATE INDEX MYINDEXVALUE ON TRINING_COURSE (LOCATION);

Now, you need to select all rows having TRAINING_COURSE ORGANIZED IN a˜Mumbaia which of the following are correct syntax ?
 : You have following table definition
1. SELECT * FROM TRINING_COURSE WHERE LOCATION CONTAINS 'MUMBAI';

2. SELECT * FROM TRINING_COURSE WHERE LOCATION IN { 'MUMBAI' };

3. Access Mostly Uused Products by 50000+ Subscribers

4. SELECT * FROM TRINING_COURSE WHERE LOCATION HAVING 'MUMBAI';