Professional Documents
Culture Documents
Assignment 4b
Assignment 4b
Bscs20064
This CQL statement creates a new table named 'music_library' in the current
keyspace, with columns for 'year', 'artist_name', and 'album_name', and a
composite primary key consisting of 'year' and 'artist_name'. It only creates the
table if it doesn't already exist.
This CQL query selects all rows from the 'music_library' table where the 'year' column equals
1970.
Getting value of Artist name ‘Sheharyar’ and year 1970 from table.
Getting value of Artist name ‘C’ and ‘D’ and year 2002 from table.
This CQL query selects all rows from the 'music_library' table where the 'year'
column equals 2001 or 2002.
This CQL query selects all rows from the 'music_library' table where the
'Artist_name' column equals 2001 or 2002, and sorts them in descending order
based on the 'year' column.
SELECT * FROM music_library ORDER BY ALBUM_NAME
This CQL query selects all rows from the 'music_library' table and sorts them in
ascending order based on the 'album_name' column.
Getting avg of sales column which have year between 2001 and 2002 and showing.
Updating the sales value of year equal to 1970 by using update and set
command.
This CQL statement deletes the 'demokeyspace' keyspace and all tables, data,
and other objects within it. Use with caution as it deletes all the data in the
keyspace.
DESCRIBE keyspaces
This CQL statement lists all the keyspaces in the current Cassandra cluster.
-------------------------------END------------------------------------