Double Data Type in Cassandra Query Language ( CQL) - Cassandra / CQL Tutorial

Double Data Type in Cassandra Query Language ( CQL)

Double Data Type in Cassandra Query Language takes 8 bytes to store integer/ float value. In below example I have used Double data type for salary column in tbs table.
CQLSH:techbrotherstutorials>CREATE TABLE tbs 
             ( 
                          id INT PRIMARY KEY, 
                          NAME TEXT, 
                          salary DOUBLE 
             );

Let's insert coupel of records in tbs table.
CQLSH:techbrotherstutorials>INSERT INTO tbs 
            (id, NAME, salary) 
            VALUES (1,'Aamir',3000 );

CQLSH:techbrotherstutorials>INSERT INTO tbs 
            (id, NAME, salary) 
            VALUES (1,'John Doe',4500.50 ); 

Select data from table to check if double data type is insert correctly in salary column.
CQLSH:techbrotherstutorials>SELECT id, 
       NAME, 
       salary 
FROM   tbs; 

1 comment: