Cassandra Table- Shikshaglobe

Content Creator: Satish kumar

The most effective method to Create Table in Cassandra

Segment family in Cassandra is like RDBMS table. Segment family is utilized to store information.

Order 'Make Table' is utilized to make section family in Cassandra.

Essential key: There are two sorts of essential key.

Single Primary Key: Single essential key is determined by the accompanying language structure.

Linguistic structure

Essential key (ColumnName)

In the single essential key, there is just a solitary section. That section is additionally called apportioning key. Information is apportioned based on that section. Information is spread on various hubs based on the segment key.

Compound Primary Key: Compound essential key is determined by the accompanying punctuation.

Punctuation

Essential key(ColumnName1,ColumnName2 . . .)In above punctuation, ColumnName1 is the parceling key and ColumnName2 is the Clustering key. Information will be parceled based on ColumnName1 and information will be grouped based on ColumnName2. Grouping is the cycle that sorts information in the segment.

Essential Key((ColumnName1,ColumnName2),ColumnName3...))

In above language structure, ColumnName1 and ColumnName2 are the compound segment key. Information will be apportioned based on the two segments ColumnName1 and ColumnName2 and information will be bunched based on the ColumnName3. Assuming you have an excessive amount of information on the single parcel. Then, at that point, compound parceling key is utilized. Compound apportioning key is utilized to make different parcels for the information.

With Clause

"With proviso" is utilized to determine any property and its incentive for the characterized table. For instance, to pack Cassandra table information. You can set pressure property by determining pressure calculation property estimation in "With provision."Here is the execution of the order 'Make table' that will make table name 'Understudy' in the keyspace 'College.'

Cassandra Create Table

After fruitful execution of the order 'Make table', table 'Understudy' will be made in the keyspace 'College' with segments RollNo, Name and dept. RollNo is the essential key. RollNo is likewise a segment key. Every one of the information will be in the single segment.Cassandra Alter tableOrder 'Modify Table' is utilized to drop section, add another segment, adjust segment name, change section type and change the property of the table.Following is the language structure of order 'Modify Table.'

Adjust ColumnName TYPE ColumnDataype |

Add ColumnName ColumnDataType |

Drop ColumnName |

Rename ColumnName To NewColumnName |

With propertyName=PropertyValue

Here is the depiction of the order 'Adjust Table' that will add new segment in the table Student.Cassandra Alter tableAfter effective execution of the order 'Modify Table', another segment 'Semester' with 'int' information type will be added to the table Student.Here is the screen capture that shows the refreshed Student table.Order 'Drop table' drops determined table including every one of the information from the keyspace. Prior to dropping the table, Cassandra takes a preview of the information not the pattern as a reinforcement.

Linguistic structure

Here is the preview of the executed order 'Drop Table' that will drop table Student from the keyspace 'College'.After effective execution of the order 'Drop Table', table Student will be dropped from the keyspace University.Here is the preview that shows the blunder returned by the Cassandra when attempted to get to Student table that doesn't exist.Order 'Shorten table' eliminates every one of the information from the predefined table. Prior to shortening the information, Cassandra takes the preview of the information as a reinforcement.There are three records in the table Student. These are the records in the table.

Shorten Table

Here is the depiction of the executed order 'Shorten table' that will eliminate every one of the information from the table Student.After effective execution of the order 'Shorten Table', every one of the information will be taken out from the table Student.Here is the depiction of the data set state where there are no records in the table Student.



Click Here For More Detail:

Hive Query Language Tutorial 
Hive Function 
Hive ETL 
Install Cassandra 

Featured Universities

Mahatma Gandhi University

Location: Soreng ,Sikkim , India
Approved: UGC
Course Offered: UG and PG

MATS University

Location: Raipur, Chhattisgarh, India
Approved: UGC
Course Offered: UG and PG

Kalinga University

Location: Raipur, Chhattisgarh,India
Approved: UGC
Course Offered: UG and PG

Vinayaka Missions Sikkim University

Location: Gangtok, Sikkim, India
Approved: UGC
Course Offered: UG and PG

Sabarmati University

Location: Ahmedabad, Gujarat, India
Approved: UGC
Course Offered: UG and PG

Arni University

Location: Tanda, Himachal Pradesh, India.
Approved: UGC
Course Offered: UG and PG

Capital University

Location: Jhumri Telaiya Jharkhand,India
Approved: UGC
Course Offered: UG and PG

Glocal University

Location: Saharanpur, UP, India.
Approved: UGC
Course Offered: UG and PG

Himalayan Garhwal University

Location: PG, Uttarakhand, India
Approved: UGC
Course Offered: UG and PG

Sikkim Professional University

Location: Sikkim, India
Approved: UGC
Course Offered: UG and PG

North East Frontier Technical University

Location: Aalo, AP ,India
Approved: UGC
Course Offered: UG and PG