Premium

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



Question : You can also specify specific IP addresses of Cassandra cluster nodes, so that you will hit to only specific node
in cluster, initially
 : You can also specify specific IP addresses of Cassandra cluster nodes, so that you will hit to only specific node
1. True
2. False

Correct Answer : 1
Explanation: You can also specify a list of IP addresses for nodes in your cluster:

from cassandra.cluster import Cluster

cluster = Cluster(['192.168.0.1', '192.168.0.2'])
The set of IP addresses we pass to the Cluster is simply an initial set of contact points. After the driver connects to one of
these nodes it will automatically discover the rest of the nodes in the cluster and connect to them, so you donat need to list
every node in your cluster.





Question : As soon as you create Cluster instance, you are connected to Cassandra cluster
 : As soon as you create Cluster instance, you are connected to Cassandra cluster
1. True
2. False

Correct Answer : 2
Explanation: Instantiating a Cluster does not actually connect us to any nodes. To establish connections and begin
executing queries we need a Session, which is created by calling Cluster.connect():

cluster = Cluster()
session = cluster.connect()
The connect() method takes an optional keyspace argument which sets the default keyspace for all queries made through that
Session:

cluster = Cluster()
session = cluster.connect('mykeyspace')
You can always change a Sessions keyspace using set_keyspace() or by executing a USE query:

session.set_keyspace('users')
# or you can do this instead
session.execute('USE users')

Now that we have a Session we can begin to execute queries. The simplest way to execute a query is to use execute():

rows = session.execute('SELECT name, age, email FROM users')
for user_row in rows:
print user_row.name, user_row.age, user_row.email
This will transparently pick a Cassandra node to execute the query against and handle any retries that are necessary if the
operation fails.





Question : . You should always prefer to use SSD storage on Cassandra node?
 : . You should always prefer to use SSD storage on Cassandra node?
1. True
2. False

Correct Answer : 1
Explanation: Yes, SSD's are faster and it is recommended.


Related Questions


Question : The purpose of clustering key is to store row data in sorted order.
 : The purpose of clustering key is to store row data in sorted order.
1. True
2. False


Question : You have been given below table definition

CREATE TABLE HADOOEXAM(

COURSE_TITLE text,
COURSE_ADDED_YEAR int,
COURSE_ADDED_DATE timestamp,
COURSE_DETAIL text,
USER_ID UUID,
COURSE_ID TIMEUUID,
PRIMARY KEY ((COURSE_TITLE,COURSE_ADDED_YEAR)));

What would be the result, when you run the below query?

SELECT * FROM HADOOEXAM WHERE COURSE_TITLE='CASSANDRA' ;
 : You have been given below table definition
1. It will return all the courses which matches with the COURSE_TITLE='CASSANDRA'

2. It will return all the courses which is stored in the same partition where record for
COURSE_TITLE='CASSANDRA' stored

3. Access Mostly Uused Products by 50000+ Subscribers

4. This will say invalid query



Question : You have below tables defined with all the default Cassandra behavior. This table is empty
CREATE TABLE HADOOEXAM(

COURSE_TITLE text,
COURSE_ADDED_YEAR int,
COURSE_ADDED_DATE timestamp,
COURSE_DETAIL text,
USER_ID UUID,
COURSE_ID TIMEUUID,
PRIMARY KEY ((COURSE_TITLE)));

Now you fire the following query

UPDATE HADOOEXAM
SET COURSE_DETAIL ='HadoopExam Learning Resources'
WHERE COURSE_TITLE='CASSANRA' ;

What would happen?
 : You have below tables defined with all the default Cassandra behavior. This table is empty
1. It will throw error as there is no matching data

2. It will insert a new record

3. Access Mostly Uused Products by 50000+ Subscribers

4. None of the above



Question : You have been given below table definition

CREATE TABLE HADOOEXAM(

COURSE_TITLE text,
COURSE_ADDED_YEAR int,
COURSE_ADDED_DATE timestamp,
COURSE_DETAIL text,
USER_ID UUID,
COURSE_ID TIMEUUID,
PRIMARY KEY ((COURSE_TITLE),COURSE_ADDED_YEAR)));

What would be the result, when you run the below query?

SELECT * FROM HADOOEXAM WHERE COURSE_TITLE='CASSANDRA' AND COURSE_ADDED_YEAR=2017;

What is the expected result?
 : You have been given below table definition
1. It will return all the courses which matches with the COURSE_TITLE='CASSANDRA' AND
COURSE_ADDED_YEAR=2017

2. It will return all the courses which is stored in the same partition where record for
COURSE_TITLE='CASSANDRA' stored

3. Access Mostly Uused Products by 50000+ Subscribers

4. This will say invalid query



Question : You have been given below table definition

CREATE TABLE HADOOEXAM(

COURSE_TITLE text,
COURSE_ADDED_YEAR int,
COURSE_ADDED_DATE timestamp,
COURSE_DETAIL text,
USER_ID UUID,
COURSE_ID TIMEUUID,
PRIMARY KEY ((COURSE_TITLE),COURSE_ADDED_YEAR)));

What would be the result, when you run the below query?

SELECT * FROM HADOOEXAM WHERE COURSE_TITLE='CASSANDRA' AND COURSE_ADDED_YEAR <=2017;

What is the expected result ?
 : You have been given below table definition
1. It will return all the courses which matches with the COURSE_TITLE='CASSANDRA' AND
COURSE_ADDED_YEAR<=2017

2. It will return all the courses which is stored in the same partition where record for
COURSE_TITLE='CASSANDRA' stored

3. Access Mostly Uused Products by 50000+ Subscribers

4. This will say invalid query



Question : What does UPSERT means in Cassandra?
 : What does UPSERT means in Cassandra?
1. A failed UPDATE

2. A failed INSERT

3. Access Mostly Uused Products by 50000+ Subscribers

4. INSERTs may cause UPDATEs; UPDATEs may causes INSERTs