Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmytro-varich/telegram-social-network-database
Modeling the database structure based on an analysis of the Telegram messenger. Developing an ER diagram and relational schema, and directly creating the database using Oracle SQL language. Additionally, executing queries and other commands to understand and demonstrate our knowledge in practice.
https://github.com/dmytro-varich/telegram-social-network-database
database plsql sql sql-oracle telegram
Last synced: 22 days ago
JSON representation
Modeling the database structure based on an analysis of the Telegram messenger. Developing an ER diagram and relational schema, and directly creating the database using Oracle SQL language. Additionally, executing queries and other commands to understand and demonstrate our knowledge in practice.
- Host: GitHub
- URL: https://github.com/dmytro-varich/telegram-social-network-database
- Owner: dmytro-varich
- Created: 2024-04-23T07:16:05.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-23T15:00:38.000Z (9 months ago)
- Last Synced: 2024-04-24T15:23:43.388Z (9 months ago)
- Topics: database, plsql, sql, sql-oracle, telegram
- Language: PLSQL
- Homepage:
- Size: 417 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📁 Telegram Social Network Database
## Introduction
The main task of this assignment was to implement a database for the [Telegram](https://en.wikipedia.org/wiki/Telegram_(software)). Telegram is a platform for instant messaging and multimedia content exchange among users over the internet. The database for this social network contains multiple tables with various attributes. Our goal was to create similar tables and demonstrate their potential implementation. In our database, we created primary tables that we considered important, namely `Users`, `Groups`, `Channels`, `Messages`, `Folders`, `Payments`, and `Payments_Methods`. Additionally, we also created so-called junction tables, which connect two tables together: `Users_Groups` and `Users_Channels`.Before the actual implementation of the database in the code, it is necessary to characterize what each table means and what role it plays. The first and main table, which is linked to all tables in our database, is the `Users` table, which stores information about users in the social network. Then there are two tables that serve similar functions and mainly have identical attributes. Additionally, they are connected by additional tables because they have the same `N:M` relationship. These are the `Groups` and `Channels` tables, which store information about groups and channels associated with users. Next is one of the important tables in the Telegram application database itself, which has many more attributes and similar tables - the `Messages` table. It contains information about messages that a user has sent, along with other metadata. The `Folders` table does not display all the options it demonstrates in the actual messenger database, for example, in the application itself, the *Folders* table should have a junction table that stores information about the identifiers of chats to which the user wants to attach a specific folder. In our case, we only have the folder name and an icon created by the user. And the last tables in our database are `Payments` and `Payments_Methods`. It should be noted that a user's payment will be recorded in the table only if they have purchased a premium subscription for their account, and `Payments_Methods` is just an auxiliary table that stores data about the user's payment method.
After formulating a description for each table, we proceed to create an **ER-diagram** and a **Relational Schema** for further organization and better understanding of the implementation of our database in the code. It is in these schemas that we can visually see the attributes in the tables, their relationships, associations, and keys, which gives us an undeniable advantage before meeting task deadlines.
The actual creation of tables and their subsequent population with data was carried out using the **Oracle SQL language** and its object-relational system. Simple `CREATE` and `INSERT` commands allowed us to fulfill the first part of the task and begin with the second part.
The second part includes operations such as `DROP` and `TRUNCATE`, solely to demonstrate our skills and knowledge in their usage. However, the main focus of this work is also on displaying potential queries to the database of the real Telegram application, using commands such as `SELECT`, as well as their combination with other commands, and the use of `SEQUENCE` and `TRIGGER`.
## ER-diagram
![ER-diagram](https://github.com/dmytro-varich/Telegram-Social-Network-Database/blob/main/telegram_social_network_database-ER-diagram.png)## Relational Schema
![Relational Schema](https://github.com/dmytro-varich/Telegram-Social-Network-Database/blob/main/telegram_social_network_database-Relational-Schema.png)## Conclusion
The outcome of our work can be deemed successful as we have created a comprehensive database and populated it with fictitious data, thereby validating real-world scenarios for the Telegram application. One of our key objectives was to learn the fundamentals of relational database creation and validate this knowledge in practice. It is also worth noting that we adhered to the planned timelines, enabling us to confidently evaluate our work as excellent.## Author
I'm Dmytro Varich, currently pursuing my studies at [TUKE](https://www.tuke.sk/wps/portal) University with a focus on Intelligent Systems. This documentation serves as part of my Assignment 1,2 submission for the "Application of Database Systems" course. Additionally, it is also shared on my [Telegram](https://t.me/varich_channel) channel.Contact Email: [email protected]