A database has a Managers table and an Employees table. The Employees table references the Managers table using a Foreign Key. The database is set to ON DELETE CASCADE. (a) Explain what ON DELETE CASCADE means in simple English. (b) If you delete one Manager from the database, what will automatically happen to all Emgim2. (b) If you delete one Manager from the database, what will automatically happen to all Employees under that manager? (c) Explain why this is very dangerous in a real banking system. What is the best practice and how does it fix this danger?

Updated: 2 months ago
উত্তরঃ

(a) Meaning of ON DELETE CASCADE:

ON DELETE CASCADE is a foreign key constraint action in relational database management systems. It specifies that if a record in the parent table (referenced table) is deleted, all corresponding records in the child table (referencing table) that depend on that parent record will automatically be deleted as well.

(b) Consequence of Deleting a Manager:

If you delete one manager from the Managers table, all employee records in the Employees table that reference that manager via the foreign key will be automatically and permanently removed from the database.

(c) Danger in a Banking System and Best Practices:

Why it is dangerous in a real banking system:

        
  • Loss of Audit Trail: Banking systems strictly require immutable financial records and audit trails. Automatic cascading deletions physically destroy historical data, ledger associations, and transaction histories.
  •     
  • Accidental Mass Destruction: Deleting a single parent record (such as a Manager, Account, or Branch) could accidentally wipe out hundreds or thousands of dependent customer or employee records without warning or confirmation.
  •     
  • Security and Regulatory Non-Compliance: Critical banking data disappearing automatically makes fraud detection impossible, violating statutory legal and financial compliance rules.

Best Practice and Solution:

        
  • ON DELETE RESTRICT / NO ACTION: Change the foreign key constraint to RESTRICT or NO ACTION. This prevents the deletion of a parent record as long as dependent child records exist, throwing an error and requiring the administrator to manually reassign or archive dependent data first.
  •     
  • Soft Deletes (Logical Deletion): Instead of physically running a DELETE command, use a flag column (e.g., is_active = FALSE or deleted_at = TIMESTAMP) to mark records as inactive while preserving all historical data for auditing and reporting.
Satt AI
Satt AI
2 weeks ago
38

Related Question

View All
উত্তরঃ

কম্পিউটারের মেমরি (Memory) ব্যবস্থায় RAM (Random Access Memory) এবং ROM (Read Only Memory) উভয়ই গুরুত্বপূর্ণ ভূমিকা পালন করে। এদের মৌলিক প্রকৃতি ও কার্যকারিতার মধ্যে বেশ কিছু সুস্পষ্ট পার্থক্য বিদ্যমান, যা নিচে একটি সারণীর মাধ্যমে ব্যাখ্যা করা হলো:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
বৈশিষ্ট্য (Feature)RAM (র‍্যাম)ROM (রম)
পুরো নাম (Full Name)Random Access MemoryRead Only Memory
প্রকৃতি (Nature)এটি একটি Volatile (উদ্বায়ী) মেমরি।এটি একটি Non-volatile (অনুদ্বায়ী) মেমরি।
ডেটা সংরক্ষণ (Data Storage)অস্থায়ীভাবে ডেটা সংরক্ষণ করে। কম্পিউটার চালু থাকাকালীন ডেটা ও প্রোগ্রাম লোড করে।স্থায়ীভাবে ডেটা সংরক্ষণ করে। গুরুত্বপূর্ণ সিস্টেম ফাইল ও ফার্মওয়্যার (Firmware) থাকে।
ডেটা পরিবর্তন (Data Modification)ডেটা পড়া (Read) এবং লেখা (Write) উভয়ই করা যায়, অর্থাৎ ডেটা পরিবর্তনযোগ্য।সাধারণত শুধু ডেটা পড়া যায়; ডেটা লেখা বা পরিবর্তন করা কঠিন বা বিশেষ পদ্ধতির প্রয়োজন।
গতি (Speed)ROM-এর চেয়ে অনেক দ্রুত কাজ করে।RAM-এর চেয়ে ধীর গতিসম্পন্ন।
বিদ্যুৎ চলে গেলে (Power Off)বিদ্যুৎ সরবরাহ বন্ধ হলে এতে সংরক্ষিত সমস্ত ডেটা হারিয়ে যায়।বিদ্যুৎ সরবরাহ বন্ধ হলেও এতে সংরক্ষিত ডেটা অক্ষত থাকে।
ব্যবহার (Usage)অপারেটিং সিস্টেম (Operating System), অ্যাপ্লিকেশন প্রোগ্রাম (Application Program) এবং বর্তমান কাজের ডেটা লোড করার জন্য ব্যবহৃত হয়।কম্পিউটার চালু করার জন্য প্রয়োজনীয় বুটস্ট্র্যাপ নির্দেশাবলী (Bootstrap Instructions) এবং বায়োস (BIOS) বা ইউইএফআই (UEFI) ফার্মওয়্যার সংরক্ষণ করে।
ক্ষমতা (Capacity)সাধারণত GB (গিগাবাইট)-এর এককে পরিমাপ করা হয় (যেমন: 4GB, 8GB, 16GB)।সাধারণত MB (মেগাবাইট)-এর এককে পরিমাপ করা হয় (যেমন: 4MB, 8MB, 16MB)।
উদাহরণ (Examples)DRAM (Dynamic RAM), SRAM (Static RAM)।PROM (Programmable ROM), EPROM (Erasable PROM), EEPROM (Electrically Erasable PROM)।

সংক্ষেপে, RAM একটি দ্রুত, অস্থায়ী কার্যকারী মেমরি যা কম্পিউটারকে বর্তমান কাজগুলো সম্পাদন করতে সাহায্য করে, অন্যদিকে ROM একটি ধীর, স্থায়ী মেমরি যা কম্পিউটার চালু করার জন্য অপরিহার্য মৌলিক নির্দেশাবলী সংরক্ষণ করে।

Satt AI
Satt AI
1 month ago
341
শিক্ষকদের জন্য বিশেষভাবে তৈরি

১ ক্লিকে প্রশ্ন, শীট, সাজেশন
অনলাইন পরীক্ষা তৈরির সফটওয়্যার!

শুধু প্রশ্ন সিলেক্ট করুন — প্রশ্নপত্র অটোমেটিক তৈরি!

প্রশ্ন এডিট করা যাবে
জলছাপ দেয়া যাবে
ঠিকানা যুক্ত করা যাবে
Logo, Motto যুক্ত হবে
অটো প্রতিষ্ঠানের নাম
অটো সময়, পূর্ণমান
প্রশ্ন এডিট করা যাবে
জলছাপ দেয়া যাবে
ঠিকানা যুক্ত করা যাবে
Logo, Motto যুক্ত হবে
অটো প্রতিষ্ঠানের নাম
অটো সময়, পূর্ণমান
অটো নির্দেশনা (এডিটযোগ্য)
অটো বিষয় ও অধ্যায়
OMR সংযুক্ত করা যাবে
ফন্ট, কলাম, ডিভাইডার
প্রশ্ন/অপশন স্টাইল পরিবর্তন
সেট কোড, বিষয় কোড
অটো নির্দেশনা (এডিটযোগ্য)
অটো বিষয় ও অধ্যায়
OMR সংযুক্ত করা যাবে
ফন্ট, কলাম, ডিভাইডার
প্রশ্ন/অপশন স্টাইল পরিবর্তন
সেট কোড, বিষয় কোড
এখনই শুরু করুন ডেমো দেখুন
৫০,০০০+
শিক্ষক
৩০ লক্ষ+
প্রশ্নপত্র
মাত্র ১৫ পয়সায় প্রশ্নপত্র
১ ক্লিকে প্রশ্ন, শীট, সাজেশন তৈরি করুন আজই

Complete Exam
Preparation

Learn, practice, analyse and improve

1M+ downloads
4.6 · 8k+ Reviews