DBMS, RDBMS
ডাটাবেস কী?
ডাটাবেস (Database) হলো সংগঠিত ও সুশৃঙ্খলভাবে সংরক্ষিত তথ্যের সমষ্টি, যা সহজে সংরক্ষণ, অনুসন্ধান, পরিবর্তন ও ব্যবস্থাপনা করা যায়।
সহজভাবে বললে—
👉 অনেক তথ্যকে নিয়ম মেনে সাজিয়ে রাখার জায়গাই হলো ডাটাবেস।
🔹 বাস্তব উদাহরণ
১) স্কুল ডাটাবেস
একটি স্কুলে ছাত্রদের তথ্য যেমন—
-
নাম
-
রোল নম্বর
-
শ্রেণি
-
ঠিকানা
এই সব তথ্য যদি টেবিল আকারে সংরক্ষণ করা হয়, সেটিই একটি ডাটাবেস।
২) ব্যাংক ডাটাবেস
ব্যাংকে গ্রাহকের—
-
অ্যাকাউন্ট নম্বর
-
ব্যালেন্স
-
লেনদেনের তথ্য
সব কিছু ডাটাবেসে সংরক্ষণ করা হয়।
🔹 ডাটাবেসের বৈশিষ্ট্য
✔ তথ্য সংগঠিতভাবে সংরক্ষণ করে
✔ দ্রুত অনুসন্ধান করা যায়
✔ একাধিক ব্যবহারকারী একসাথে ব্যবহার করতে পারে
✔ তথ্য নিরাপদ রাখা যায়
🔹 ডাটাবেসের উদাহরণ সফটওয়্যার
-
MySQL
-
Oracle Database
-
Microsoft Access
DBMS কি? (উদাহরণসহ)
DBMS (Database Management System) হলো এমন একটি সফটওয়্যার যা ডাটাবেস তৈরি, সংরক্ষণ, নিয়ন্ত্রণ ও পরিচালনা করে।
সহজ ভাষায়—
👉 ডাটাবেসকে পরিচালনা করার জন্য যে প্রোগ্রাম ব্যবহার করা হয় তাকে DBMS বলে।
🔹 DBMS-এর কাজ
-
ডেটা সংরক্ষণ (Store)
-
ডেটা খোঁজা (Retrieve)
-
ডেটা পরিবর্তন (Update)
-
ডেটা মুছে ফেলা (Delete)
-
নিরাপত্তা প্রদান (Security)
-
ব্যাকআপ রাখা (Backup)
🔹 উদাহরণ
একটি স্কুলে ছাত্রদের নাম, রোল, শ্রেণি ইত্যাদি তথ্য সংরক্ষণ করার জন্য DBMS ব্যবহার করা হয়।
ব্যাংকের গ্রাহকের অ্যাকাউন্ট নম্বর, ব্যালেন্স ও লেনদেনের তথ্য DBMS দিয়ে পরিচালনা করা হয়।
🔹 জনপ্রিয় DBMS সফটওয়্যার
-
MySQL, PostgreSQL, Oracle, and Microsoft SQL Server, along with NoSQL options like MongoDB and Redis
RDBMS কি? (উদাহরণসহ)
RDBMS (Relational Database Management System) হলো এমন একটি ডাটাবেস ব্যবস্থাপনা ব্যবস্থা যেখানে ডেটা টেবিল (Table) আকারে সংরক্ষণ করা হয় এবং টেবিলগুলোর মধ্যে সম্পর্ক (Relation) থাকে।
সহজ ভাষায়—
👉 সম্পর্কযুক্ত টেবিলের মাধ্যমে ডেটা সংরক্ষণ ও পরিচালনা করার পদ্ধতিকে RDBMS বলে।
🔹 RDBMS-এর বৈশিষ্ট্য
-
ডেটা টেবিল আকারে সংরক্ষণ করা হয়
-
প্রতিটি টেবিলে Primary Key থাকে
-
টেবিলগুলোর মধ্যে Foreign Key দ্বারা সম্পর্ক তৈরি হয়
-
SQL (Structured Query Language) ব্যবহার করা হয়
-
ডেটা পুনরাবৃত্তি (Redundancy) কম হয়
🔹 উদাহরণ
উদাহরণ ১: স্কুল ডাটাবেস
এখানে Roll নম্বরের মাধ্যমে দুইটি টেবিলের মধ্যে সম্পর্ক তৈরি হয়েছে।
এটাই RDBMS-এর মূল ধারণা।
🔹 জনপ্রিয় RDBMS সফটওয়্যার
-
MySQL
-
PostgreSQL
-
Oracle Database
-
Microsoft SQL Server
Difference Between DBMS and RDBMS
///////////////////////////////Break//////////Table (টেবিল)Table হলো সারি (Record) ও কলাম (Field) দিয়ে গঠিত একটি কাঠামো যেখানে ডেটা সংরক্ষণ করা হয়। Record (রেকর্ড)
Record হলো টেবিলের একটি সম্পূর্ণ সারি। Field (ফিল্ড)
Field হলো টেবিলের একটি কলাম। এখানে — Data Types (ডেটা টাইপ)
Data Type নির্ধারণ করে একটি ফিল্ডে কী ধরনের তথ্য সংরক্ষণ করা যাবে। /////////////////10 minute exam///////////////////Use online Editor to create table: https://www.programiz.com/sql/online-compiler create a student table with 5 field in sqlCREATE TABLE Student ( Roll INT, Name VARCHAR(50), Class INT, Age INT, Address VARCHAR(100) ); Insert Data into tableINSERT INTO Student (Roll, Name, Class, Age, Address) VALUES (101, 'Rahim', 10, 15, 'Dhaka'); Add Multiple Values;INSERT INTO Student (Roll, Name, Class, Age, Address) VALUES (101, 'Rahim', 10, 15, 'Dhaka'), (101, 'Rahim', 10, 15, 'Dhaka'), (101, 'Rahim', 10, 15, 'Dhaka'), (101, 'Rahim', 10, 15, 'Dhaka') ; SELECT (ডেটা দেখার জন্য)SELECT কমান্ড টেবিল থেকে ডেটা দেখানোর জন্য ব্যবহৃত হয়। সব ডেটা দেখাতেKey (কি)Key হলো টেবিলের এমন একটি বা একাধিক ফিল্ড যা একটি রেকর্ডকে সনাক্ত (identify) করতে ব্যবহৃত হয়। 👉 সহজভাবে: টেবিলের ডেটা খুঁজে বের করার বিশেষ চিহ্নই হলো Key। কির বিভিন্ন ধরন আছে, যেমন—
Primary Key (প্রাইমারি কী)Primary Key হলো এমন একটি ফিল্ড যা প্রতিটি রেকর্ডকে আলাদাভাবে সনাক্ত করে। 🔹 বৈশিষ্ট্য✔ Unique (একই মান দুইবার হবে না) 🔹 উদাহরণStudent Table
এখানে Roll হলো Primary Key কারণ—
3) Foreign Key (ফরেন কী)Foreign Key হলো এমন একটি ফিল্ড যা অন্য টেবিলের Primary Key–এর সাথে সম্পর্ক তৈরি করে। 👉 এটি টেবিলগুলোর মধ্যে সম্পর্ক (Relation) স্থাপন করে। 🔹 উদাহরণStudent Table
Result Table
এখানে Result টেবিলের Roll হলো Foreign Key, এক লাইনে মনে রাখা
Key: রেকর্ড সনাক্ত করার জন্য ব্যবহৃত ফিল্ড। Student Table with Primary KeyCREATE TABLE Student ( Roll INT PRIMARY KEY, Name VARCHAR(50) NOT NULL, Class INT, Age INT, Address VARCHAR(100) ); Result Table with Foreign KeyCREATE TABLE Result ( ResultID INT PRIMARY KEY, Roll INT, Subject VARCHAR(50), Marks INT, FOREIGN KEY (Roll) REFERENCES Student(Roll) ); Insert Record into student tableINSERT INTO Student (Roll, Name, Class, Age, Address) VALUES (101, 'Rahim', 10, 15, 'Dhaka'), (102, 'Karim', 10, 16, 'Chittagong'); Insert Record into Result tableINSERT INTO Result (ResultID, Roll, Subject, Marks) VALUES (1, 101, 'Math', 85), (2, 101, 'English', 90), (3, 102, 'Math', 80); Select data from both tableSELECT Student.Roll, Student.Name, Student.Class, Result.Subject, Result.Marks FROM Student LEFT JOIN Result ON Student.Roll = Result.Roll; //////////*********Discuses Relationship************///////Types of Database RelationshipsDatabase relationships can be broadly categorized into four types, each serving a specific purpose in connecting data. Understanding these types is crucial for designing efficient and meaningful 1. One-to-one (1:1) relationshipsA one-to-one relationship connects one record in a table to exactly one record in another table. This is often used when splitting data into multiple tables for better organization or security. Use Case: In a healthcare database, a "Patients" table may have a one-to-one relationship with a "Medical Records" table. Each patient is linked to a unique medical record, ensuring sensitive health information is stored separately. 2. One-to-many (1:N) or many-to-one (N:1) relationshipsIn a one-to-many relationship, a single record in one table can be associated with multiple records in another table. This is one of the most common relationship types in relational databases. Use case: An "Authors" table might connect to a "Books" table, where each author can have multiple books attributed to them. 3. Many-to-many (N: N) relationshipsA many-to-many relationship occurs when multiple records in one table are related to multiple records in another table. This is implemented using a junction table to manage the connections. Use case: In an education system, students can enroll in multiple courses, and each course can have multiple students. A "Student-Course" junction table is used to connect the "Students" and "Courses" tables. -------------------------------------------------------------------------NoSQL databases----------------------------------------------------------------------------------------------------------------------- NoSQL databases are non-relational systems designed to handle large volumes of unstructured or semi-structured data. Unlike traditional SQL databases, they offer flexible schemas and scale horizontally across many servers. |
Comments
Post a Comment