Jahangirnagar University — Department of CSE — Admission: 2016 (PMSCS Program)প্রশ্ন ও সমাধান
- Set by
- Jahangirnagar University
- Exam date
- 2016
- Questions
- 6 (0 MCQ, 6 written)
- Exam guide
- M.Sc. admission (CSE and ICT) · এমএসসি ভর্তি (সিএসই ও আইসিটি)
- Mathematics · গণিত 2
- Algorithms · অ্যালগরিদম 1
- Cyber Security · সাইবার নিরাপত্তা 1
- Database · ডেটাবেজ 1
- Programming · প্রোগ্রামিং 1
The Difference between Passive and Active Attacks on a Computer?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Express the following data in normalized form -5, 5, 15, -1, 20.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
What does Referential Integrity (RI) mean?
Model answer
Referential Integrity (RI) is the rule that a foreign key value in one table must either be NULL or match an existing primary key value in the referenced table — it guarantees relationships between tables always point to something real.
erDiagram
DEPARTMENT ||--o{ EMPLOYEE : employs
CREATE TABLE Department (
dept_id INT PRIMARY KEY,
dept_name VARCHAR(50)
);
CREATE TABLE Employee (
emp_id INT PRIMARY KEY,
name VARCHAR(50),
dept_id INT,
FOREIGN KEY (dept_id) REFERENCES Department(dept_id)
);
- With this constraint in place, an
Employeerow cannot reference adept_idthat doesn't exist inDepartment— the database rejects such an INSERT/UPDATE outright. - RI also governs what happens on deletion of a referenced row, via explicit rules:
| Rule | Effect when the referenced Department row is deleted |
|---|---|
ON DELETE RESTRICT (default) |
Deletion is blocked while employees still reference it |
ON DELETE CASCADE |
All employees in that department are deleted too |
ON DELETE SET NULL |
Employees' dept_id is set to NULL |
Why it matters: without RI, a database could end up with orphaned rows — e.g. an Employee pointing at dept_id = 99 when Department 99 has been deleted — silently corrupting the data's logical meaning and breaking any JOIN that relies on that relationship.
Exam takeaway: Referential Integrity = "every foreign key value must exist as a primary key in the referenced table (or be NULL)" — enforced automatically once a FOREIGN KEY constraint is declared, and its ON DELETE/ON UPDATE clauses decide how to handle the referenced row's removal.
Let a and b the positive integers and suppose Q is defined recursively as flows Q(a,b) = 0 if (a<b), Q(a-b,b)+1 if b<=a
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Difference between Call by Value and Call by Reference?
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Write an Expression for the following series 151, 152, 153, 161, 162, 163, 171............N
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers · M.Sc. admission (CSE and ICT) guide