Tinyint Data Type in Cassandra Query Language (CQL)
Tinyint data type in Cassandra Query Language is used to save value range from-128 to 127. It takes one byte to store the data.Let's create a table with Tinyint data type. In TBS Table, I have used Tinyint data type for age column.
CQLSH:techbrotherstutorials>CREATE TABLE tbs
(
id INT PRIMARY KEY,
NAME VARCHAR,
age TINYINT
);
(
id INT PRIMARY KEY,
NAME VARCHAR,
age TINYINT
);
Let's insert some sample data into TBS table by using Insert command in CQL
CQLSH:techbrotherstutorials>INSERT INTO tbs
(
id,
NAME,
age
)
VALUES
(
1,
'Aamir',
127
);INSERT INTO tbs
(
id,
NAME,
age
)
VALUES
(
2,
'Jon Does',
-128
);
(
id,
NAME,
age
)
VALUES
(
1,
'Aamir',
127
);INSERT INTO tbs
(
id,
NAME,
age
)
VALUES
(
2,
'Jon Does',
-128
);
Use Select query to check the data in table in CQL
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.