Restricted to EXAM Module Subscriber
- ☆1Database Management SystemER DiagramER diagram from the given infos.CB, SO(IT), 22 | Senior Officer (IT)
- ☆2Database Management SystemER DiagramFrom an E-R , Draw the schema diagram also indicate primary key with mapping constraints.CB, AE(IT)/AHME/SO, 21 | AME/ANE/AE
ER-Diagram:

Schema Diagram:

ER-Diagram:

Schema Diagram:

- ☆3Database Management SystemER DiagramGiven a scenario about football Game (Game_no, game time, game_name), Team (team-id, coach_id, team-name), Coach (Coach-id, Coach-name) Player (player-id, palyer- name, player-position), Stadium information (stadium-id, stadium-name, stadium-loc) Match (match_id, match date, match_result).
i. Draw ER diagramJanata, ASA, 21 | AME/ANE/AE
- ☆4Database Management SystemER DiagramGiven a scenario about football Game (Game_no, game_time, game_name), Team( Team_id, coach_id, team-name), Coach(coach-id, coach-name), Player(player-id, player-name, player-position), Stadium information (stadium-id, stadium-name, stadium-loc), Match(match_id, match_date, match_result).
(i) Draw ER diagram
(ii) Convert the ER diagram to relations(Table)Rupali, ANE, 21 |
ER Diagram → Relational Tables Conversion
Below is the relational schema (tables) derived from the ER diagram.
1. Coach Table
Coach(Coach_ID, Coach_name)
* Primary Key: Coach_ID
2. Team Table
Team(Team_ID, Team_name, Coach_ID)
* Primary Key: Team_ID * Foreign Key: Coach_ID → Coach(Coach_ID)
3. Player Table
Player(Player_ID, Player_name, Player_position, Team_ID)
* Primary Key: Player_ID * Foreign Key: Team_ID → Team(Team_ID)
4. Stadium Table
Stadium(Stadium_ID, Stadium_name, Stadium_location)
* Primary Key: Stadium_ID
5. Game Table
Game(Game_no, Game_name, Game_time)
* Primary Key: Game_no
6. Match Table
Match(Match_ID, Match_date, Match_result, Stadium_ID, Game_no)
* Primary Key: Match_ID * Foreign Key:
* Stadium_ID → Stadium(Stadium_ID) * Game_no → Game(Game_no)
- ☆5Database Management SystemER DiagramDraw an ER diagram for BPL.SB & JB, ADA, 22 | ADA
- ☆6Database Management SystemACIDWhy is "Atomicity" specifically critical for an Inter-Bank Fund Transfer?Combined Bank, AE(IT)/AME, 26 | AME/ANE/AE
Atomicity
- Atomicity means a transaction is treated as a single unit → either fully completed or not executed at all.
Reason:
- All-or-Nothing Execution: In fund transfer, money must be debited and credited together.
- Prevents Data Inconsistency: If debit happens but credit fails → money is lost.
- Error Handling: If any step fails, the system performs rollback to restore original state.
- Maintains Trust: Ensures reliable banking transactions between two banks.
- Avoids Partial Transactions: No situation where one account is updated and the other is not.
Example:
- Transfer 1000 Tk from Account A (Bank 1) to Account B (Bank 2).
- If system crashes after debit but before credit → without atomicity, money is lost
- With atomicity → transaction is rolled back, so no loss
Atomicity:
- Atomicity মানে একটি transaction-কে একটি সম্পূর্ণ unit হিসেবে ধরা হয় → সম্পূর্ণ হবে অথবা একেবারেই হবে না।
কারণ:
- All-or-Nothing Execution: টাকা transfer-এ debit এবং credit একসাথে হতে হবে।
- Data Inconsistency রোধ: যদি debit হয় কিন্তু credit না হয় → টাকা হারিয়ে যাবে।
- Error Handling: কোনো step-এ সমস্যা হলে rollback করে আগের অবস্থায় ফেরত যায়।
- Trust বজায় রাখা: দুই bank-এর মধ্যে reliable transaction নিশ্চিত করে।
- Partial Transaction এড়ানো: এক account update হয়ে অন্যটা না হওয়ার সমস্যা থাকে না।
উদাহরণ:
- Account A (Bank 1) থেকে Account B (Bank 2)-তে 1000 টাকা পাঠানো হলো।
- Debit হওয়ার পর system crash হলে → atomicity না থাকলে টাকা হারাবে
- Atomicity থাকলে → transaction rollback হবে → টাকা সুরক্ষিত থাকবে
- ☆7Database Management SystemACIDConsider a concurrent transaction schedule involving two data items, X and Y:
Transaction 1 (T1): Read(X), Write(X), Read(Y), Write(Y)
Transaction 2 (T2): Read(Y), Write(Y), Read(X), Write(X)
Describe how the standard Two-Phase Locking (2PL) protocol treats these transactions if they execute concurrently, identifying the exact operational state (hazard) the system will enter.
Contrast this outcome with how the Strict 2PL protocol alters the lock release timeline.Combined Bank, AP-23, 26 | Assistant ProgrammerTwo-Phase Locking (2PL) Analysis for Concurrent Transactions
Transaction Details:
- T1: Read(X), Write(X), Read(Y), Write(Y)
- T2: Read(Y), Write(Y), Read(X), Write(X)
Standard 2PL Execution
In standard 2PL, each transaction has a growing phase (only acquiring locks) and a shrinking phase (only releasing locks). Both transactions request exclusive locks because they intend to write.
Step-by-Step Interleaving:
Step T1 Action T2 Action Lock Status 1 Lock-X(X) granted T1 holds X 2 Read(X), Write(X) T1 holds X 3 Lock-X(Y) granted T1 holds X, T2 holds Y 4 Read(Y), Write(Y) T1 holds X, T2 holds Y 5 Lock-X(Y) requested → WAITS T1 waits for Y 6 Lock-X(X) requested → WAITS T2 waits for X Operational State Entered: DEADLOCK
The system enters a deadlock (circular wait). T1 holds X and waits for Y, while T2 holds Y and waits for X. Neither transaction can proceed. The database must detect this using a wait-for graph or timeout and resolve it by aborting one transaction.
Strict 2PL Protocol
- Standard 2PL: Locks may be released after use in the shrinking phase, but here deadlock prevents progress.
- Strict 2PL: All locks are held until commit or abort, preventing exposure of uncommitted data.
Contrast Table:
Aspect Standard 2PL Strict 2PL Deadlock Risk Yes Yes Lock Release After shrinking phase Only at commit/abort Cascading Rollbacks Possible Prevented Schedule Type Recoverable Strict & recoverable Key Takeaway: Strict 2PL does not remove deadlock in this schedule but ensures strict isolation by holding locks until termination.
Two-Phase Locking (2PL) Analysis for Concurrent Transactions
Transaction Details:
- T1: Read(X), Write(X), Read(Y), Write(Y)
- T2: Read(Y), Write(Y), Read(X), Write(X)
Standard 2PL Execution
Standard 2PL-এ প্রতিটি transaction-এর growing phase (শুধু lock নেওয়া) এবং shrinking phase (শুধু lock release) থাকে। উভয় transaction write করার জন্য exclusive lock নেয়।
Step-by-Step Interleaving:
Step T1 Action T2 Action Lock Status 1 Lock-X(X) granted T1 holds X 2 Read(X), Write(X) T1 holds X 3 Lock-X(Y) granted T1 holds X, T2 holds Y 4 Read(Y), Write(Y) T1 holds X, T2 holds Y 5 Lock-X(Y) requested → WAITS T1 waits for Y 6 Lock-X(X) requested → WAITS T2 waits for X Operational State: DEADLOCK
System deadlock (circular wait)-এ চলে যায়। T1 X ধরে Y-এর জন্য অপেক্ষা করে, আর T2 Y ধরে X-এর জন্য অপেক্ষা করে। কেউই এগোতে পারে না। Database-কে এটি detect করে (wait-for graph বা timeout ব্যবহার করে) resolve করতে হয়।
Strict 2PL Protocol
- Standard 2PL: shrinking phase-এ lock release করা যায়, কিন্তু এখানে deadlock কারণে progress হয় না।
- Strict 2PL: সব lock commit/abort না হওয়া পর্যন্ত ধরে রাখা হয়, uncommitted data expose হয় না।
Contrast Table:
Aspect Standard 2PL Strict 2PL Deadlock Risk Yes Yes Lock Release shrinking phase-এর পরে commit/abort পর্যন্ত Cascading Rollbacks Possible Prevented Schedule Type Recoverable Strict & recoverable Key Takeaway: Strict 2PL এই schedule-এ deadlock remove করে না, তবে strict isolation নিশ্চিত করে।
- ☆8Database Management SystemACIDExplain the concept of ACID properties in a database transaction. Describe how each property-Atomicity, Consistency, Isolation, and Durability- ensures the reliability and integrity of a database system.Combined Bank, SO-IT, 25 | Senior Officer (IT)
ACID Properties in Database Transactions
ACID properties are a set of rules that ensure reliability, consistency, and integrity of a database during transactions. Each transaction must satisfy these four properties to maintain a correct database state.1) Atomicity
Atomicity ensures that a transaction is treated as a single unit. Either all operations of the transaction are completed successfully, or none of them are applied. If any part fails, the entire transaction is rolled back, preventing partial updates.2) Consistency
Consistency ensures that a transaction moves the database from one valid state to another valid state. All integrity constraints, rules, and conditions must be satisfied before and after the transaction.3) Isolation
Isolation ensures that multiple transactions executed at the same time do not interfere with each other. Each transaction behaves as if it is executed independently, preventing problems like dirty reads or lost updates.4) Durability
Durability guarantees that once a transaction is committed, its changes are permanently stored in the database. Even if the system crashes, the committed data will not be lost.Database Transaction এ ACID Properties
ACID properties হলো কিছু গুরুত্বপূর্ণ নিয়ম যা database transaction চলাকালীন reliability, consistency এবং integrity নিশ্চিত করে। প্রতিটি transaction কে এই চারটি property অনুসরণ করতে হয়।1) Atomicity
Atomicity নিশ্চিত করে যে একটি transaction সম্পূর্ণভাবে execute হবে অথবা একেবারেই হবে না। যদি transaction এর কোনো একটি অংশ ব্যর্থ হয়, তাহলে পুরো transaction rollback হয়, ফলে partial update হয় না।2) Consistency
Consistency নিশ্চিত করে যে transaction এর আগে ও পরে database একটি valid state এ থাকে। সব ধরনের rule, constraint এবং integrity condition মানা হয়।3) Isolation
Isolation নিশ্চিত করে যে একাধিক transaction একসাথে চললেও তারা একে অপরকে প্রভাবিত করবে না। প্রতিটি transaction আলাদাভাবে execute হওয়ার মতো আচরণ করে।4) Durability
Durability নিশ্চিত করে যে transaction একবার commit হয়ে গেলে তার পরিবর্তন স্থায়ীভাবে database এ সংরক্ষিত থাকে, system crash হলেও data হারায় না। - ☆9Database Management SystemACIDWhat does the Consistency property in ACID guarantee during a bank fund transfer transaction? You are designing the schema for a Savings_Accounts table. Write the specific SQL constraint clause to ensure that the current_balance column can never drop below zero.CB, AME/AE(IT-23), 26 | AME/ANE/AE
Consistency Property in ACID
- Consistency ensures that a database always remains in a valid state before and after a transaction.
- During a bank fund transfer transaction, consistency guarantees that all database rules and constraints are maintained properly.
For example, if money is transferred from one account to another:
- The amount deducted from one account must be added to the other account correctly.
- The total balance in the system must remain consistent.
- No account balance can become invalid or violate database rules.
If any part of the transaction fails, the entire transaction is rolled back to preserve consistency.
SQL Constraint Clause
To ensure that the current_balance column never becomes negative, the following CHECK constraint can be used:
CHECK (current_balance >= 0)Example in Table Schema
CREATE TABLE Savings_Accounts ( account_id INT PRIMARY KEY, customer_name VARCHAR(100), current_balance DECIMAL(10,2), CHECK (current_balance >= 0) );প্রশ্ন: ব্যাংক fund transfer transaction-এর সময় ACID-এর Consistency property কী নিশ্চিত করে? এছাড়া current_balance কখনো শূন্যের নিচে না যাওয়ার জন্য SQL constraint clause লিখ।
ACID-এর Consistency Property
- Consistency নিশ্চিত করে যে transaction-এর আগে এবং পরে database সবসময় valid অবস্থায় থাকবে।
- Bank fund transfer transaction-এর ক্ষেত্রে consistency নিশ্চিত করে যে database-এর সব rule এবং constraint সঠিকভাবে বজায় থাকবে।
উদাহরণস্বরূপ, যদি একটি account থেকে অন্য account-এ টাকা transfer করা হয়:
- এক account থেকে কাটা amount অবশ্যই অন্য account-এ সঠিকভাবে যোগ হতে হবে।
- System-এর মোট balance consistent থাকতে হবে।
- কোনো account balance invalid হতে পারবে না বা database rule ভঙ্গ করতে পারবে না।
যদি transaction-এর কোনো অংশ ব্যর্থ হয়, তাহলে পুরো transaction rollback হবে যাতে consistency বজায় থাকে।
SQL Constraint Clause
current_balance যেন কখনো negative না হয়, তার জন্য নিচের CHECK constraint ব্যবহার করা যায়:
CHECK (current_balance >= 0)Table Schema উদাহরণ
CREATE TABLE Savings_Accounts ( account_id INT PRIMARY KEY, customer_name VARCHAR(100), current_balance DECIMAL(10,2), CHECK (current_balance >= 0) ); - ☆10Database Management SystemACIDWrite short note on ACID Propertise of databaseSB & JB, ADA, 22 | ADA
ACID Properties in Database Transactions
ACID properties are a set of rules that ensure reliability, consistency, and integrity of a database during transactions. Each transaction must satisfy these four properties to maintain a correct database state.1) Atomicity
Atomicity ensures that a transaction is treated as a single unit. Either all operations of the transaction are completed successfully, or none of them are applied. If any part fails, the entire transaction is rolled back, preventing partial updates.2) Consistency
Consistency ensures that a transaction moves the database from one valid state to another valid state. All integrity constraints, rules, and conditions must be satisfied before and after the transaction.3) Isolation
Isolation ensures that multiple transactions executed at the same time do not interfere with each other. Each transaction behaves as if it is executed independently, preventing problems like dirty reads or lost updates.4) Durability
Durability guarantees that once a transaction is committed, its changes are permanently stored in the database. Even if the system crashes, the committed data will not be lost.Database Transaction এ ACID Properties
ACID properties হলো কিছু গুরুত্বপূর্ণ নিয়ম যা database transaction চলাকালীন reliability, consistency এবং integrity নিশ্চিত করে। প্রতিটি transaction কে এই চারটি property অনুসরণ করতে হয়।1) Atomicity
Atomicity নিশ্চিত করে যে একটি transaction সম্পূর্ণভাবে execute হবে অথবা একেবারেই হবে না। যদি transaction এর কোনো একটি অংশ ব্যর্থ হয়, তাহলে পুরো transaction rollback হয়, ফলে partial update হয় না।2) Consistency
Consistency নিশ্চিত করে যে transaction এর আগে ও পরে database একটি valid state এ থাকে। সব ধরনের rule, constraint এবং integrity condition মানা হয়।3) Isolation
Isolation নিশ্চিত করে যে একাধিক transaction একসাথে চললেও তারা একে অপরকে প্রভাবিত করবে না। প্রতিটি transaction আলাদাভাবে execute হওয়ার মতো আচরণ করে।4) Durability
Durability নিশ্চিত করে যে transaction একবার commit হয়ে গেলে তার পরিবর্তন স্থায়ীভাবে database এ সংরক্ষিত থাকে, system crash হলেও data হারায় না।
- ☆11Database Management SystemNormalizationWhat is normalization in a database? If needed, draw an ER diagram using containers.Sonali Bank, ADA, 24 | ADA
Normalization in Database:
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It divides large tables into smaller related tables and defines relationships between them.Goals of Normalization:
- Eliminate duplicate data
- Ensure data consistency
- Improve database structure
Common Normal Forms:
- 1NF → Remove repeating groups
- 2NF → Remove partial dependency
- 3NF → Remove transitive dependency
Before Normalization (Unnormalized ER/Table):

Problem:
- Data redundancy (same student & course repeated)
- Update anomaly
- Insertion/deletion problem
After Normalization (ER Diagram):

- STUDENT and COURSE are separate tables (normalized)
- ENROLLMENT table removes redundancy and maintains relationship
- No redundancy
- Better structure
- Easy update, insert, delete
Normalization in Database:
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It divides large tables into smaller related tables and defines relationships between them.Goals of Normalization:
- Eliminate duplicate data
- Ensure data consistency
- Improve database structure
Common Normal Forms:
- 1NF → Remove repeating groups
- 2NF → Remove partial dependency
- 3NF → Remove transitive dependency
Before Normalization (Unnormalized ER/Table):

Problem:
- Data redundancy (same student & course repeated)
- Update anomaly
- Insertion/deletion problem
After Normalization (ER Diagram):

- STUDENT and COURSE are separate tables (normalized)
- ENROLLMENT table removes redundancy and maintains relationship
- No redundancy
- Better structure
- Easy update, insert, delete
- ☆12Database Management SystemNormalizationWhat is Normalization? How do 1NF and 2NF work in a database? Give examples.Combined Bank, SO(IT-23), 26 | Senior Officer (IT)
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. It involves dividing large tables into smaller ones and defining relationships between them. The main goal is to eliminate duplicate data and ensure that data dependencies make sense. Normalization follows a set of rules called normal forms, such as 1NF, 2NF, 3NF, and so on.
1NF (First Normal Form)
1NF is the first step in normalization. A table is in 1NF when it follows these rules:
- Atomic values: Each table cell must contain only a single value, not multiple values or lists.
- Same data type: Each column should hold values of the same type.
- Unique rows: Every row must be different from others. No repeating groups are allowed.
- Unique column names: Each column must have a distinct name.
Example of 1NF:
Before (Not in 1NF):
StudentID Name Subjects 101 Alice Math, Physics 102 Bob Chemistry The "Subjects" column has two values in one cell, which breaks the atomic rule.
After (In 1NF):
StudentID Name Subject 101 Alice Math 101 Alice Physics 102 Bob Chemistry Now each cell holds a single value, and the table follows 1NF rules.
2NF (Second Normal Form)
A table is in 2NF when it is already in 1NF and has no partial dependency. This means a non-key column must depend on the entire primary key, not just a part of it. 2NF is especially important when the primary key is made of two or more columns (composite key).
Must be in 1NF first.
- No partial dependency: Every non-key attribute must depend on the whole primary key.
Example of 2NF:
Before (Not in 2NF):

Primary key = (StudentID + SubjectID).
Problem: StudentName depends only on StudentID, not on the full key. This is partial dependency.After (In 2NF):
Student Table:
StudentID StudentName 101 Alice Subject Table:
SubjectID SubjectName S01 Math S02 Physics Enrollment Table:
StudentID SubjectID Marks 101 S01 85 101 S02 90 Now each non-key attribute depends on the full primary key of its own table, and partial dependency is removed.
Normalization হলো database-এ data organize করার process যা redundancy কমায় এবং data integrity উন্নত করে। এতে large tables-কে ছোট tables-এ ভাগ করা হয় এবং তাদের মধ্যে relationships define করা হয়। Main goal হলো duplicate data eliminate করা এবং data dependencies sensible রাখা। Normalization 1NF, 2NF, 3NF ইত্যাদি নিয়মের set follow করে।<
1NF (First Normal Form)
1NF হলো normalization-এর first step। একটি table 1NF-এ থাকলে নিচের rules follow করতে হবে:
- Atomic values: প্রতিটি table cell-এ শুধু একটি single value থাকতে হবে, multiple values বা lists নয়।
- Same data type: প্রতিটি column-এ same type-এর values থাকা উচিত।
- Unique rows: প্রতিটি row অন্যদের থেকে আলাদা হতে হবে। কোনো repeating groups allowed নয়।
- Unique column names: প্রতিটি column-এর আলাদা নাম থাকা উচিত।
1NF-এর Example:
Before (1NF-এ নয়):
StudentID Name Subjects 101 Alice Math, Physics 102 Bob Chemistry "Subjects" column-এ একই cell-এ দুটি value আছে, যা atomic rule break করে।<
After (1NF-এ আছে):
StudentID Name Subject 101 Alice Math 101 Alice Physics 102 Bob Chemistry এখন প্রতিটি cell-এ single value আছে এবং table 1NF rules follow করে।
2NF (Second Normal Form)
একটি table 2NF-এ থাকে যখন এটি already 1NF-এ থাকে এবং কোনো partial dependency নেই। এর মানে non-key column পুরো primary key-এর উপর depend করতে হবে, শুধু key-এর একটা অংশের উপর নয়। 2NF বিশেষভাবে গুরুত্বপূর্ণ যখন primary key দুটি বা ততোধিক column নিয়ে তৈরি হয় (composite key)।<
- প্রথমে 1NF-এ থাকতে হবে।
- No partial dependency: প্রতিটি non-key attribute পুরো primary key-এর উপর depend করতে হবে।
2NF-এর Example:
Before (2NF-এ নয়):

Primary key = (StudentID + SubjectID)।<
Problem: StudentName শুধু StudentID-এর উপর depend করে, পুরো key-এর উপর নয়। এটি partial dependency।<After (2NF-এ আছে):
Student Table:
StudentID StudentName 101 Alice Subject Table:
SubjectID SubjectName S01 Math S02 Physics Enrollment Table:
StudentID SubjectID Marks 101 S01 85 101 S02 90 এখন প্রতিটি non-key attribute নিজের table-এর পুরো primary key-এর উপর depend করে এবং partial dependency remove হয়ে গেছে।
- ☆13Database Management SystemRAIDConcept of RAID, relevance in database, uses in database, is it possible?Sonali Bank, ADA, 24 | ADA
RAID (Redundant Array of Independent Disks) is a technology that combines multiple physical disks into a single logical unit to improve performance, reliability, and data availability.
- Techniques: Uses striping, mirroring, and parity.
- Goal: Faster data access and protection against disk failure
Relevance in Database
RAID is highly important in database systems because databases require high speed and data reliability.
- Ensures continuous database availability.
- Prevents data loss due to disk failure.
- Improves read/write performance.
Uses in Database
- RAID 1: Used for critical data (mirroring for safety).
- RAID 5: Used for balance of performance and storage efficiency.
- RAID 10: Used for high-performance databases.
- Backup Systems: Ensures data redundancy.
Is it Possible?
Yes, RAID is widely used in database systems.
- Implemented using hardware RAID controllers or software RAID.
- Common in servers, data centers, and enterprise systems.
- Essential for systems like banking, e-commerce, and cloud databases.
RAID (Redundant Array of Independent Disks) হলো একটি প্রযুক্তি যেখানে একাধিক physical disk একসাথে ব্যবহার করে একটি logical unit তৈরি করা হয় যাতে performance, reliability এবং data availability বাড়ানো যায়。
- Technique: Striping, mirroring এবং parity ব্যবহার করা হয়।
- Goal: দ্রুত data access এবং disk failure থেকে সুরক্ষা।
Database-এ RAID-এর গুরুত্ব
Database system-এ RAID খুব গুরুত্বপূর্ণ কারণ এখানে speed এবং data নিরাপত্তা অত্যন্ত জরুরি।
- Database সবসময় চালু রাখতে সাহায্য করে।
- Disk নষ্ট হলেও data loss কমায়।
- Read/write performance উন্নত করে।
Database-এ RAID-এর ব্যবহার
- RAID 1: গুরুত্বপূর্ণ data-এর জন্য (mirroring)।
- RAID 5: performance এবং storage-এর balance।
- RAID 10: high-performance database-এর জন্য।
- Backup System: data redundancy নিশ্চিত করে।
এটি কি সম্ভব?
হ্যাঁ, RAID database system-এ ব্যাপকভাবে ব্যবহৃত হয়।
- Hardware বা software RAID ব্যবহার করে implement করা যায়।
- Server, data center এবং enterprise system-এ ব্যবহৃত হয়।
- Banking, e-commerce এবং cloud system-এ অত্যন্ত গুরুত্বপূর্ণ।
- ☆14Database Management SystemDBMS_Introduction৮(খ) DBMS কী? দুটি সুবিধা লিখুন।BPSC_MoHA_AP, 26 | Assistant Programmer (BPSC)
- ☆15Database Management SystemDBMS_IntroductionWhat is DBMS? Write short note on Virtual memory and Cache memorySPCBL, SAP, 22 | Assistant Programmer
DBMS (Database Management System)
A DBMS is software that is used to create, store, manage, and retrieve data efficiently from a database. It provides an interface between users/applications and the database.
Virtual Memory
Virtual memory is a memory management technique that uses a part of secondary storage (hard disk) as an extension of main memory (RAM). It allows programs to run even if the physical memory is insufficient.
Cache Memory
Cache memory is a small, high-speed memory located between the CPU and main memory. It stores frequently accessed data and instructions to improve system performance.
DBMS (Database Management System)
DBMS হলো এমন একটি software যা database তৈরি, সংরক্ষণ, পরিচালনা এবং data retrieve করার জন্য ব্যবহৃত হয়। এটি user/application এবং database-এর মধ্যে interface হিসেবে কাজ করে।
Virtual Memory
Virtual memory হলো একটি memory management technique যেখানে secondary storage (hard disk)-এর একটি অংশ main memory (RAM)-এর মতো ব্যবহার করা হয়। এতে physical memory কম হলেও program চলতে পারে।
Cache Memory
Cache memory হলো CPU এবং main memory-এর মাঝখানে থাকা একটি ছোট ও দ্রুতগতির memory। এটি বারবার ব্যবহৃত data ও instruction সংরক্ষণ করে system performance বাড়ায়।
- ☆16Database Management SystemDBMS_IntroductionDifference between data and information?SPCBL, SAP, 22 | Assistant Programmer


- ☆17Database Management SystemDBMS_IntroductionDifferentiate among Database, Data Warehouse and Data Mining with real world example. 10CB, SO(IT), 23 | Senior Officer (IT)


- ☆18Database Management SystemDBMS_IntroductionComparison and Contrast between Relational and NoSQL Database.Sonali, O(it), 21 | Officer (IT)

- ☆19Database Management SystemDBMS_IntroductionClassify the failure of Database Management.CB, SO(IT), 20 | Senior Officer (IT)
Classification of Database Failures
A Database Failure occurs when the database system cannot continue its normal operation or when committed data may be lost. Database failures can be classified into the following types:
1. Transaction Failure:
A transaction may fail because of logical errors, invalid data, constraint violations, or deadlock. The failed transaction is usually rolled back.2. System Failure:
A system crash caused by power failure, hardware failure, or operating system failure may cause the contents of main memory to be lost. However, data stored on secondary storage generally remains safe.3. Disk Failure:
Failure of a hard disk or other storage device can cause loss or corruption of database data stored on that device.4. Media Failure:
Damage or corruption of storage media, such as disk crashes or bad sectors, can make database files inaccessible or permanently lost.5. Communication Failure:
In a distributed database system, network failure or communication problems may prevent transactions from completing correctly between different sites.6. Catastrophic Failure:
Events such as fire, flood, earthquake, or major hardware destruction can damage the entire database system and its storage.Conclusion:
The major database failures are Transaction Failure, System Failure, Disk/Media Failure, Communication Failure, and Catastrophic Failure. Backup, logging, recovery mechanisms, and fault-tolerant systems are used to recover from these failures.
Database Failure-এর শ্রেণিবিভাগ
যখন Database System স্বাভাবিকভাবে কাজ করতে পারে না অথবা Commit করা Data হারিয়ে যাওয়ার সম্ভাবনা থাকে, তখন তাকে Database Failure বলে। Database Failure-কে নিম্নলিখিতভাবে শ্রেণিবদ্ধ করা যায়:
১. Transaction Failure:
Logical Error, Invalid Data, Constraint Violation অথবা Deadlock-এর কারণে কোনো Transaction ব্যর্থ হতে পারে। সাধারণত ব্যর্থ Transaction-কে Rollback করা হয়।২. System Failure:
Power Failure, Hardware Failure অথবা Operating System Failure-এর কারণে System Crash হলে Main Memory-এর Data হারিয়ে যেতে পারে। তবে Secondary Storage-এ সংরক্ষিত Data সাধারণত নিরাপদ থাকে।৩. Disk Failure:
Hard Disk বা অন্য কোনো Storage Device নষ্ট হলে সেখানে সংরক্ষিত Database Data হারিয়ে যেতে বা Corrupt হতে পারে।৪. Media Failure:
Disk Crash, Bad Sector অথবা Storage Media-এর ক্ষতির কারণে Database File Access করা সম্ভব নাও হতে পারে বা স্থায়ীভাবে Data হারিয়ে যেতে পারে।৫. Communication Failure:
Distributed Database System-এ Network Failure বা Communication Problem-এর কারণে বিভিন্ন Site-এর মধ্যে Transaction সঠিকভাবে সম্পন্ন নাও হতে পারে।৬. Catastrophic Failure:
Fire, Flood, Earthquake অথবা বড় ধরনের Hardware Destruction-এর মতো ঘটনায় সম্পূর্ণ Database System এবং Storage ক্ষতিগ্রস্ত হতে পারে।উপসংহার:
Database-এর প্রধান Failure হলো Transaction Failure, System Failure, Disk/Media Failure, Communication Failure এবং Catastrophic Failure। এসব Failure থেকে Recovery করার জন্য Backup, Logging, Recovery Mechanism এবং Fault-Tolerant System ব্যবহার করা হয়।
- ☆20Database Management SystemDBMS_IntroductionWhat is distributed database?Write the role of a DB administrator.SB & JB, ADA, 22 | ADA
Distributed Database
A distributed database is a database in which data is stored across multiple physical locations (different computers or servers) that are connected through a network. Although the data is distributed, it appears to users as a single unified database.
Each site in a distributed database system can process local queries independently and also participate in global queries.
Example: A bank database where customer data is stored in different branch servers located in different cities.
Role of a Database Administrator (DBA)
A Database Administrator (DBA) is responsible for managing, maintaining, and securing the database system to ensure data availability, integrity, and performance.
- Database Installation & Configuration: Installs, configures, and upgrades database software.
- Data Security: Controls user access, permissions, and ensures data protection.
- Backup & Recovery: Performs regular backups and restores data during failures.
- Performance Monitoring: Optimizes database performance and handles tuning.
- Data Integrity: Ensures accuracy and consistency of stored data.
Distributed Database
Distributed database হলো এমন একটি database যেখানে data একাধিক physical location-এ (ভিন্ন computer বা server-এ) সংরক্ষিত থাকে এবং network-এর মাধ্যমে সংযুক্ত থাকে। তবে user-এর কাছে এটি একটি single unified database হিসেবেই দেখা যায়।
এই system-এ প্রতিটি site নিজস্ব local query process করতে পারে এবং একই সাথে global query-তেও অংশ নিতে পারে।
উদাহরণ: একটি bank system যেখানে বিভিন্ন শহরের branch server-এ customer data সংরক্ষিত থাকে।
Database Administrator (DBA)-এর ভূমিকা
Database Administrator (DBA) হলো সেই ব্যক্তি যিনি database system পরিচালনা, রক্ষণাবেক্ষণ এবং নিরাপত্তা নিশ্চিত করেন যাতে data সবসময় available, secure এবং consistent থাকে।
- Database Installation & Configuration: Database software install, configure এবং update করে।
- Data Security: User access control ও permission manage করে data সুরক্ষিত রাখে।
- Backup & Recovery: নিয়মিত backup নিয়ে data loss হলে restore করে।
- Performance Monitoring: Database-এর performance পর্যবেক্ষণ ও tuning করে।
- Data Integrity: Data-এর accuracy ও consistency নিশ্চিত করে।
- ☆21Database Management SystemKeysBriefly describe primary key, foreign key and indexing in relational database and their relationship. Do you think database indexing always makes applications faster? Explain your answer.Combined Bank, SO(IT), 24 | Senior Officer (IT)
Primary Key, Foreign Key, and Indexing in Relational Databases
Primary Key: A primary key is a column (or a set of columns) that uniquely identifies each row in a table.
Example: Student Table
Stu_Id Stu_Name Stu_Age 101 Steve 23 102 John 24 103 Robert 28 104 Steve 29 - Stu_Id can be the primary key because it is unique for each student.
- Stu_Name alone cannot be a primary key, as multiple students can have the same name.
- Stu_Age alone cannot be a primary key, as multiple students can have the same age.
Foreign Key: A foreign key is a column in one table that references the primary key of another table. It establishes relationships between tables.
Example: Course Enrollment Table
Course_Id Stu_Id C01 101 C02 102 C03 101 - In this table, Stu_Id is a foreign key as it references the primary key (Stu_Id) from the Student table.
Indexing: Indexing improves the speed of data retrieval in a database.
- Advantages: Indexing speeds up search queries, improves performance, and reduces load time.
- Disadvantages: Indexes require extra storage and may slow down insert, update, and delete operations.
Does Indexing Always Make Applications Faster?
- Yes, for read-heavy databases where fast searches are needed.
- No, for write-heavy databases where frequent inserts and updates happen, as indexing can slow them down.
- ☆22Database Management SystemKeysSuppose that we have a relational database with the following table. Underlined one represent primary key
Movies (mid, title, year)
Write a SQL query to return the number of movies that are romantic comedies.
People (pid, name)
Genres (gid, genre)
HasRole (pid, mid, role)
Has Genre (gid, mid)BB, AP, 23 | Assistant ProgrammerSELECT COUNT(*) FROM Movies, Genres, HasGenre WHERE Movies.mid = HasGenre.mid AND HasGenre.gid = Genres.gid AND Genres.genre = "romantic comedy";
- ☆23Database Management SystemKeysRelation to find primary, candidate, super keySB & JB, ADA, 22 | ADA
Primary Key, Candidate Key, and Super Key (with Example)
In a relational database, keys are used to uniquely identify each record (tuple) in a relation.
Example Relation: STUDENT
STUDENT(StudentID, Name, Email, Phone)
- Super Key: A super key is a set of one or more attributes that can uniquely identify a record in a table.
Super Key Examples:
{StudentID}, {Email}, {StudentID, Name}, {StudentID, Phone}- Candidate Key: A candidate key is a minimal super key. It uniquely identifies a record and has no unnecessary attributes.
Candidate Key Examples:
{StudentID}, {Email}- Primary Key: A primary key is one candidate key chosen to uniquely identify records in the relation.
Primary Key Example:
StudentID
Primary Key, Candidate Key এবং Super Key (উদাহরণসহ)
Relational database-এ key ব্যবহার করা হয় relation-এর প্রতিটি record (tuple) uniquely identify করার জন্য।
উদাহরণ Relation: STUDENT
STUDENT(StudentID, Name, Email, Phone)
- Super Key: Super key হলো এক বা একাধিক attribute-এর সমন্বয় যা একটি record uniquely identify করতে পারে।
Super Key-এর উদাহরণ:
{StudentID}, {Email}, {StudentID, Name}, {StudentID, Phone}- Candidate Key: Candidate key হলো minimal super key, অর্থাৎ কোনো অতিরিক্ত attribute থাকে না।
Candidate Key-এর উদাহরণ:
{StudentID}, {Email}- Primary Key: Primary key হলো candidate key থেকে নির্বাচিত একটি key যা table-এর প্রতিটি record uniquely identify করে।
Primary Key-এর উদাহরণ:
StudentID
- ☆24Database Management SystemKeysSuppose a relational schema R(w,x,y,z)R(w,x,y,z) and the set of functional dependencies FF is given as: F={wx→yz,y→w,z→x} Find the candidate keys in the above relation.SB & JB, ADA, 22 | ADA
Given: R(w,x,y,z)
Functional Dependencies: F = { wx→yz, y→w, z→x }
Goal: Find all candidate keys (minimal superkeys).
Key idea: Find attribute sets whose closure gives {w,x,y,z} and are minimal.
Closures:
- (wx)+ = wx → yz ⇒ {w,x,y,z} ⇒ wx is a candidate key.
- (yz)+: y→w ⇒ add w, z→x ⇒ add x ⇒ {w,x,y,z} ⇒ yz is a candidate key.
- (wz)+: z→x ⇒ get x, now wx→yz ⇒ get y,z ⇒ {w,x,y,z} ⇒ wz is a candidate key.
- (xy)+: y→w ⇒ get w, now wx→yz ⇒ get y,z ⇒ {w,x,y,z} ⇒ xy is a candidate key.
Answer (Candidate Keys): {wx}, {xy}, {wz}, {yz}
প্রদত্ত: R(w,x,y,z)
Functional Dependencies: F = { wx→yz, y→w, z→x }
উদ্দেশ্য: সবগুলো candidate key (minimal superkey) বের করা।
Key idea: যে attribute set-এর closure থেকে {w,x,y,z} পাওয়া যায় এবং সেটি minimal, সেটিই candidate key।
Closures:
- (wx)+ = wx → yz ⇒ {w,x,y,z} ⇒ wx candidate key।
- (yz)+: y→w ⇒ w যোগ, z→x ⇒ x যোগ ⇒ {w,x,y,z} ⇒ yz candidate key।
- (wz)+: z→x ⇒ x পাওয়া যায়, এরপর wx→yz ⇒ y,z পাওয়া যায় ⇒ {w,x,y,z} ⇒ wz candidate key।
- (xy)+: y→w ⇒ w পাওয়া যায়, এরপর wx→yz ⇒ z পাওয়া যায় ⇒ {w,x,y,z} ⇒ xy candidate key।
উত্তর (Candidate Keys): {wx}, {xy}, {wz}, {yz}
- ☆25Database Management SystemKeysDifference between Primary key and Unique Key, Drop and Purge, Delete and Truncate.RAKUB, ADA, 20 | Assistant Database Administrator
- ☆26Database Management SystemRelationshipYou are designing a database for a Library. Explain the relationship between a "Book" table and a "Borrower" table. Is it 1-to-1, 1-to-Many, or Many-to-Many? Justify your answer.Combined Bank, AP-22, 26 | Assistant Programmer
Relationship between Book and Borrower Tables
In a library database, the relationship between the Book table and the Borrower table is typically Many-to-Many.
Justification
• A single book can be borrowed by many borrowers over time.
• A single borrower can borrow many books at the same time or over different periods.Because both tables can have multiple associations with each other, the relationship is many-to-many. In practice, this relationship is implemented using an intermediate table (such as Borrow or Loan) that stores information like borrow date, return date, and IDs of both book and borrower.
Book এবং Borrower Table এর মধ্যে সম্পর্ক
একটি library database এ Book table এবং Borrower table এর মধ্যে সম্পর্ক সাধারণত Many-to-Many হয়।
ব্যাখ্যা
• একটি book সময়ের সাথে সাথে একাধিক borrower দ্বারা ধার নেওয়া যেতে পারে।
• একটি borrower একই সময়ে বা বিভিন্ন সময়ে একাধিক book ধার নিতে পারে।এই কারণে Book এবং Borrower উভয়ের মধ্যেই বহু সম্পর্ক থাকে, তাই এটি many-to-many relationship। বাস্তবে এই সম্পর্কটি একটি intermediate table (যেমন Borrow বা Loan) ব্যবহার করে implement করা হয়, যেখানে borrow date, return date এবং উভয়ের ID সংরক্ষিত থাকে।
- ☆27Database Management SystemRelationshipWhat are the different types of relationships in a relational database?
Explain each with examples.Combined Bank, O(IT-23), 26 | Officer (IT)Relationship in Relational Database
A relationship in a relational database defines how tables are connected with each other using keys such as primary keys and foreign keys.
Relationships help organize data efficiently and reduce data redundancy.
Main Types of Relationships
- One-to-One (1:1)
- One-to-Many (1:M)
- Many-to-Many (M:N)
1. One-to-One Relationship (1:1)
In a one-to-one relationship, one record in one table is related to only one record in another table.
Example:
A person can have only one passport, and one passport belongs to only one person.
Person Table Passport Table Person_ID Passport_ID 101 P5001 Use Case:
- Employee and Locker
- Person and Passport
2. One-to-Many Relationship (1:M)
In a one-to-many relationship, one record in one table can be related to many records in another table.
However, each record in the second table belongs to only one record in the first table.
Example:
One department can have many employees, but each employee belongs to only one department.
Department Employee IT Rahim IT Karim Use Case:
- Department and Employees
- Customer and Orders
3. Many-to-Many Relationship (M:N)
In a many-to-many relationship, many records in one table can relate to many records in another table.
This relationship is usually implemented using a junction table or bridge table.
Example:
A student can enroll in many courses, and a course can have many students.
Student Course Rahim Database Rahim Networking Karim Database Use Case:
- Students and Courses
- Doctors and Patients
Summary of Relationships
Relationship Type Description Example One-to-One One record relates to one record Person and Passport One-to-Many One record relates to many records Department and Employees Many-to-Many Many records relate to many records Students and Courses Relationships in relational databases help connect tables logically and efficiently. Proper relationships improve data integrity, reduce redundancy, and simplify database management.
Relational Database-এ Relationship
Relational database-এ relationship বোঝায় কীভাবে বিভিন্ন table primary key এবং foreign key ব্যবহার করে একে অপরের সাথে সংযুক্ত থাকে。
Relationship data-কে সুশৃঙ্খলভাবে সংরক্ষণ করতে এবং redundancy কমাতে সাহায্য করে।
Relationship-এর প্রধান ধরনসমূহ
- One-to-One (1:1)
- One-to-Many (1:M)
- Many-to-Many (M:N)
1. One-to-One Relationship (1:1)
One-to-One relationship-এ একটি table-এর একটি record অন্য table-এর শুধুমাত্র একটি record-এর সাথে সম্পর্কযুক্ত থাকে。
উদাহরণ:
একজন ব্যক্তির একটি passport থাকতে পারে এবং একটি passport শুধুমাত্র একজন ব্যক্তির হয়。
Person Table Passport Table Person_ID Passport_ID 101 P5001 ব্যবহার:
- Employee এবং Locker
- Person এবং Passport
2. One-to-Many Relationship (1:M)
One-to-Many relationship-এ একটি table-এর একটি record অন্য table-এর অনেক record-এর সাথে সম্পর্কযুক্ত হতে পারে。
তবে দ্বিতীয় table-এর প্রতিটি record শুধুমাত্র প্রথম table-এর একটি record-এর সাথে সম্পর্কিত থাকে。
উদাহরণ:
একটি department-এ অনেক employee থাকতে পারে, কিন্তু প্রতিটি employee শুধুমাত্র একটি department-এর অন্তর্ভুক্ত。
Department Employee IT Rahim IT Karim ব্যবহার:
- Department এবং Employees
- Customer এবং Orders
3. Many-to-Many Relationship (M:N)
Many-to-Many relationship-এ একটি table-এর অনেক record অন্য table-এর অনেক record-এর সাথে সম্পর্কযুক্ত হতে পারে。
এই relationship সাধারণত junction table বা bridge table ব্যবহার করে বাস্তবায়ন করা হয়。
উদাহরণ:
একজন student অনেক course-এ ভর্তি হতে পারে এবং একটি course-এ অনেক student থাকতে পারে。
Student Course Rahim Database Rahim Networking Karim Database ব্যবহার:
- Students এবং Courses
- Doctors এবং Patients
Relationship-এর সারসংক্ষেপ
Relationship Type বর্ণনা উদাহরণ One-to-One একটি record একটি record-এর সাথে সম্পর্কযুক্ত Person এবং Passport One-to-Many একটি record অনেক record-এর সাথে সম্পর্কযুক্ত Department এবং Employees Many-to-Many অনেক record অনেক record-এর সাথে সম্পর্কযুক্ত Students এবং Courses উপসংহার
Relational database-এ relationship table-গুলোর মধ্যে logical connection তৈরি করে। সঠিক relationship data integrity বৃদ্ধি করে, redundancy কমায় এবং database management সহজ করে。
- ☆28Database Management SystemRelationshipDiscuss about different types of relations in DBMS.Combined Bank, AP, 24 | Assistant Programmer
In Database Management Systems (DBMS), relationships define how data in different tables are connected. There are three main types of relationships in a relational database:
1. One-to-One (1:1) Relationship:
Each record in Table A is linked to only one record in Table B, and vice versa.Example:
- A person and their passport (One person has only one passport, and one passport belongs to one person).

2. One-to-Many (1:M) Relationship:
A record in Table A can be linked to multiple records in Table B, but each record in Table B is linked to only one record in Table A.Example:
- A customer can place multiple orders, but each order belongs to only one customer.

3. Many-to-Many (M:N) Relationship:
Each record in Table A can be linked to multiple records in Table B, and vice versa.Example:
- A doctor can treat multiple patients, and a patient can have multiple doctors.

Database Management System (DBMS)-এ relationship ব্যবহার করা হয় বিভিন্ন table-এর মধ্যে data কীভাবে একে অপরের সাথে সংযুক্ত তা বোঝানোর জন্য। Relational database-এ প্রধানত তিন ধরনের relationship রয়েছে:
১. One-to-One (1:1) Relationship:
এই relationship-এ Table A-এর একটি record শুধুমাত্র Table B-এর একটি record-এর সাথে যুক্ত থাকে, এবং Table B-এর একটি record-ও শুধুমাত্র Table A-এর একটি record-এর সাথে যুক্ত থাকে।উদাহরণ:
- একজন ব্যক্তি এবং তার passport (একজন ব্যক্তির একটি passport থাকে এবং একটি passport শুধুমাত্র একজন ব্যক্তিরই হয়)।

২. One-to-Many (1:M) Relationship:
এই relationship-এ Table A-এর একটি record Table B-এর একাধিক record-এর সাথে যুক্ত হতে পারে, কিন্তু Table B-এর প্রতিটি record শুধুমাত্র Table A-এর একটি record-এর সাথেই যুক্ত থাকে।উদাহরণ:
- একজন customer একাধিক order দিতে পারে, কিন্তু প্রতিটি order শুধুমাত্র একটি customer-এরই হয়।

৩. Many-to-Many (M:N) Relationship:
এই relationship-এ Table A-এর একটি record Table B-এর একাধিক record-এর সাথে যুক্ত হতে পারে, এবং Table B-এর একটি record-ও Table A-এর একাধিক record-এর সাথে যুক্ত থাকতে পারে।উদাহরণ:
- একজন doctor একাধিক patient-এর চিকিৎসা করতে পারে, এবং একজন patient একাধিক doctor-এর চিকিৎসা নিতে পারে।

- ☆29Database Management SystemRelationshipA relation R(A, B, C) is decomposed into R1(A, B) and R2(B, C). Explain whether the decomposition is lossless and describe the conditions required for a lossless join decomposition.[assume]Combined Bank, ADA-23, 26 | ADA
Given:
Relation R(A, B, C) is decomposed into:
R1(A, B) and R2(B, C)Is the decomposition lossless?
Yes, this decomposition is lossless join if attribute B is a key (or common key condition holds).
Explanation:
The common attribute between R1 and R2 is B.
When joining R1 and R2 on B, we can perfectly reconstruct the original relation R(A, B, C) without losing or adding extra tuples, provided B functionally determines either R1 or R2.Lossless Join Condition:
A decomposition of R into R1 and R2 is lossless if:
(R1 ∩ R2) → R1 OR (R1 ∩ R2) → R2
For this case:
R1 ∩ R2 = {B}So the condition becomes:
- B → A (then lossless), OR
- B → C (then lossless)
Cloud service outage online banking disrupt করলে cloud provider এবং bank উভয়েরই responsibilities থাকে, কিন্তু ভিন্ন domains-এ। তাদের obligations সাধারণত Service Level Agreement (SLA)-এ define করা থাকে।
1. Cloud Service Provider Responsibilities
Technical:
Infrastructure uptime: Data center power, cooling, networking এবং hardware maintain করা SLA guarantees (প্রায়শই 99.9% থেকে 99.99%) meet করতে।
Redundancy এবং failover: Multi-zone বা multi-region replication provide করা যাতে single point of failure total outage cause না করে।
Incident response: দ্রুত failures detect করা, status transparently communicate করা, এবং agreed Recovery Time Objective (RTO)-এর মধ্যে services restore করা।
Backup integrity: Customer data backups consistent এবং recoverable কিনা নিশ্চিত করা।Legal:
- SLA credits: Uptime guaranteed threshold-এর নিচে নামলে financial penalties বা service credits pay করা।
- Notification duty: Affected customers-কে promptly outage cause, scope এবং estimated resolution time সম্পর্কে inform করা।
- Data protection: Failure events-এর সময়ও data residency এবং encryption standards comply করা।
- Liability cap: Most SLAs provider liability monthly fees paid-এর মধ্যে limit করে, lost bank revenue এর মতো consequential damages বাদ দিয়ে।
2. Bank Responsibilities
Technical:
Architecture resilience: Multi-cloud বা hybrid-cloud failover সহ systems design করা, single provider বা region-এর উপর নির্ভর না করে।
Disaster recovery planning: Active-active বা warm standby systems maintain করা যা automatically switch over করতে পারে।
Monitoring এবং alerting: Independently outages detect করা এবং customer communication channels trigger করা।
Data backups: Primary cloud environment-এর বাইরে independent encrypted backups রাখা।Legal:
- Regulatory compliance: Banking regulators bank-কেই service availability-এর জন্য accountable ধরে, cloud provider failures যাই হোক না কেন।
- Customer duty: Bank-কে failed transactions, recovery-এর সময় unauthorized access, বা missed payments-এর জন্য customers-কে compensate করতে হয়।
- Contract management: Bank SLA negotiate, liability limits বোঝা, এবং higher availability tiers demand করার দায়িত্বে।
- Transparency to customers: Bank-কে customers এবং regulators-কে outages explain করতে হবে, cloud provider-এর দোষ shift না করে।
- ☆30Database Management SystemRelationshipWeak Entry vs strong entity difference with relation.SB & JB, ADA, 22 | ADA
- ☆31Database Management SystemAssume we have the following application that models soccer teams, the games they play, and the players in each team. In the design, we want to capture the following:
- We have a set of teams, each team has an ID (unique identifier), name, main stadium, and to which city this team belongs.
- Each team has many players, and each player belongs to one team. Each player has a number (unique identifier), name, DOB, start year, and shirt number that he uses.
- Teams play matches, in each match there is a host team and a guest team. The match takes place in the stadium of the host team.
- For each match we need to keep track of the following: the date on which the game is played, the final result of the match and the players participated in the match. For each player, how many goals he scored, whether or not he took yellow card, and whether or not he took red card.
JB, ANE, 20 | Assistant Network Engineer - ☆32Database Management SystemAnswer the following question based on the following table in DBMS:
Employee (emp_id, emp_name, street, emp_city, join_date)
Works (emp_id, comp_name, leaves, salary, dept, man_id)
Company (comp_id, comp_name, comp_city)
Manager (man_id, emp_id, man_name)
(i) Write a SQL query to find employee details from the employee table who's Salary is between 5000 and 8000.
(ii) Find all employees who earn more than the average salary of all employees of that department.
(iii) Calculate the number of leaves taken by an employee.
(iv) List the managers and the number of employees working for those managers.JB, ANE, 20 | Assistant Network Engineer - ☆33Database Management SystemDefine View, Materialized view. Difference betweenView and Materialized View and Usage of two.RAKUB, ADA, 20 | Assistant Database Administrator
- ☆34Database Management SystemWhat are the roles of Database Engineer?RAKUB, ADA, 20 | Assistant Database Administrator
- ☆35Database Management SystemHow to copy from Parent table to Child Table with 1 column dividing into 3 different columns?RAKUB, ADA, 20 | Assistant Database Administrator
- ☆36Database Management SystemWhat is constraints? Why use constraint? Difference between table level Cosntraint and column level Cosntraint.RAKUB, ADA, 20 | Assistant Database Administrator
- ☆37Database Management SystemDescribe what are the ways for no data loss?RAKUB, ADA, 20 | Assistant Database Administrator
- ☆38Database Management SystemDistributed DBMS and Features of DBMSBB, AME, 19 | Assistant Maintenance Engineer
Distributed DBMS: A Distributed Database Management System (DDBMS) manages a logically related database whose data is stored across multiple network-connected locations. To users and applications, the distributed data can appear as a coordinated database, even though the data is physically stored at different sites.
Example: A bank may maintain databases at different branches or data centers. A DDBMS can coordinate access to the distributed data while applying appropriate transaction and consistency rules.
Important Concepts:
1. Data Distribution: Data may be divided into fragments and stored at different sites.
2. Replication: Copies of data may be stored at multiple sites to improve availability and read performance, although replication requires mechanisms to keep copies consistent.
3. Distributed Query Processing: The system coordinates queries that require data from more than one location.
4. Transaction Coordination: The DDBMS coordinates transactions involving multiple sites and aims to preserve required consistency and transaction properties.
Advantages of a Distributed DBMS: Improved availability, local access to data, potential scalability, and the ability to distribute processing across locations.
Challenges: Network delays, communication failures, distributed transaction coordination, consistency management, security, and increased administrative complexity.
Features of a DBMS:
1. Data Storage, Retrieval, and Updating: A DBMS provides mechanisms to insert, read, modify, and delete data efficiently.
2. Reduced Data Redundancy: Proper database design helps reduce unnecessary duplication of data.
3. Data Consistency: Constraints and transaction controls help maintain consistent data across operations.
4. Data Security: Authentication, authorization, and access controls help prevent unauthorized data access.
5. Data Integrity: Constraints, such as primary keys, foreign keys, and validation rules, help keep data accurate and valid.
6. Backup and Recovery: Backup and recovery mechanisms help restore data after failures or accidental loss.
7. Concurrency Control: The DBMS manages simultaneous access by multiple users or transactions to reduce conflicts.
8. Transaction Management: Transaction mechanisms help ensure reliable operations. Relational DBMSs commonly use the ACID properties: Atomicity, Consistency, Isolation, and Durability.
9. Data Independence: Changes to physical storage or parts of the database structure can often be made without requiring corresponding changes to every application.
10. Query Processing: The DBMS interprets queries and selects an execution plan to retrieve or modify data.
11. Data Sharing: Authorized users and applications can access a shared database according to permissions and concurrency rules.
Distributed DBMS: Distributed Database Management System (DDBMS) হলো এমন একটি Database Management System, যা একটি যৌক্তিকভাবে সম্পর্কিত Database পরিচালনা করে, যার Data Network-এর মাধ্যমে সংযুক্ত একাধিক Location-এ সংরক্ষিত থাকে। Data ভৌতভাবে বিভিন্ন Site-এ সংরক্ষিত থাকলেও User এবং Application-এর কাছে এটি একটি সমন্বিত Database হিসেবে কাজ করতে পারে।
উদাহরণ: একটি Bank তার বিভিন্ন Branch অথবা Data Center-এ Database সংরক্ষণ করতে পারে। DDBMS বিভিন্ন Location-এ থাকা Data Access সমন্বয় করে এবং উপযুক্ত Transaction ও Consistency Rules অনুসরণ করতে সাহায্য করে।
গুরুত্বপূর্ণ ধারণা (Important Concepts):
১. Data Distribution: Data-কে একাধিক Fragment-এ ভাগ করে বিভিন্ন Site-এ সংরক্ষণ করা যেতে পারে।
২. Replication: Data-এর একাধিক Copy বিভিন্ন Site-এ সংরক্ষণ করা যেতে পারে, যাতে Availability এবং Read Performance উন্নত হয়। তবে সব Copy-তে Data-এর Consistency বজায় রাখার জন্য উপযুক্ত Mechanism প্রয়োজন।
৩. Distributed Query Processing: একাধিক Location থেকে Data প্রয়োজন হয় এমন Query পরিচালনা ও সম্পন্ন করার জন্য System বিভিন্ন Site-এর কাজ সমন্বয় করে।
৪. Transaction Coordination: একাধিক Site-সম্পর্কিত Transaction সমন্বয় করে DDBMS। এর উদ্দেশ্য হলো প্রয়োজনীয় Data Consistency এবং Transaction Properties বজায় রাখা।
Distributed DBMS-এর সুবিধা (Advantages): উন্নত Availability, স্থানীয়ভাবে Data Access করার সুবিধা, প্রয়োজন অনুযায়ী Scalability বৃদ্ধি এবং বিভিন্ন Location-এ Processing বিতরণ করার সক্ষমতা।
চ্যালেঞ্জ (Challenges): Network Delay, Communication Failure, Distributed Transaction Coordination, Consistency Management, Security এবং Administration-এর জটিলতা বৃদ্ধি।
DBMS-এর বৈশিষ্ট্য (Features of a DBMS):
১. Data Storage, Retrieval এবং Updating: DBMS দক্ষতার সঙ্গে Data Insert, Read, Modify এবং Delete করার ব্যবস্থা প্রদান করে।
২. Reduced Data Redundancy: সঠিক Database Design অপ্রয়োজনীয় Data Duplication বা একই Data বারবার সংরক্ষণ করার প্রবণতা কমাতে সাহায্য করে।
৩. Data Consistency: Constraint এবং Transaction Control-এর মাধ্যমে বিভিন্ন Operation-এর সময় Data-এর Consistency বজায় রাখতে সাহায্য করা হয়।
৪. Data Security: Authentication, Authorization এবং Access Control ব্যবহার করে অননুমোদিত Data Access প্রতিরোধে সহায়তা করা হয়।
৫. Data Integrity: Primary Key, Foreign Key এবং Validation Rules-এর মতো Constraint Data-কে সঠিক ও বৈধ রাখতে সাহায্য করে।
৬. Backup and Recovery: System Failure অথবা ভুলবশত Data হারিয়ে গেলে Backup এবং Recovery Mechanism-এর মাধ্যমে Data পুনরুদ্ধার করা যায়।
৭. Concurrency Control: একাধিক User বা Transaction একই সময়ে Database Access করলে DBMS সেই Access নিয়ন্ত্রণ করে, যাতে Data Conflict কমানো যায়।
৮. Transaction Management: Transaction Mechanism নির্ভরযোগ্য Database Operation নিশ্চিত করতে সাহায্য করে। Relational DBMS-এ সাধারণত ACID Properties ব্যবহার করা হয়। এগুলো হলো Atomicity, Consistency, Isolation এবং Durability।
৯. Data Independence: Physical Storage অথবা Database Structure-এর কিছু অংশ পরিবর্তন করা হলেও অনেক ক্ষেত্রে প্রতিটি Application-এ সংশ্লিষ্ট পরিবর্তন করার প্রয়োজন হয় না।
১০. Query Processing: DBMS Query বিশ্লেষণ করে এবং Data Retrieve অথবা Modify করার জন্য উপযুক্ত Execution Plan নির্বাচন করে।
১১. Data Sharing: অনুমোদিত User এবং Application নির্ধারিত Permission ও Concurrency Rules অনুসরণ করে একটি Shared Database Access করতে পারে।
- ☆39Database Management SystemA company needs key person for DBMS. What is his/her duty as key person?BB, AP, 19 | Assistant Programmer
A key person responsible for Database Management System (DBMS) is generally known as a Database Administrator (DBA). His/her main duties are:
1. Database Design: Designing and organizing the database according to the company's requirements.
2. Data Security: Protecting the database from unauthorized access and ensuring data confidentiality.
3. Backup and Recovery: Taking regular database backups and recovering data in case of system failure or data loss.
4. Performance Monitoring: Monitoring and optimizing database performance to ensure efficient data processing.
5. User Management: Creating user accounts and assigning appropriate access permissions.
6. Data Integrity: Ensuring data accuracy, consistency, and reliability.
7. Database Maintenance: Installing updates, managing storage, and troubleshooting database problems.
8. Availability: Ensuring that the database remains available and operates reliably.
Database Management System (DBMS)-এর দায়িত্বে থাকা গুরুত্বপূর্ণ ব্যক্তিকে সাধারণত Database Administrator (DBA) বলা হয়। তাঁর প্রধান দায়িত্বগুলো হলো:
১. Database Design: কোম্পানির প্রয়োজন অনুযায়ী Database ডিজাইন ও সংগঠিত করা।
২. Data Security: অননুমোদিত প্রবেশ থেকে Database-কে সুরক্ষিত রাখা এবং Data-র গোপনীয়তা নিশ্চিত করা।
৩. Backup and Recovery: নিয়মিত Database Backup নেওয়া এবং System Failure বা Data হারিয়ে গেলে তা পুনরুদ্ধার করা।
৪. Performance Monitoring: Database-এর কার্যক্ষমতা পর্যবেক্ষণ ও উন্নত করা, যাতে Data দক্ষতার সঙ্গে প্রক্রিয়াকরণ করা যায়।
৫. User Management: User Account তৈরি করা এবং প্রয়োজন অনুযায়ী Access Permission প্রদান করা।
৬. Data Integrity: Data-র নির্ভুলতা, সামঞ্জস্য এবং নির্ভরযোগ্যতা নিশ্চিত করা।
৭. Database Maintenance: Update ইনস্টল করা, Storage পরিচালনা করা এবং Database-এর সমস্যা সমাধান করা।
৮. Availability: Database সচল রাখা এবং নির্ভরযোগ্যভাবে কাজ করছে তা নিশ্চিত করা।
- ☆40Database Management SystemER DigramDraw a E-R Diagram about Railway Reservations System. Where has a Passengers, Terminal, Train, Seat schemas and different attribute.Sonali, O(it), 21 | Officer (IT)

- ☆41Database Management SystemkeysFind the primary key and foreign key after decomposition of the given schema (Branch_name, Acc_name, Balance, Brnach_city, Assets) and then identify which normalization it is?BB, AD(ICT), 25 | Bangladesh Bank
Original Schema:
The original schema had attributes like Branch_name, Acc_name, Balance, Branch_city, and Assets.
Initially, everything was in a single table, but it had some issues because Branch_name was part of the key for identifying branch info, while Acc_no was the key for account info.
After Decomposition:
1. Account Table:
- Primary Key: Acc_no (Each account has a unique identifier).
- Foreign Key: Branch_name (This links each account to a branch).
- Non-key attributes (Acc_name, Balance) fully depend on Acc_no.
2. Branch Table:
- Primary Key: Branch_name (Each branch has a unique name).
- Non-key attributes (Branch_city, Assets) fully depend on Branch_name.
Why 2NF?
2NF (Second Normal Form) means:
- There are no partial dependencies (where attributes depend on part of the key).
- In each table, all non-key attributes depend entirely on the full primary key.
So, by breaking up the data into two tables, we've removed partial dependencies and made the schema 2NF.
Explanation:
১. প্রথমে একক টেবিলের স্কিমা:
আমাদের কাছে প্রথমে ছিল একটি টেবিল, এই টেবিলটির মধ্যে অ্যাট্রিবিউটগুলো হলো:
(Branch_name, Acc_name, Balance, Branch_city, Assets)
এই টেবিলটি ছিল একক টেবিল, কিন্তু এতে কিছু সমস্যা ছিল—বিশেষত partial dependency। এর মানে হলো, কিছু অ্যাট্রিবিউট (যেমন Branch_city এবং Assets) Branch_name এর উপর নির্ভরশীল, যেটি এই টেবিলের একটি অংশ। যাতে নরমালাইজেশন ছিলো না।
২. ডিকম্পোজিশন (Decomposition):
এখন, এই সমস্যা সমাধান করতে আমরা টেবিলটিকে দুটি আলাদা টেবিলে ভাগ করি:
Account Table:
(Account_no, Acc_name, Balance, Branch_name)
- Primary Key: Acc_noAcc_no একটি ইউনিক আইডেন্টিফায়ার, যা প্রতিটি অ্যাকাউন্টকে ইউনিক করে।
- Foreign Key: Branch_nameBranch_name একটি ফরেন কী হিসেবে কাজ করে, যা
Branchটেবিলের শাখার নামের সাথে সম্পর্কিত।
Branch Table:
- Primary Key: Branch_nameBranch_name শাখার ইউনিক আইডেন্টিফায়ার।
- Foreign Key: এখানে কোনো ফরেন কী নেই।
৩. ২NF (Second Normal Form):
Partial Dependency:
প্রথম স্কিমাতে Branch_name ছিল একটি অংশ, যা Branch_city এবং Assets এর মতো শাখার তথ্য ধারণ করছিল। তবে, অ্যাকাউন্টের জন্য প্রাথমিক কী Acc_no পুরোপুরি অ্যাকাউন্টের তথ্য (Acc_name, Balance) নির্ধারণ করতে ব্যবহৃত হয়।
ডিকম্পোজিশন করার পর, Account টেবিলের সমস্ত অ-প্রাথমিক অ্যাট্রিবিউট Acc_no এর উপর নির্ভরশীল হয়েছে, আর Branch টেবিলের সমস্ত অ-প্রাথমিক অ্যাট্রিবিউট Branch_name এর উপর নির্ভরশীল।
এটি partial dependency দূর করেছে, যেখানে কোনো অ্যাট্রিবিউট প্রাথমিক কীর একটি অংশের উপর নির্ভরশীল ছিল না।
২NF অর্জিত হয়েছে কারণ:
- Account টেবিলের সকল Non-key Attribute Acc_no এর উপর নির্ভরশীল।
- Branch টেবিলের সকল Non-key Attribute Branch_name এর উপর নির্ভরশীল
এই ডিকম্পোজিশনটি নিশ্চিত করেছে যে, আমরা partial dependency দূর করেছি এবং প্রতিটি টেবিলের Non-key Attribute তাদের পুরো primary keyএর উপর নির্ভরশীল। এর ফলে আমরা ২NF (Second Normal Form) অর্জন করেছি।
- ☆42Database Management SystemDeadlock in DBMSWhen does a Deadlock occur and how do you prevent it in a database?CB, SO(IT), 20 | Senior Officer (IT)
Techniques to Prevent Deadlock in DBMS
A Deadlock occurs when two or more transactions wait indefinitely for resources held by each other. The following techniques can be used to prevent or handle deadlocks in a DBMS:
1. Wait-Die and Wound-Wait Schemes:
These schemes decide whether a transaction should wait or be aborted when a resource is requested. In the Wait-Die scheme, an older transaction may wait, while a younger transaction requesting a resource held by an older transaction is aborted. In the Wound-Wait scheme, an older transaction can preempt (abort) a younger transaction.2. Timeout Mechanism:
A transaction is automatically aborted if it waits for a lock longer than a specified time. This prevents transactions from waiting indefinitely and helps reduce deadlocks.3. Resource Ordering:
All transactions are required to request resources in a predefined order. This prevents the Circular Wait condition, which is one of the necessary conditions for deadlock.4. Preemptive Resource Allocation:
If necessary, a resource can be released from a transaction that can safely be aborted. The resource is then allocated to another transaction, helping to avoid deadlock.5. Deadlock Detection Algorithms:
The DBMS can periodically check for deadlocks using a Wait-for Graph. If a cycle is detected in the graph, one of the transactions involved in the cycle can be aborted or rolled back to resolve the deadlock.Conclusion:
Deadlocks can be prevented or resolved using Wait-Die/Wound-Wait schemes, Timeout, Resource Ordering, Preemptive Resource Allocation, and Deadlock Detection. These techniques help maintain efficient and reliable database transaction processing.
DBMS-এ Deadlock প্রতিরোধের কৌশলসমূহ
যখন দুই বা ততোধিক Transaction একে অপরের দ্বারা ব্যবহৃত Resource-এর জন্য অনির্দিষ্টকাল অপেক্ষা করে, তখন Deadlock সৃষ্টি হয়। DBMS-এ Deadlock প্রতিরোধ বা নিয়ন্ত্রণের জন্য নিম্নলিখিত কৌশলগুলো ব্যবহার করা হয়:
১. Wait-Die এবং Wound-Wait Scheme:
এই Scheme-গুলো নির্ধারণ করে কোনো Transaction অপেক্ষা করবে নাকি Abort হবে। Wait-Die Scheme-এ পুরোনো Transaction অপেক্ষা করতে পারে, কিন্তু কোনো পুরোনো Transaction-এর কাছে থাকা Resource-এর জন্য অপেক্ষাকৃত নতুন Transaction Abort হয়। Wound-Wait Scheme-এ পুরোনো Transaction প্রয়োজনে নতুন Transaction-কে Abort করে Resource নিতে পারে।২. Timeout Mechanism:
কোনো Transaction নির্দিষ্ট সময়ের বেশি Lock-এর জন্য অপেক্ষা করলে সেটিকে স্বয়ংক্রিয়ভাবে Abort করা হয়। এর ফলে Transaction অনির্দিষ্টকাল অপেক্ষা করতে পারে না এবং Deadlock-এর সম্ভাবনা কমে।৩. Resource Ordering:
সকল Transaction-কে একটি নির্দিষ্ট ক্রম অনুযায়ী Resource Request করার নিয়ম করা হয়। এর ফলে Circular Wait Condition প্রতিরোধ করা যায়, যা Deadlock-এর একটি গুরুত্বপূর্ণ কারণ।৪. Preemptive Resource Allocation:
যদি কোনো Transaction-কে নিরাপদে Abort করা যায়, তাহলে তার দখলে থাকা Resource Release করে অন্য Transaction-কে দেওয়া যেতে পারে। এর মাধ্যমে Deadlock এড়ানো যায়।৫. Deadlock Detection Algorithm:
DBMS একটি Wait-for Graph ব্যবহার করে নিয়মিত Deadlock শনাক্ত করতে পারে। Graph-এ কোনো Cycle পাওয়া গেলে Cycle-এর একটি Transaction Abort বা Rollback করে Deadlock সমাধান করা হয়।উপসংহার:
DBMS-এ Wait-Die/Wound-Wait Scheme, Timeout, Resource Ordering, Preemptive Resource Allocation এবং Deadlock Detection ব্যবহার করে Deadlock প্রতিরোধ বা সমাধান করা যায়। এগুলো Database Transaction Processing-কে কার্যকর ও নির্ভরযোগ্য রাখতে সাহায্য করে।
- ☆43Database Management SystemTriggerWhat is trigger? When it is used? Write down some advantages of trigger.SB & JB, ADA, 22 | ADA
A Trigger is a special type of Stored Procedure in a Database Management System (DBMS) that automatically executes (fires) when a specified event occurs on a table or view. These events are typically INSERT, UPDATE, or DELETE operations.
When is a Trigger Used?
Triggers are used when certain actions need to be performed automatically after or before changes are made to database data.
Common uses of Triggers include:
• Automatically maintaining Audit Logs.
• Enforcing Business Rules and data integrity.
• Validating data before insertion or update.
• Automatically updating related tables.
• Preventing unauthorized or invalid data modifications.Advantages of Trigger
• Executes automatically without user intervention.
• Maintains data consistency and integrity.
• Reduces repetitive application code.
• Helps implement complex business rules.
• Keeps an audit trail of database changes.
• Improves database security by controlling data modifications.Example
A Trigger can automatically store the old employee salary in an Audit Table whenever the salary is updated.
- ☆44Database Management SystemACID PropertiesDescribe Database ACID PropertiesRAKUB, ADA, 20 | Assistant Database Administrator
- ☆45Database Management SystemIndexingWhat is Indexing? Write down the usages of Indexing.RAKUB, ADA, 20 | Assistant Database Administrator















