Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is DML in Apache Cassandra?

I am planning to take DataStax Cassandra Certification for Developer. I recently took the practice test and I scored 94% out of 100 by having 1 answer marked wrong. The question is:

Given the following table, which of the following statements is an example of 
Data Modification Language (DML) in CQL? CREATE TABLE comics ( title text, 
issueNumber int, originalPriceDollars float, PRIMARY KEY ( title, issueNumber 
) );

SELECT * FROM comics;
ALTER TABLE comics ADD currentPriceDollars float;
DROP KEYSPACE test;
None of the other answers are DML.

I chose ALTER TABLE comics option and according to DataStax this answer is wrong. Then what is DML in Cassandra. Isn't this statement modifying the data? And, the correct answer is None.

Thanks.

like image 770
Mike Avatar asked May 04 '17 16:05

Mike


1 Answers

ALTER would technically be DDL (Data Definition Language), as it changes the underlying tables/structures.

DML (Data Manipulation Language) would be something like:

UPDATE comics SET originalPriceDollars=6.99 
    WHERE title='Star Wars: Darth Maul' AND issueNumber=1;

Essentially UPDATE and INSERT change data, ALTER changes underlying tables/structures.

like image 79
Aaron Avatar answered Oct 05 '22 11:10

Aaron