This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Daniel Reis
Databases can be an interesting topic to study.
TL;DR
This article is what I learn in today's challenge about CQL and CassandraDB.
- 1. Introduction
- 2. CQL vs SQL
- 2.1 Data Model
- 2.2 Query Syntax
- 2.3 Schema definition
- 3. Final Considerations
1. Introduction
My second day of #100daysofcode studies was into Cassandra Query Language (CQL). Since I started to study about ScyllaDB, I should focus to learn CQL and probably pass through this "rabbit hole" of databases.
2. CQL vs SQL
CQL (Cassandra Query Language) and SQL (Structured Query Language) are both query languages used to interact with databases, but they have some significant differences. Here are some of the major differences between CQL and SQL.
2.1 Data model
SQL is based on the relational data model, which organizes data into tables with defined columns and relationships between them. CQL is based on the column-family data model, which organizes data into columns grouped by column families or tables. This data model allows for more flexibility in data modeling and querying.
2.2 Query syntax
While CQL has a syntax similar to SQL, there are some key differences. For example, CQL uses a SELECT * FROM
statement to query all rows in a table, and uses a WHERE clause to filter data. CQL also supports additional features such as collections, which allow for the storage of multiple values within a single column.
2.3 Schema definition
In SQL, the schema for a database must be defined before any data can be added to the tables. In CQL, the schema can be defined on the fly as data is added to the database. This allows for more flexibility in data modeling and makes it easier to adapt to changing data requirements.
3. Final Considerations
I didn't have so much time today to go further into this studies but there's a few topics that probably I'll be going deeper on the next days.
Don't forget to stay hydrated and see you tomorrow's daily post!
- Follow me on Twitter: @danielhe4rtless
- Follow me on Github: @danielhe4rt
- Follow me on Twitch (daily livecoding sessons now in English): twitch.tv/danielhe4rt
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Daniel Reis
Daniel Reis | Sciencx (2023-02-22T00:34:34+00:00) #100DaysOfCode Day 2: Cassandra Query Language. Retrieved from https://www.scien.cx/2023/02/22/100daysofcode-day-2-cassandra-query-language/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.